http://stackoverflow.com/tag/html
tags question: http://stackoverflow.com/q/28299852
tags question: http://stackoverflow.com/q/28426989
tags question: http://stackoverflow.com/q/28313310
tags question: http://stackoverflow.com/q/28292676
tags question: http://stackoverflow.com/q/28335499
tags question: http://stackoverflow.com/q/28310434
tags question: http://stackoverflow.com/q/28383746
tags question: http://stackoverflow.com/q/28343975
tags question: http://stackoverflow.com/q/28331858
tags question: http://stackoverflow.com/q/28286675
tags question: http://stackoverflow.com/q/28291816
tags question: http://stackoverflow.com/q/28285233
tags question: http://stackoverflow.com/q/28385539
tags question: http://stackoverflow.com/q/28335790
tags question: http://stackoverflow.com/q/28368510
tags question: http://stackoverflow.com/q/28298824
tags question: http://stackoverflow.com/q/28398151
tags question: http://stackoverflow.com/q/28305914
tags question: http://stackoverflow.com/q/28284855
tags question: http://stackoverflow.com/q/28326943
tags question: http://stackoverflow.com/q/28280528
tags question: http://stackoverflow.com/q/28360207
tags question: http://stackoverflow.com/q/28391918
tags question: http://stackoverflow.com/q/28378740
tags question: http://stackoverflow.com/q/28380547
tags question: http://stackoverflow.com/q/28419424
tags question: http://stackoverflow.com/q/28346474
tags question: http://stackoverflow.com/q/28356348
tags question: http://stackoverflow.com/q/28424891
tags question: http://stackoverflow.com/q/28382344
tags question: http://stackoverflow.com/q/28427853
tags question: http://stackoverflow.com/q/28335226
tags question: http://stackoverflow.com/q/28396244
tags question: http://stackoverflow.com/q/28394046
tags question: http://stackoverflow.com/q/28436650
tags question: http://stackoverflow.com/q/28399571
tags question: http://stackoverflow.com/q/28311859
tags question: http://stackoverflow.com/q/28388084
tags question: http://stackoverflow.com/q/28337919
tags question: http://stackoverflow.com/q/28329424
tags question: http://stackoverflow.com/q/28420496
tags question: http://stackoverflow.com/q/28311910
tags question: http://stackoverflow.com/q/28345488
tags question: http://stackoverflow.com/q/28378494
tags question: http://stackoverflow.com/q/28349133
tags question: http://stackoverflow.com/q/28302469
tags question: http://stackoverflow.com/q/28331464
tags question: http://stackoverflow.com/q/28377352
tags question: http://stackoverflow.com/q/28352641
tags question: http://stackoverflow.com/q/28365839
tags question: http://stackoverflow.com/q/28336153
tags question: http://stackoverflow.com/q/28390062
tags question: http://stackoverflow.com/q/28424230
tags question: http://stackoverflow.com/q/28390322
tags question: http://stackoverflow.com/q/28375803
tags question: http://stackoverflow.com/q/28367048
tags question: http://stackoverflow.com/q/28433766
tags question: http://stackoverflow.com/q/28418409
tags question: http://stackoverflow.com/q/28420724
tags question: http://stackoverflow.com/q/28410087
tags question: http://stackoverflow.com/q/28367098
tags question: http://stackoverflow.com/q/28301617
tags question: http://stackoverflow.com/q/28432350
tags question: http://stackoverflow.com/q/28404556
tags question: http://stackoverflow.com/q/28337272
tags question: http://stackoverflow.com/q/28342050
tags question: http://stackoverflow.com/q/28423690
tags question: http://stackoverflow.com/q/28374884
tags question: http://stackoverflow.com/q/28327932
tags question: http://stackoverflow.com/q/28411468
tags question: http://stackoverflow.com/q/28360149
tags question: http://stackoverflow.com/q/28353781
tags question: http://stackoverflow.com/q/28417138
tags question: http://stackoverflow.com/q/28282742
tags question: http://stackoverflow.com/q/28335649
tags question: http://stackoverflow.com/q/28346733
tags question: http://stackoverflow.com/q/28416164
tags question: http://stackoverflow.com/q/28321604
tags question: http://stackoverflow.com/q/28367192
tags question: http://stackoverflow.com/q/28320178

http://stackoverflow.com/comment/45077507
type: QuestionComment
has text: `Object.freeze` is working strictly speaking: that is, prevents new properties from being added to it; prevents existing properties from being removed; and prevents existing properties, or their enumerability, configurability, or writability, from being changed. So `method` is now frozen. But you actually want to define only the property `method` on `obj` and as mentioned `definedProperty` is what you need. But without `freeze` you will still be able to do, for example, `obj.method.something = function () {};`
score: 0
comment on: http://stackoverflow.com/q/28367776
type: Comment

http://stackoverflow.com/comment/44936652
has text: @JackTuck: There is only a single object in your code. Assigning a property to an object does not create a new object. Maybe it's easier to see without a loop: `var arr = []; var obj = {}; arr[0] = obj; arr[1] = obj; arr[2] = obj; obj.foo = 'bar';`. That's what you are doing basically. The same object is added to the array multiple times.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28290144
type: Comment

http://stackoverflow.com/q/28420685
downvote count: 0
tagged with: asp.net-web-api
tagged with: javascript
score: 1
favorite count: 0
tagged with: angularjs
type: Question
has title: Web Api 2 Attribute Routing and Angular JS params
accepted answer: http://stackoverflow.com/a/28420828
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/28420828
has body: So if I have this controller action: [Route("{id:int}")] public async Task&lt;JsonResponse&gt; GetAsync(int id) { } Sending data to it from Angular, like this: $http.get('/api/someController', { params: { id: someId } }); Doesn't cut it. It needs to have the URL generated to look like this: /api/someController/someId I would like to retain this Web API 2 feature, so how do I get Angular to build my URL differently? Apart from the obvious: $http.get('api/someController/' + someId); If it has to be done the above way, I don't mind. However, I'm just wondering if someone has a solution for this? That isn't overly complicated.
tagged with: asp.net-web-api2
type: AnsweredQuestion

http://stackoverflow.com/comment/45181615
comment on: http://stackoverflow.com/q/28424447
score: 1
has text: you can use ajax to submit the post to php and process it there
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28423159
favorite count: 0
tagged with: semantic-ui
type: Question
tagged with: requirejs
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/45179359
has title: Can't get google maps to work with requirejs
has comment: http://stackoverflow.com/comment/45179344
answer count: 1
tagged with: google-maps
tagged with: javascript
has answer: http://stackoverflow.com/a/28444932
type: UnansweredQuestion
downvote count: 0
score: 1
has body: I am quite new to require js, I have tried everything one could possibly find on google regarding google maps and require js. Everything else is ok on my page but google map, if I refresh the page google map shows up fine but when navigating through pages it won't. Here's my main.js require(['jquery','semantic','gmap'],function($,sm,gmap){ function initGMap(){ console.log('Initiating google maps'); //please ignore 'Info' var myMap = new gmap.Map(document.getElementById('gmap-canvas'),{ center: new gmap.LatLng(Info.lat, Info.lon), zoom: 15, mapTypeId: gmap.MapTypeId.ROADMAP }); var infowindow = new gmap.InfoWindow({ content: Info.contStr }); var marker = new gmap.Marker({ position: new gmap.LatLng(Info.lat, Info.lon), map: myMap, title: 'My Title', }); infowindow.open(myMap, marker); gmap.event.addListener(marker, 'click', function() { infowindow.open(myMap,marker); }); $('#gmap-canvas').on('load',function(){ gmap.event.trigger(myMap, 'resize'); map.setZoom( myMap.getZoom() ); }) } gmap.event.addDomListener(window, 'load', initGMap); $(document).bind("projectLoadComplete", initGMap); }); This is what my gmap.js looks like define('gmap',['async!https://maps.googleapis.com/maps/api/js?key=API_KEY'],function(){ return window.google.maps;}) There isn't any other script file on the page than requirejs itself using the basic script tag like &lt;script data-main="scripts/main" type="text/JavaScript" src="scripts/require.js"&gt;&lt;/script&gt; Note: I am using semantic-ui though if that makes any difference ANY SUGGESTIONS WILL BE APPRECIATED!!

javascript
tags question: http://stackoverflow.com/q/28337512
tags question: http://stackoverflow.com/q/28401871
tags question: http://stackoverflow.com/q/28407641
tags question: http://stackoverflow.com/q/28305874
tags question: http://stackoverflow.com/q/28424327
tags question: http://stackoverflow.com/q/28422873
tags question: http://stackoverflow.com/q/28294937
tags question: http://stackoverflow.com/q/28390319
tags question: http://stackoverflow.com/q/28402779
tags question: http://stackoverflow.com/q/28389746
tags question: http://stackoverflow.com/q/28331606
tags question: http://stackoverflow.com/q/28307731
tags question: http://stackoverflow.com/q/28360612
tags question: http://stackoverflow.com/q/28349285
tags question: http://stackoverflow.com/q/28400764
tags question: http://stackoverflow.com/q/28347414
tags question: http://stackoverflow.com/q/28363916
tags question: http://stackoverflow.com/q/28297982
tags question: http://stackoverflow.com/q/28294681
tags question: http://stackoverflow.com/q/28293061
tags question: http://stackoverflow.com/q/28311086
tags question: http://stackoverflow.com/q/28432151
tags question: http://stackoverflow.com/q/28435308
tags question: http://stackoverflow.com/q/28312041
tags question: http://stackoverflow.com/q/28357647
tags question: http://stackoverflow.com/q/28363540
tags question: http://stackoverflow.com/q/28330097
tags question: http://stackoverflow.com/q/28412319
tags question: http://stackoverflow.com/q/28306953
tags question: http://stackoverflow.com/q/28373894
tags question: http://stackoverflow.com/q/28347728
tags question: http://stackoverflow.com/q/28338832
tags question: http://stackoverflow.com/q/28377994
tags question: http://stackoverflow.com/q/28303487
tags question: http://stackoverflow.com/q/28389484
tags question: http://stackoverflow.com/q/28375543
tags question: http://stackoverflow.com/q/28342910
tags question: http://stackoverflow.com/q/28305760
tags question: http://stackoverflow.com/q/28348893
tags question: http://stackoverflow.com/q/28288529
tags question: http://stackoverflow.com/q/28386665
tags question: http://stackoverflow.com/q/28394244
tags question: http://stackoverflow.com/q/28415318
tags question: http://stackoverflow.com/q/28392979
tags question: http://stackoverflow.com/q/28280846
tags question: http://stackoverflow.com/q/28297839
tags question: http://stackoverflow.com/q/28402458
tags question: http://stackoverflow.com/q/28336626
tags question: http://stackoverflow.com/q/28392023
tags question: http://stackoverflow.com/q/28313780
tags question: http://stackoverflow.com/q/28308803
tags question: http://stackoverflow.com/q/28352498
tags question: http://stackoverflow.com/q/28336601
tags question: http://stackoverflow.com/q/28377388
tags question: http://stackoverflow.com/q/28292107
tags question: http://stackoverflow.com/q/28414446
tags question: http://stackoverflow.com/q/28348558
tags question: http://stackoverflow.com/q/28386975
tags question: http://stackoverflow.com/q/28358902
tags question: http://stackoverflow.com/q/28363666
tags question: http://stackoverflow.com/q/28369522
tags question: http://stackoverflow.com/q/28291374
tags question: http://stackoverflow.com/q/28350236
tags question: http://stackoverflow.com/q/28402931
tags question: http://stackoverflow.com/q/28362392
tags question: http://stackoverflow.com/q/28401252
tags question: http://stackoverflow.com/q/28310418
tags question: http://stackoverflow.com/q/28323345
tags question: http://stackoverflow.com/q/28335443
tags question: http://stackoverflow.com/q/28413474
tags question: http://stackoverflow.com/q/28296088
tags question: http://stackoverflow.com/q/28363253
tags question: http://stackoverflow.com/q/28392181
tags question: http://stackoverflow.com/q/28383249
tags question: http://stackoverflow.com/q/28424575
tags question: http://stackoverflow.com/q/28413586
tags question: http://stackoverflow.com/q/28359690
tags question: http://stackoverflow.com/q/28406403
tags question: http://stackoverflow.com/q/28290021
tags question: http://stackoverflow.com/q/28318633

http://stackoverflow.com/comment/45065248
comment on: http://stackoverflow.com/q/28361427
type: Comment
type: QuestionComment
has text: Map-reduce is not designed to resolve Joins. You can't do that. Read: http://docs.mongodb.org/manual/reference/command/mapReduce/#requirements-for-the-map-function
score: 0

http://stackoverflow.com/comment/45199454
comment on: http://stackoverflow.com/q/28434713
score: 0
has text: I'm afraid you're going to need some PHP and AJAX. At least something server-side.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45014437
comment on: http://stackoverflow.com/q/28333648
type: Comment
has text: Sounds like you need more functions that create XMLHttpRequest instances for pulling the different things. Or if you want to return various parts at once, return JSON and parse it all in that one Ajax request.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44995486
type: Comment
type: QuestionComment
has text: put the script tags and everything between before is my next guess.
comment on: http://stackoverflow.com/q/28323480
score: 0

http://stackoverflow.com/a/28436126
answers question: http://stackoverflow.com/q/28435612
accepted answer of: http://stackoverflow.com/q/28435612
has body: According to the Documentation, you need to setup SEEM.setApiSslEnabled(true);. Just try this configuration: //SEEM API Configuration SEEM.setApiPort(443); SEEM.setApiSslEnabled(true); SEEM.setApiUrl('my.example-domain.com'); SEEM.setAutoUuidFetch(true);
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/comment/45021278
type: Comment
comment on: http://stackoverflow.com/q/28337812
score: 0
type: QuestionComment
has text: setting display: none actually affects click event bubbling. set opactiy:0 instead

http://stackoverflow.com/comment/45216258
has text: Using this technique to break the string passed into an array (with "\r" entries) with child elements was sufficient to convince Internet Explorer to behave for the moment. Thank you very much for including the patch code.
type: Comment
comment on: http://stackoverflow.com/a/28377616
score: 0
type: AnswerComment

http://stackoverflow.com/q/28398515
tagged with: servlets
has answer: http://stackoverflow.com/a/28401424
downvote count: 0
tagged with: jsp
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
type: Question
has title: Javascript changes dissapear when going back from servlet to JSP
score: 1
favorite count: 0
has body: Good evening, I have a form on a JSP page that's connected to a servlet, that form has some dynamic parts using JavaScript like adding a row to a table or adding a text field based on the selected option on a select element, Actually my problem is that I have some validations on the servlet-side, so when I go to servlet to check the (National ID) for example if there's any problem or any violations to my validation I force to get back to the form using : if (dbm.MatchIdNumber(Candidate.getRegNumber(), Candidate.getNationalID()) == false) { out.println("&lt;script&gt;\n" + " alert('Your National Id does not match your Registration Number');\n" + "&lt;/script&gt;"); out.println("&lt;script&gt;\n" + " window.history.go(-1);\n" + "&lt;/script&gt;"); } What happens is when I get back to the form I lose all the JavaScript changes, Which's very important. I've been reading for a while that using ajax might be the optimal solution for me, but here is my questions: Is there a way to call a java method from JavaScript or JQuery before getting to servlet without using ajax !?! Is there a way to get back from the servlet to the jsp page with the ability to keep all the JavaScript Chages !? If not !!, How to use ajax in my case ?! Thank you so much
upvote count: 1
answer count: 1
tagged with: java

http://stackoverflow.com/comment/45085884
type: AnswerComment
comment on: http://stackoverflow.com/a/28351550
has text: then pleasee select it as the answer :)
type: Comment
score: 0

http://stackoverflow.com/q/28408688
tagged with: iframe
has comment: http://stackoverflow.com/comment/45152559
upvote count: 1
type: Question
has body: Here is my http://jsfiddle.net/j88u02o2/59/ This is script for slider: $(function() { $('#slides').crossSlide({ speed: 40, fade: 1 }, [ { src: 'img/photo-2.jpg', dir: 'up', alt: 'Our Business is to Encrypt and Secure Your Communications', href: '#' }, { src: 'img/photo-10.jpg', dir: 'down', alt: 'The Solution for Secured Communications and Privacy.', href: '#' }, { src: 'img/photo-3.jpg', dir: 'up', alt: 'All Text and Phone Communications are Encrypted End-to-End.', href: '#' }, { src: 'img/photo-4.jpg', dir: 'down', alt: 'Secured Communications for Law Enforcement and Public Officials.', href: '#' }, { src: 'img/photo-5.jpg', dir: 'up', alt: 'Secured Communications for the U.S. Military.', href: '#' }, { src: 'img/photo-6.jpg', dir: 'down', alt: 'The World Leader in Encrypted Communications.', href: '#' }, { src: 'img/photo-7.jpg', dir: 'down', alt: 'The Solution for Corporate Executives, Law Enforcement, Homeland Security, Goverment Agencies and more...', href: '#' } /* */ ], function(idx, img, idxOut, imgOut) { if (idxOut == undefined) { if(idx == 0 || idx == 3 || idx == 6 || idx == 9){ document.getElementById('crossSlideCaption').style.marginTop = '-425px'; document.getElementById('crossSlideCaption').style.marginLeft = '-480px'; }else if(idx == 1 || idx == 4 || idx == 7 || idx == 10 || idx == 12){ document.getElementById('crossSlideCaption').style.marginTop = '-425px'; document.getElementById('crossSlideCaption').style.marginLeft = '-480px'; }else{ document.getElementById('crossSlideCaption').style.marginTop = '-425px'; document.getElementById('crossSlideCaption').style.marginLeft = '-480px'; }; $('div.caption').text(img.alt).animate({ opacity: 1.0 }) } else { //$('div.caption').animate({ opacity: 0 }) }}); $('div.caption').show().css({ opacity: 0 }) }); Now everything working fine, Now i need to add iframe video to my slideshow like as caption. My video size 420x234 pixels, Here is the code for iframe video: &lt;iframe src="//fast.wistia.net/embed/iframe/bqur1…
tagged with: javascript
has comment: http://stackoverflow.com/comment/45152473
has comment: http://stackoverflow.com/comment/45152130
has comment: http://stackoverflow.com/comment/45151900
has title: How to set iframe video on my slideshow?
has comment: http://stackoverflow.com/comment/45152230
answer count: 1
has answer: http://stackoverflow.com/a/28495487
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45152390
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28495487
score: 1

http://stackoverflow.com/q/28390875
has comment: http://stackoverflow.com/comment/45119349
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45119317
accepted answer: http://stackoverflow.com/a/28391280
tagged with: drop-down-menu
has comment: http://stackoverflow.com/comment/45119797
tagged with: menu
favorite count: 0
has comment: http://stackoverflow.com/comment/45119215
has title: AngularJS Dropdown Always in Open State
tagged with: angularjs
type: Question
has comment: http://stackoverflow.com/comment/45119191
has comment: http://stackoverflow.com/comment/45119639
has comment: http://stackoverflow.com/comment/45119554
has comment: http://stackoverflow.com/comment/45119814
has comment: http://stackoverflow.com/comment/45119802
has comment: http://stackoverflow.com/comment/45119237
has comment: http://stackoverflow.com/comment/45119517
score: 0
has comment: http://stackoverflow.com/comment/45119698
upvote count: 1
has comment: http://stackoverflow.com/comment/45119860
answer count: 1
has answer: http://stackoverflow.com/a/28391280
downvote count: 1
has comment: http://stackoverflow.com/comment/45119303
has comment: http://stackoverflow.com/comment/45119287
has body: I am developing my first App with AngularJS. I am trying to create a Dropdown menu, but unable to bring it under control. Here is the html: Action Split button! Action Another action Something else here Separated link This does give me the desired output as shown below: but the dropdown is always open, instead of toggling. Can someone please advise what I am doing wrong? ======= Here are the header files =========
has comment: http://stackoverflow.com/comment/45119350
tagged with: javascript
has comment: http://stackoverflow.com/comment/45119369
tagged with: angular-ui-bootstrap
has comment: http://stackoverflow.com/comment/45119777
has comment: http://stackoverflow.com/comment/45119749
has comment: http://stackoverflow.com/comment/45119365

http://stackoverflow.com/q/28342630
has title: How to Convert date string to json date format in javascript?
accepted answer: http://stackoverflow.com/a/28343842
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45029719
has comment: http://stackoverflow.com/comment/45035089
answer count: 3
has comment: http://stackoverflow.com/comment/45029826
has comment: http://stackoverflow.com/comment/45030323
has comment: http://stackoverflow.com/comment/45029842
has comment: http://stackoverflow.com/comment/45030528
score: -1
favorite count: 0
has comment: http://stackoverflow.com/comment/45030432
possible better answer: http://stackoverflow.com/a/28342691
has answer: http://stackoverflow.com/a/28359382
tagged with: wcf
has answer: http://stackoverflow.com/a/28342691
has answer: http://stackoverflow.com/a/28343842
has body: In my application I am getting date in a string format like : var date="1988-11-4". I am calling back the WCF service and sending data to the service as Json format. But my problem is the WCF service is only accepting the dates as {DoB:"/Date(570931200000+0530)/"} format. can you please tell how do I convert date to json date format like: var jasonDate="/Date(570931200000+0530)/". Where 570931200000 is the miliseconds calculated since from "1970-01-01" and +0530 is the Timezone.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45030239
downvote count: 1
type: Question

http://stackoverflow.com/comment/45034877
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28342046
has text: Not sure what you're trying to achieve, but having a navigation by pages AND keeping the same chat open in all pages sounds very difficult to me. You could perhaps try to make a single-page app, keep your chat open, and load your pages via ajax?
score: 0

http://stackoverflow.com/a/28406010
has body: Your function is returning undefined because load is asynchronous. getImage is trying to return something before load finished loading. You'll need to pass a callback to execute when the image has loaded, to getImage: function getImage(imgsrc, callback){ var img = $( "&lt;img&gt;", { src: imgsrc }); var imageMap = new Object(); img.load(function() { var canvas = $('&lt;canvas/&gt;')[0].getContext('2d'); canvas.width = this.width; canvas.height = this.height; canvas.drawImage(this, 0, 0, this.width, this.height); for(var i = 0;i &lt; this.width;i++){ imageMap[i] = new Object(); for(var j = 0;j &lt; this.width;j++){ var pixelData = canvas.getImageData(i, j, 1, 1).data; imageMap[i][j] = rgbToHex(pixelData[0],pixelData[1],pixelData[2]); } } console.log(imageMap[40][40]); callback(imageMap) }); } Then you just call the function like this: getImage("http://some.src.jpg", function(imageMap){ // Do stuff with imageMap here; }); Of course, you can also define the callback elsewhere: var myCallback = function(imageMap){ // Do stuff with imageMap here; }; getImage("http://some.src.jpg", myCallback);
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28405879
score: 4
answers question: http://stackoverflow.com/q/28405879
type: AcceptedAnswer
type: Answer
upvote count: 4

http://stackoverflow.com/q/28422112
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/45198346
has comment: http://stackoverflow.com/comment/45212168
has comment: http://stackoverflow.com/comment/45249309
type: Question
has answer: http://stackoverflow.com/a/28422907
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/45178236
has body: I'm working on a like / dislike system for my websites commenting system. I was working off of this tutorial, http://www.webcodo.net/like-dislike-system-with-jquery-ajax-and-php-youtube-like-design/ Except I have multiple like/dislike buttons on every page, because there's multiple comments people have the ability to like/dislike. I'm brand new to ajax btw. Here's the javascript file. $('.like-btn').click(function(){ $('.dislike-btn').removeClass('dislike-h'); $(this).addClass('like-h'); $.ajax({ type:"POST", url:"../outfits/outfit.php", data:'act=like&function=true&pageID=' + pageID + '&user=' + email, success: function(){ } }); }); $('.dislike-btn').click(function(){ $('.like-btn').removeClass('like-h'); $(this).addClass('dislike-h'); $.ajax({ type:"POST", url:"../outfits/outfit.php", data:'act=dislike&function=true&pageID=' + pageID + '&user=' + email, success: function(){ } }); }); This is the "comment row" Comments 5 stars 4 stars 3 stars 2 stars 1 star <?php foreach ($commentRows as $commentRow) { try { $pageID = $commentRow['id']; // The ID of the page, the article or the video ... extract($_POST); $dislike_sql = 'SELECT * FROM likes WHERE user = "'.$email.'" and comment_id = "'.$pageID.'" and rate = 2 '; $stmt = $dbhandle->prepare($dislike_sql); $stmt->execute(); $dislike_count = $stmt->rowCount(); $like_sql = 'SELECT * FROM likes WHERE user = "'.$email.'" and comment_id = "'.$pageID.'" and rate = 1 '; $stmt = $dbhandle->prepare($like_sql); $stmt->execute(); $like_count = $stmt->rowCount(); if($act == 'like'): //if the user click on "like" if(($like_count == 0) && ($dislike_count == 0)){ $rate = 1; $sql = 'INSERT INTO likes (comment_id, user, rate )VALUES(:pageID, :email, :rate)'; //prepare data for insert $stmt = $dbhandle->prepare($sql); $stmt->bindValue(":pageID", $pageID); $stmt->bindValue(":email", $email); $stmt->bindValue(":rate", $rate); //Execute $stmt->execute(); } if($dislike_count == 1){ $rate = 1; $sql = 'UPDATE likes SET rate = ? WHERE comment_…
has title: PHP Ajax Like System

http://stackoverflow.com/q/28401180
favorite count: 0
accepted answer: http://stackoverflow.com/a/28408020
tagged with: elasticsearch
score: 2
has title: Create wordcloud d3.js from elasticsearch
upvote count: 2
tagged with: d3.js
has body: I am using the following example as base and want to make it dynamic word cloud https://github.com/jasondavies/d3-cloud define(['scripts/d3.v3', 'scripts/elasticsearch'], function (d3, elasticsearch) { "use strict"; var client = new elasticsearch.Client(); client.search({ index: 'nfl', size: 5, body: { // Begin query. query: { // Boolean query for matching and excluding items. bool: { must: { match: { "description": "TOUCHDOWN" }}, must_not: { match: { "qtr": 5 }} } }, // Aggregate on the results aggs: { touchdowns: { terms: { field: "qtr", order: { "_term" : "asc" } } } } // End query. } }).then(function (resp) { console.log(resp); // D3 code goes here. var touchdowns = resp.aggregations.touchdowns.buckets; // d3 donut chart var width = 600, height = 300, radius = Math.min(width, height) / 2; var color = ['#ff7f0e', '#d62728', '#2ca02c', '#1f77b4']; var arc = d3.svg.arc() .outerRadius(radius - 60) .innerRadius(120); var pie = d3.layout.pie() .sort(null) .value(function (d) { return d.doc_count; }); var svg = d3.select("#donut-chart").append("svg") .attr("width", width) .attr("height", height) .append("g") .attr("transform", "translate(" + width/1.4 + "," + height/2 + ")"); var g = svg.selectAll(".arc") .data(pie(touchdowns)) .enter() .append("g") .attr("class", "arc"); g.append("path") .attr("d", arc) .style("fill", function (d, i) { return color[i]; }); g.append("text") .attr("transform", function (d) { return "translate(" + arc.centroid(d) + ")"; }) .attr("dy", ".35em") .style("text-anchor", "middle") .style("fill", "white") .text(function (d) { return d.data.key; }); }); this is example code from elasticsearch website how to use with d3 &lt;!DOCTYPE html&gt; &lt;meta charset="utf-8"&gt; &lt;body&gt; &lt;script src="../lib/d3/d3.js"&gt;&lt;/script&gt; &lt;script src="../d3.layout.cloud.js"&gt;&lt;/script&gt; &lt;script&gt; var fill = d3.scale.category20(); d3.layout.cloud().size([300, 300]) .words([ "Hello", "world", "normally", "you", "want", "more", "words", "t…
type: Question
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/28408020
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: word-cloud

http://stackoverflow.com/comment/82840493
comment on: http://stackoverflow.com/a/28354808
type: AnswerComment
score: 0
type: Comment
has text: @dfsq, it's good solution while adding objects into output array. Thanks!

amazon-web-services
tags question: http://stackoverflow.com/q/28326752
type: Tag
tag name: amazon-web-services
tags question: http://stackoverflow.com/q/28313842
tags question: http://stackoverflow.com/q/28291152

http://stackoverflow.com/comment/44994308
has text: Works fine for me in chrome @CodingWithSpike Try the sample above I just added.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28322892
type: Comment

http://stackoverflow.com/q/28334576
tagged with: datetime
tagged with: d3.js
type: AnsweredQuestion
has title: How do I get the current number of tick values from a D3 axis?
type: Question
has answer: http://stackoverflow.com/a/28335263
accepted answer: http://stackoverflow.com/a/28335263
has body: Say I have some data that can span anywhere from 28-31 days. I don't know how many days the data spans, but I know the beginning and ending date, and I create a d3 time scale using the two dates as the domain. If I specify that I want 1 tick per day, is there a way to get the axis to return how many ticks it's going to create? Or put another way, is there another method to determine in Javascript how many days are in a range of two dates?
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45015707
score: 0
linked to: http://stackoverflow.com/q/542938

http://stackoverflow.com/q/28347414
answer count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: ruby-on-rails
type: Question
tagged with: javascript
has body: I have come across an a scenario where I'm not sure if things could be handled better. When using remotipart to upload files through an ajax call, all actions are carried out by js Processing by DocumentsController#create as JS I couldn't get the page to redirect using a js response, but then I found a solution on here if @document.save format.html { redirect_to root_path, notice: success_save_msg } format.js { render :js =&gt; "window.location.href='"+root_path+"'" } else format.html format.js { render action: 'create.js.erb' } end So the page does redirect but i no longer get a notice like I do if I was rendering html. Is there a better way to handle this or a way to show the notice with my current implementation Update I have done this so far (in essence the same thing I know, but thought a little cleaner as redirect path not hard-coded in the controller) if @document.save format.html { redirect_to root_path, notice: success_save_msg } format.js { render action: 'redirect.js.erb } else format.html format.js { render action: 'create.js.erb' } end redirect.js.erb window.location.replace("&lt;%= root_path %&gt;"); Though this still doesn't feel right. Update 2 I have pieced this together, though please feel free to add cleaner solutions, I would really like to know how to handle this in the most efficient and correct way. def create @document = current_user.documents.new(document_params) respond_to do |format| if @document.save format.html { redirect_to root_path, notice: success_save_msg } format.js { flash[:notice] = 'File Successfully Uploaded' render action: 'redirect.js.erb' } else format.html format.js { render action: 'create.js.erb' } end end
downvote count: 0
favorite count: 0
tagged with: ruby
has title: Redirecting and rendering a notice with format.js
score: 2

http://stackoverflow.com/q/28311414
has title: Replace all #333 colors with javascript
score: -1
type: Question
has comment: http://stackoverflow.com/comment/44973807
answer count: 2
has answer: http://stackoverflow.com/a/28311791
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44973546
has body: My question is how do I replace a certain color in javascript? I have a few SVG fills which I need to change in color but how exactly do I get all #333 colors that exist in my document?
has comment: http://stackoverflow.com/comment/44973565
has answer: http://stackoverflow.com/a/28311466
favorite count: 0
type: UnansweredQuestion
downvote count: 2
upvote count: 1

http://stackoverflow.com/comment/45075773
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28367060
has text: @PrateekDhuper just re-read the [docs](http://pekim.github.io/tedious/api-request.html), you need to have the `config.options.rowCollectionOnRequestCompletion` option set to `true` for the `rows` parameter to become available. I have added a note to my answer.

http://stackoverflow.com/q/28434789
type: Question
tagged with: reactjs
answer count: 2
has comment: http://stackoverflow.com/comment/45199869
has answer: http://stackoverflow.com/a/28436494
downvote count: 0
tagged with: javascript
has body: I'm messing around with react and trying to parse and render a json object. Right now, I'm just setting it with a hard-coded object for testing and not getting it from an ajax call. The data object is one that I'm creating on the java side of a portlet. I know that the json is valid, because I can use JSON.parse(json) to parse and traverse the string, but I keep getting that map() is not a function.
has title: React.js this.props.data.map() is not a function
has answer: http://stackoverflow.com/a/28434996
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
type: UnansweredQuestion
score: 3
upvote count: 3

http://stackoverflow.com/comment/45141817
comment on: http://stackoverflow.com/a/28395051
score: 1
type: AnswerComment
type: Comment
has text: I was such a fool. It was such a small thing, which i forgot :)

http://stackoverflow.com/comment/71399778
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/42104767
has text: To whomever provided the downvote from me answering my own question: do you have a solution? How is the answer wrong? I'm still looking for an answer other than "it's just broken" if you got one.

http://stackoverflow.com/a/28363343
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has body: I'm not sure if this will work... $.get( "page.html", function( data ) { alert($( 'div', data ).attr('class')); }, "html" ); Edit: You can also check xml instead of html datatype.
accepted answer of: http://stackoverflow.com/q/28363220
answers question: http://stackoverflow.com/q/28363220
type: Answer
score: 1

http://stackoverflow.com/a/28288917
score: 1
accepted answer of: http://stackoverflow.com/q/28288511
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45256143
type: Answer
answers question: http://stackoverflow.com/q/28288511
upvote count: 1
has body: EDITED I just had to add another filter to the range and it's working, but the performance is better if you put the range as a must param query = { "query": { "bool": { "must": [ { "range" : { "timestamp" : { "gt" : timeRange }}}, { "term": {"deviceId":device} }, { "match": {"eventType":"Connected"} } ], "must_not":[{ "query_string": { "query": "Pong", "fields": ["data.message"] } }, ] }, }, "filter": { "exists" : { "field":"data.location" } }, "sort": [{ "timestamp": { "order": "desc" }}] }

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

http://stackoverflow.com/comment/44949650
has text: debug inside the ajax success function
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28292145
type: Comment

http://stackoverflow.com/a/28351631
type: Answer
has body: You'll see plenty of examples like that in books &amp; the internet. The point is that the $scope.day is set to something and I'm sure how it reflects it within your view. You can have external plain Javascript logic and use it within angularJS, it obviously won't break anything, but typically it's good practice to have ALL scope manipulation / business logic done outside of the controller in a service/factory/provider. Why go against angularJS and use external things? You want to stick within angularJS's flow. Let's say it was doing something much more complicated, it would of probably looked more like this: myApp.factory("tomorrowService", function() { // factory's can be written in many different patterns // this is just for examples sake return { getDays : function () { /* return stuff */ } } }); myApp.controller("tomorrowCtrl", function($scope, tomorrowService) { $scope.day = tomorrowService.getDays(); }); With a method within tomorrowService doing all the business logic and returning some sort of result. I found this article (http://toddmotto.com/rethinking-angular-js-controllers/) very imformative to help get a better idea of how to make your controllers and the separation that is beneficial within an angularJS project.
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28351458
score: 3
has comment: http://stackoverflow.com/comment/45047350
answers question: http://stackoverflow.com/q/28351458
has comment: http://stackoverflow.com/comment/45047372
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28291633
tagged with: array-difference
has comment: http://stackoverflow.com/comment/44936632
has comment: http://stackoverflow.com/comment/44939014
type: Question
has body: I have a dynamically created table having 3 columns. I need the difference of Col 2 and Col 1 to be populated in Col 3. I have no clue as to how to proceed with dynamically created tables. I'm reading the table values in my save function. Can you please suggest as to how to include the code for the difference? JS: function save() { var eval_tbl = document.getElementById('bagger_reading_list'); var eval_row_array = []; for (i=0; i&lt;eval_tbl.rows.length; i++) { var tableRow = { Start_Reading : eval_tbl.rows[i].cells[1].firstElementChild.value, End_Reading : eval_tbl.rows[i].cells[2].firstElementChild.value, Total_Reading : eval_tbl.rows[i].cells[3].firstElementChild.value, \\ I need the difference of End-Reading - Start_Reading to be displayed on Total_Reading of eah row created. } eval_row_array[eval_row_array.length] = tableRow; } }
tagged with: difference
tagged with: javascript
tagged with: jquery
has title: how to get difference of 2 columns in dynamically created rows in javascript
has answer: http://stackoverflow.com/a/28291822
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/44937568
has answer: http://stackoverflow.com/a/28291719
has answer: http://stackoverflow.com/a/28291657
type: UnansweredQuestion

http://stackoverflow.com/q/28291911
has title: Unable to download three.js file using bower
upvote count: 1
has answer: http://stackoverflow.com/a/28293117
tagged with: bower
tagged with: git
type: Question
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28384135
tagged with: bower-install
has body: I.m getting an error when I try to download three.js file by specifying the version in bower.json file. "dependencies": { "three.js":"~0.0.69" } Error :No versions found in git://github.com/jiyinyiyong/three.js.git Instead ,I'm downloading the whole repo by specifying the url like this: "dependencies": { "three.js":"https://github.com/mrdoob/three.js.git" } which is taking time and space. How can I download only the file from the git repo.?
downvote count: 0
tagged with: javascript
favorite count: 0
possible better answer: http://stackoverflow.com/a/29409673
has answer: http://stackoverflow.com/a/29409673
accepted answer: http://stackoverflow.com/a/28384135
answer count: 3
tagged with: three.js

http://stackoverflow.com/a/39899059
has body: I ran into this as well, but I had a much simpler front-end stack, and I was only seeing it on one page, even though I was using the component several places through my site. Turns out it can also be a race condition. I had to put my ko.applyBindings inside of document.ready callback, and everything worked.
type: Answer
downvote count: 1
answers question: http://stackoverflow.com/q/28332604
score: -1
upvote count: 0

http://stackoverflow.com/a/28431226
answers question: http://stackoverflow.com/q/28365357
downvote count: 0
score: 1
upvote count: 1
type: Answer
has body: unfortunately jsonObj did not work, I even tried with ganttDS.read() to assert it again. nothing worked. I solved this by using parse parse: function (response) { $.each(response, function (idx, elem) { var state = elem.BriefingState; elem.BriefingState = state/11; }); return response; } data-toolbar="['pdf']" still did not work, I also tried it as a array of string with flower brackets. I solved it by calling the function itself in my model savePdf : function(){ var gantt = $("#gantt").data("kendoGantt"); gantt.saveAsPDF(); },

http://stackoverflow.com/comment/45085117
comment on: http://stackoverflow.com/q/28372340
score: 2
has text: That seems like a messy way to validate emails? Why not create a simple PHP script that checks the DB only, and keep the javascript on the main page from the getgo.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28390039
type: Answer
has body: I'm not sure why &lt;video&gt; doesn't honor event.preventDefault(); The way I go around this is pretty hacky. I just override the click and dblclick events of the parent div to solve my problem since I only want to prevent pause/play/full screen.
accepted answer of: http://stackoverflow.com/q/28389347
answers question: http://stackoverflow.com/q/28389347
score: 0
type: AcceptedAnswer

http://stackoverflow.com/q/28394934
accepted answer: http://stackoverflow.com/a/28395002
tagged with: button
has answer: http://stackoverflow.com/a/28394997
has body: Here are my 2 radios buttons : &lt;input type="radio" name="sex" id="Button1" class="Button"/&gt; &lt;input type="radio" name="sex" id="Button2" class="Button"/&gt; When I call a function that countains : document.getElementById('Button2').checked = false; It unchecks the Button2. But I want to uncheck it by using the class And when the function contains : document.getElementsByClassName('Button').checked = false; It does not uncheck the Button2 Why and what is the solution ? Thank you. :)
favorite count: 0
has answer: http://stackoverflow.com/a/28395023
answer count: 5
has answer: http://stackoverflow.com/a/28394990
has comment: http://stackoverflow.com/comment/45126337
tagged with: checkbox
possible better answer: http://stackoverflow.com/a/28395023
type: AnsweredQuestion
upvote count: 1
downvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28395002
has title: Uncheck a Radio button in Javascript using the class
tagged with: class
has answer: http://stackoverflow.com/a/28395029
score: 0

http://stackoverflow.com/comment/45024339
type: Comment
has text: That what i thought but i had to ask the question thanks
comment on: http://stackoverflow.com/a/28333633
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45233314
type: Comment
has text: since you seem to be good at this, do you know how to modify your example to display a message if the options checked result in no items being shown? Like to have a message show where the products are usually listed if no matches are found. I really appreciate the help you provided already. Thanks :)
type: AnswerComment
comment on: http://stackoverflow.com/a/28429744
score: 0

http://stackoverflow.com/comment/45014226
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28333697
has text: http://nodejs.org/api/child_process.html

query-string
tags question: http://stackoverflow.com/q/28316949
tags question: http://stackoverflow.com/q/28333694
tag name: query-string
type: Tag

http://stackoverflow.com/q/28337425
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
has body: how to pass values in jsp from one page to another In html page which shows a box or table containing data like COLLEGE NAME, PLACE, STREAM(ARTS OR SCIENCE). data to the box or table is retrieved from database (mysql). HOME PAGE HTML CODE and JSP CODE: <% while (special.next()) {%> <%=special.getString("collegename")%> <%= special.getString("stream")%> <%= special.getString("address")%> <%= special.getString("verified")%> <%= special.getString("description")%> More Details <% }%> number boxes in jsp page is depends on data in data base. data will be like this box1: iit bombay, bombay, engineering, more details, box2: iit delhi, delhi, engineering, more details, etc. when i click on MORE DETAILS of IIT BOMBAY, i should get only IIT BOMBAY DETAILS. what should i do? i know that i need to pass value from homepage.jsp to moredetails.jsp. how to pass them?? i cannot put hidden value in between li or ul. help me
has title: how to pass values in jsp from one page to another
has answer: http://stackoverflow.com/a/28337675
score: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45020633
has comment: http://stackoverflow.com/comment/45020773
tagged with: mysql
type: Question
answer count: 1
tagged with: jsp

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

http://stackoverflow.com/q/28316334
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28316583
score: 0
has answer: http://stackoverflow.com/a/28316392
answer count: 3
has comment: http://stackoverflow.com/comment/44981730
has title: Select empty value in dropdown list with jQuery if not contains string
has answer: http://stackoverflow.com/a/28316583
has comment: http://stackoverflow.com/comment/44982439
has answer: http://stackoverflow.com/a/28316790
has body: I'am trying to select the empty (first) value of a dropdown select option if it does not contains the value from an another dropdown select list: $('#FirstDropdown').change(function() { if ( $('#SecondDropdown option').filter(':contains(' + this.value + ')') ){ $('#SecondDropdown option').filter(':contains(' + this.value + ')').prop('selected',true); }else{ $("#SecondDropdown option[value='']").prop('selected',true); } }); This code work well if #SecondDropdown option contains this.value but the else statement doesn't reset the dropdown list if not. Any suggestion please ? EDIT : The dropdown lists look like this : &lt;select id="FirstDropdown"&gt; &lt;option value="" selected="selected"&gt;&amp;nbsp;&lt;/option&gt; &lt;option value="VAL1"&gt;First Value&lt;/option&gt; &lt;option value="VAL2"&gt;Second Value&lt;/option&gt; &lt;option value="VAL3"&gt;Third Value&lt;/option&gt; &lt;option value="VAL4"&gt;Fourth Value&lt;/option&gt; &lt;/select&gt; &lt;select id="SecondDropdown"&gt; &lt;option value="-1"&gt;&amp;nbsp;&lt;/option&gt; &lt;option value="12"&gt;VAL1 SELECT OPTION&lt;/option&gt; &lt;option value="15"&gt;VAL2 SELECT OPTION&lt;/option&gt; &lt;option value="10"&gt;VAL3 SELECT OPTION&lt;/option&gt; &lt;/select&gt; EDIT : Added a JsFiddle.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44982398
has comment: http://stackoverflow.com/comment/44982509
has comment: http://stackoverflow.com/comment/44981784
type: Question
accepted answer: http://stackoverflow.com/a/28316392
has comment: http://stackoverflow.com/comment/44981959
tagged with: javascript

http://stackoverflow.com/a/28389635
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28388996
has body: I'd think you'd do it however you'd add items to a normal Bootstrap Dropdown which I believe is just appending &lt;a&gt;'s. As long as your &lt;a&gt;'s click event gets fired and thus this.itemClicked runs--I don't think it should matter. See this line in selectlist.js. And you might not want to use the auto resize feature either. It's a little buggy right now.

http://stackoverflow.com/q/28384347
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45106526
has answer: http://stackoverflow.com/a/28384362
has comment: http://stackoverflow.com/comment/45106571
score: -1
has body: I am a beginner. Just started to learn JavaScript. Would like to find out how to simply increase the value of the number in array? For example, I have the array with numbers inside: var myArray = [2,3,5,10]; I would like to add 2 to item[1] so the myArray could look as below: myArray = [2,5,5,10];
type: Question
answer count: 2
downvote count: 2
upvote count: 1
has title: How to increase the value of the number in array?
has comment: http://stackoverflow.com/comment/45106544
tagged with: arrays
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45106852
has comment: http://stackoverflow.com/comment/45106644
has answer: http://stackoverflow.com/a/28384377

http://stackoverflow.com/comment/45187079
type: Comment
comment on: http://stackoverflow.com/a/28427282
type: AnswerComment
score: 0
has text: You should edit your answer, I'll gladly upvote and accept it

http://stackoverflow.com/comment/45036984
type: Comment
comment on: http://stackoverflow.com/a/28330481
has text: Hello Knut, thank you very much for your answer. That is exactly the solution I mentioned in my previous comment. Appreciate your help!
score: 0
type: AnswerComment

image
tags question: http://stackoverflow.com/q/28394291
tags question: http://stackoverflow.com/q/28332047
tags question: http://stackoverflow.com/q/28405879
tags question: http://stackoverflow.com/q/28321107
tags question: http://stackoverflow.com/q/28298124
tags question: http://stackoverflow.com/q/28309282
tags question: http://stackoverflow.com/q/28320929
tags question: http://stackoverflow.com/q/28363492
tags question: http://stackoverflow.com/q/28311398
tags question: http://stackoverflow.com/q/28429088
tags question: http://stackoverflow.com/q/28385375
tags question: http://stackoverflow.com/q/28284548
tags question: http://stackoverflow.com/q/28381199
tags question: http://stackoverflow.com/q/28425575
tags question: http://stackoverflow.com/q/28310943
tags question: http://stackoverflow.com/q/28395469
tags question: http://stackoverflow.com/q/28283632
tags question: http://stackoverflow.com/q/28339923
tags question: http://stackoverflow.com/q/28395472
tags question: http://stackoverflow.com/q/28398273
tags question: http://stackoverflow.com/q/28407887
tags question: http://stackoverflow.com/q/28414185
tag name: image
tags question: http://stackoverflow.com/q/28289132
tags question: http://stackoverflow.com/q/28317248
tags question: http://stackoverflow.com/q/28391612
tags question: http://stackoverflow.com/q/28405377
tags question: http://stackoverflow.com/q/28363460
type: Tag
tags question: http://stackoverflow.com/q/28388801
tags question: http://stackoverflow.com/q/28296348
tags question: http://stackoverflow.com/q/28399701
tags question: http://stackoverflow.com/q/28378375
tags question: http://stackoverflow.com/q/28317330
tags question: http://stackoverflow.com/q/28410727
tags question: http://stackoverflow.com/q/28361184

http://stackoverflow.com/a/28315666
has body: Your test is flawed. When both arguments to Object.is() are numbers, it returns a comparison of the values of the two arguments. This is not a test for whether both variables are represented by the same physical memory. You can read here on MDN for how the comparison works when both arguments are numbers. You can also look at the polyfill on that same page. If you want to see the actual ECMAScript specification for Object.is(), you can read that here. In that specification, Object.is() uses SameValue(x,y) which is documented as this sequence of steps: 19.1.2.10 Object.is ( value1, value2 ) When the is function is called with arguments value1 and value2 the following steps are taken: Return SameValue(value1, value2). And here's the SameValue() section: 7.2.9 SameValue(x, y) The internal comparison abstract operation SameValue(x, y), where x and y are ECMAScript language values, produces true or false. Such a comparison is performed as follows: ReturnIfAbrupt(x). ReturnIfAbrupt(y). If Type(x) is different from Type(y), return false. If Type(x) is Undefined, return true. If Type(x) is Null, return true. If Type(x) is Number, then a. If x is NaN and y is NaN, return true. b. If x is +0 and y is -0, return false. c. If x is -0 and y is +0, return false. d. If x is the same Number value as y, return true. e. Return false. If Type(x) is String, then a. If x and y are exactly the same sequence of code units (same length and same code units at corresponding indices) return true; otherwise, return false. If Type(x) is Boolean, then a. If x and y are both true or both false, return true; otherwise, return false. If Type(x) is Symbol, then a. If x and y are both the same Symbol value, return true; otherwise, return false. Return true if x and y are the same Object value. Otherwise, return false. You can see that step 6 is the step that comes into play when both x and y are numbers. Further, you can see that for strings, it is comparing to see that x and y contain the same chara…
type: Answer
has comment: http://stackoverflow.com/comment/44980680
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44980625
has comment: http://stackoverflow.com/comment/44980917
answers question: http://stackoverflow.com/q/28315431
downvote count: 0

http://stackoverflow.com/comment/45011520
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28330481
has text: It does work only if rendered condition is on button's parent/ancestor element. I'd go for a <xp:panel ...> as it doesn't hurt. I couldn't figure out yet why it doesn't work if rendered condition is on button itself.

http://stackoverflow.com/q/28415344
has comment: http://stackoverflow.com/comment/45367360
answer count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45179695
type: Question
has body: im trying to display some text on a svg map. the text should display onmousedown. here is how i create the svg map <g id="map_group"> Layer 1 <rect stroke="#000000" id="bancroft_road" height="449.99998" width="34" y="-0.99998" x="164" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="0" fill="#7f7f7f"/> et ecetera for the other elements of the svg map then i do var ns = "http://www.w3.org/2000/svg"; //import from DOM var svg = document.getElementById("svg_canvas"); var mileEnd = document.getElementById("mile_end"); and add event listeners mileEnd.addEventListener('mousedown', clickedMileEnd, false); mileEnd.addEventListener('mouseup', unclickedMileEnd,false); bancroft.addEventListener('mousedown', clickedBancroft, false); bancroft.addEventListener('mouseup', unclickedBancroft,false); this is where i have problems function showText(target) { var text = document.createElementNS(ns, "text"); var x = (target.getAttribute('x')).toString; text.setAttribute('x',x) var y = (target.getAttribute('y')).toString; text.setAttribute('y',y); var textNode; console.log("created textnode"); if (target.id=="svg_14"||"svg_16") { textNode = document.createTextNode("People Palace"); }else if (target.id=="svg_11"||"svg_12"||"svg_13") { textNode = document.createTextNode("Engineering Building"); } switch (target.id){ case "bancroft_road": textNode = document.createTextNode("Bancroft Road"); break; case "mile_end": textNode = document.createTextNode("Mile End Road"); console.log(textNode); break; case "godward_square" : textNode = document.createTextNode("Godward Square"); break; case "computer_science": textNode = document.createTextNode("CompSci Building"); break; case "itl": textNode = document.createTextNode("ITL Building"); break; default: console.log("not fond"); } text.appendChild(textNode); svg.appendChild(text); } debugging and outputting to console i see that the switch statement works fine, the problems is then in the last two lines of the functio…
tagged with: append
tagged with: text
has comment: http://stackoverflow.com/comment/45354451
tagged with: http://stackoverflow.com/tag/svg
has title: display text over svg element onmousedown using javascript
score: 0
has comment: http://stackoverflow.com/comment/45367634
has comment: http://stackoverflow.com/comment/45367777
has comment: http://stackoverflow.com/comment/45179677
tagged with: appendchild
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45365159

http://stackoverflow.com/q/28301481
upvote count: 1
has title: Jasmine Test for Angular Directive
has comment: http://stackoverflow.com/comment/44992074
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: jasmine
tagged with: http://stackoverflow.com/tag/html
score: 1
favorite count: 0
answer count: 0
tagged with: angularjs
type: UnansweredQuestion
has body: I am trying to test an Angular directive which returns true or false based on a keypress event. I am using that directive in a UI having ng-model inside an input tag. The HTML code is below: &lt;div class="inline-middle-align set-margin "&gt; &lt;input class="form-control" type="text" ng-model="addedRP.Offset" min="0" max="999" maxlength="3" style="width: 65px" placeholder="Offset" rp-Offset-Input-Validation-Directive required/&gt; &lt;/div&gt; The directive code is: angular.module('helperModule') .directive('rpOffsetInputValidationDirective', function (e) { 'use strict'; return { require: 'ngModel', link: function (scope, elem) { elem.on('keypress', function (e) { if (e.which !== 8 &amp;&amp; e.which !== 0 &amp;&amp; (e.which &lt; 48 || e.which &gt; 57)) { return false; } }); } }; }); I have written a test for it but it's not working. it('should return true called on a keypress', function () { $rootScope.happy = 10; var ele = angular.element("&lt;input ng-model='happy' rp-offset-input-validation-directive/&gt;"); element = $compile(ele)($rootScope); $rootScope.$digest(); $rootScope.e = $.Event('keypress'); e.which = 50; $(ele[0]).trigger(e); expect($rootScope.happy).toBe(2); });

http://stackoverflow.com/comment/45114932
has text: Where is this "object array"?
comment on: http://stackoverflow.com/q/28388650
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45092519
comment on: http://stackoverflow.com/q/28376075
type: QuestionComment
type: Comment
has text: Not sure what you want to do here... what is the difference between .text and .data?
score: 0

http://stackoverflow.com/q/28295241
has body: I want to filter data by event date. I have the following options to filter: current day, current month and current year. Below you can see what I have so far: function dateCtrl($scope) { var d = new Date(); var curr_date = d.getDate(); var curr_month = d.getMonth(); var curr_year = d.getFullYear(); $scope.dateToday = Date.parse(curr_month + "/" + curr_date + "/" + curr_year); $scope.dateRange = ""; $scope.dataModels = [ {age:5,name:'John Lennon',eventDate:"1390524400000"}, {age:12,name:'Nick Young',eventDate:"1377500400000"}, {age:10,name:'Mike Johnson',eventDate:"1374044400000"}, {age:15,name:'Lisa Leslie',eventDate:"1335942000000"} ]; $scope.eventDateFilter = function(column) { if(column === 'today') { $scope.dateRange = $scope.dateToday; } else if (column === 'currentWeek') { //need logic } else if (column === 'currnetMonth') { //need logic } else if (column === 'currnetYear') { //need logic }else { $scope.dateRange = ""; } } } and here I have the controller: Date Filter All Today Past Week Past Month Name Age Event Date {{data.name}} {{data.age}} I have the entire code here : The code
has answer: http://stackoverflow.com/a/30810216
favorite count: 0
tagged with: angularjs
has title: How to filter data by date in Angular js
linked to: http://stackoverflow.com/q/8381427
score: 2
upvote count: 2
type: UnansweredQuestion
tagged with: select
has comment: http://stackoverflow.com/comment/44943033
has comment: http://stackoverflow.com/comment/44944142
type: Question
has answer: http://stackoverflow.com/a/28296186
has comment: http://stackoverflow.com/comment/44943384
has comment: http://stackoverflow.com/comment/44944242
answer count: 2
has comment: http://stackoverflow.com/comment/44944191
has comment: http://stackoverflow.com/comment/44943819
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/28329198
has comment: http://stackoverflow.com/comment/45006583
score: 0
has body: You seem to be using different variables. In the HTML, you use note.documents: ng-repeat="document in note.documents ... In the JavaScript, you use $scope.case.task.notes[i].documents. You need to make them reference the same array. Maybe if you set $scope.documents = $scope.case.task.notes[i].documents; in your JavaScript and change the HTML to read ng-repeat="document in documents ..." then Angular with pick up the changes?
has comment: http://stackoverflow.com/comment/45005806
answers question: http://stackoverflow.com/q/28329000
has comment: http://stackoverflow.com/comment/45006682
type: Answer

http://stackoverflow.com/a/28400041
type: AcceptedAnswer
has body: Your ajax function is calling a method that returns a view. Change you success callback to success: function (result) { $('#someElement').html(result); }, This will replace the contents of &lt;div id="someElement"&gt;&lt;/div&gt; with the returned view.
type: Answer
accepted answer of: http://stackoverflow.com/q/28395628
score: 0
answers question: http://stackoverflow.com/q/28395628

http://stackoverflow.com/q/28303855
favorite count: 0
has answer: http://stackoverflow.com/a/28304045
answer count: 5
tagged with: object-construction
tagged with: javascript-objects
has body: I create objects by two different ways and try to reach them and manipulate them. The object that I create by object constructor it work but same thing I try to do by literal notation doesn't work. I don't understand. here is code it will explain itself better than me: var numberOne = new Object(); rand = Math.random(); numberOne[rand] = "random number"; console.log(numberOne); //return 0.6761925128922479: "random number" var numberTwo = {}; //code doesnt work. numberTwo.rando = Math.random(); numberTwo[rando] = "another random number"; console.log(numberTwo); //error
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28304090
has title: in javascript creating object and manipulating properties
upvote count: 1
accepted answer: http://stackoverflow.com/a/28304045
has answer: http://stackoverflow.com/a/28304172
type: Question
has comment: http://stackoverflow.com/comment/44959012
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28303976
has answer: http://stackoverflow.com/a/28304111
downvote count: 0
has answer: http://stackoverflow.com/a/28303976
score: 1

http://stackoverflow.com/comment/45133051
type: QuestionComment
comment on: http://stackoverflow.com/q/28394340
has text: Ok - doing this now. (Will upload as soon as it's done.) Thank you for helping me!
score: 0
type: Comment

internet-explorer-9
tag name: internet-explorer-9
tags question: http://stackoverflow.com/q/28316096
tags question: http://stackoverflow.com/q/28399621
tags question: http://stackoverflow.com/q/28389849
tags question: http://stackoverflow.com/q/28301747
tags question: http://stackoverflow.com/q/28280355
type: Tag
tags question: http://stackoverflow.com/q/28350008
tags question: http://stackoverflow.com/q/28303126

http://stackoverflow.com/comment/45068022
has text: @northkildonan that applies if the script is in the `head`. At the end of the body all elements are available in the DOM, so it's not needed.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28362956
type: AnswerComment

http://stackoverflow.com/comment/45174341
score: 0
comment on: http://stackoverflow.com/q/28414356
type: QuestionComment
type: Comment
has text: @Claies it could actually be null. It is a field returned by a REST API and assigned to a $scope variable.

http://stackoverflow.com/comment/45031836
type: QuestionComment
score: 0
has text: Should have stated that i need to use vanilla js only, sorry.
comment on: http://stackoverflow.com/q/28341816
type: Comment

http://stackoverflow.com/comment/44980193
type: Comment
score: 0
type: AnswerComment
has text: Hrm, good question. I think it'd be somewhat tricky, but you'd want to set up a service account that has access to the data, then get a refresh token for it and use that token and use UrlFetchApp.fetch stuff to retrieve the CSV file and load it. Would probably be rather more painful than using IMPORTDATA.
comment on: http://stackoverflow.com/a/28307172

http://stackoverflow.com/comment/45016695
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28335160
has text: I try not to declare global variables. I did figure it out, though, and answered my own question. I just had the self-executing part in the wrong place.
score: 0

http://stackoverflow.com/q/28430849
has comment: http://stackoverflow.com/comment/45192405
upvote count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45192500
downvote count: 0
has answer: http://stackoverflow.com/a/28431069
type: Question
possible better answer: http://stackoverflow.com/a/28431069
score: 4
answer count: 2
has comment: http://stackoverflow.com/comment/45192318
tagged with: arrays
has comment: http://stackoverflow.com/comment/45192387
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28431102
accepted answer: http://stackoverflow.com/a/28431102
has body: I have an array, for example: var arr = [2,4,7,11,25,608,65,109,99,100,504,606,607]; I need to make it so each value that is within range of its multiple of ten below and and multiple of ten above it is grouped together. For example, 2,4,7 are between 0 and 10 so they must be together. 11 would be alone in its group, like 25,65 etc. 606,607,608 would be together. The array above should become: [ [2,4,7],[11],[25],[65],[99],[101],[504],[100,109],[606,607,608] ] I've been thinking about it for a couple of hours and I wasn't able to come up with anything yet. It's really bad not much worth mentioning but so far I'm playing with Math.round (http://jsfiddle.net/40napnyx/2/) Edit: I'd like to add another issue (although I will not pick the correct answer based on this if the actual answers don't include the solution of this new problem). The array may contain values with letters. Those values should all be in the same group, in alphabetical order (only the first letter is taken to determine the order). This group should be the last value in the resulting array. So for instance var arr = [2, 4, 11,'a3', 25, 7, 'j', 'bzy4]; Would be [[2,4,7],[11],[25],['a3','bzy4', 'j']]
has title: Group array values that are in the same range of multiples of 10

http://stackoverflow.com/a/28284539
accepted answer of: http://stackoverflow.com/q/28284271
type: Answer
answers question: http://stackoverflow.com/q/28284271
downvote count: 0
has comment: http://stackoverflow.com/comment/44925235
has comment: http://stackoverflow.com/comment/44926222
has comment: http://stackoverflow.com/comment/44926332
score: 1
has comment: http://stackoverflow.com/comment/44923675
upvote count: 1
has comment: http://stackoverflow.com/comment/44926726
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44923267
has comment: http://stackoverflow.com/comment/44925671
has comment: http://stackoverflow.com/comment/44924165
has comment: http://stackoverflow.com/comment/44923707
has body: Your Razor implementation looks good. That should properly postback a List&lt;AllocationInformation&gt; object if it's all existing objects. The problem is with your JavaScript implementation. First, your current JavaScript code doesn't even factor in an index. All the field names are in the form of Allocation.Foo. Instead, they need to be in the form of Allocations[N].Foo (notice the pluralized form, as well). Getting the current index is trivial, actually. In your addAllocation JavaScript method, just do: var currentIndex = $('#allocationsDiv .row').length - 1; Then, use the currentIndex variable in place of the N in your field names. For what it's worth, you may want to consider integrating something like Knockout JS into your project. It makes handling things like rendering collections trivial. You can create a generic "row" template and then bind that template to be rendered for each instance of some observable array. Then, to add or remove rows, you merely need to add or remove items from the array and Knockout updates the HTML accordingly. EDIT It bears mentioning that the method I gave you to find the current index, only works if items aren't removed out of band. For example, if you start with three items (index 0, 1, and 2), remove the second (index 1), and then add a new one, you'll actually end up with indexes of 0, 2, and 2 again. Obviously that's not going to work. You could attempt to reindex all existing items after removing one, which would entail selecting each row, and updating the name parameters with a new index based on a for loop. However, that's admittedly very clunky. This is another reason why it would behoove you to use something like Knockout JS. All this logic is taken care for you out of the box. UPDATE: Knockout Crash Course This is how I typically set up the code for my views with Knockout code: External JS var Namespace = Namespace || {}; Namespace.Application = (function () { var _init = function (data) { var viewModel = Namespace.Vi…

http://stackoverflow.com/comment/45145811
has text: When I `echo $json_array` I get an HTML document.
comment on: http://stackoverflow.com/q/28405677
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28358424
tagged with: node.js
has answer: http://stackoverflow.com/a/78953819
has title: Filter and save back HAR Files
score: 7
upvote count: 8
type: Question
has answer: http://stackoverflow.com/a/58363102
tagged with: javascript
answer count: 2
downvote count: 1
tagged with: har
linked to: http://stackoverflow.com/q/58325758
favorite count: 0
has body: Background I am working on a tool that would let users upload HAR files and keep replaying them over and over and gather analytics, like average speed over time, service availability etc. I already have core code in place here, that takes Har files, and spawns up processes that replay them and collect analytics in a flat file database. https://github.com/shaunakv1/node-chrome-har-replay Next, I am working on building a web front-end that will let users upload a HAR file, visualize them, very similar to some of these tools here. http://ericduran.github.io/chromeHAR/ http://rafacesar.github.io/simplehar/ http://www.softwareishard.com/har/viewer/ Now, after visualizing them, feature that I am looking for is add something like a angular filter, that will let users enter regex strings, and filter the URLs they are interested in , and then save back the HAR file to the server. Tool will then keep replaying this saved HAR and generate performance analytics, dashboards and all the good stuff. Finally the question: Know any tools/libraries out there that will let me filter those HAR files in the browser and save back? None of the examples i posted , do the filtering and saving part. I can definitely start writing one myself, but looking for suggestions to see if one already exists. I am working in nodejs, so node libraries would be ideal, but not necessary. Even applications that let me filter are fine. Chrome has an excellent filter, but unfortunately does not save back filtered HAR.The most ideal would be an opensource tool, just like ones above that does filtering on web and saves the HAR. Thanks!
type: UnansweredQuestion

http://stackoverflow.com/q/28346203
tagged with: onblur
score: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45037925
has body: I have a java script function that is used in many jsp files. In general, it is used to validate dates. My problem here is that, although its used on many sites, some of them providing different information on how to notify on a failure. Telephone numbers in general. The date-field itself is embedded in the serviceHeader.jsp: &lt;h:inputText styleClass="inputText" tabindex="5" id="eventAt" value="#{serviceRequest.eventAt}" onblur='leaveFocusDate(this,"&lt;%=telnr %&gt;");' style="width: 80px;" required="true" &gt; &lt;f:convertDateTime pattern="dd.MM.yyyy" /&gt; &lt;/h:inputText&gt; &lt;h:message for="eventAt" style="color:red; font-family: sans-serif;font-size:10pt; font-weight:bold; width: 330px;"/&gt; The serviceHeader.jsp is included in the files that will provide the different informations, for example here in the Canteen.jsp: &lt;%@include file="serviceHeader.jsp"%&gt; The Canteen.jsp also uses the javascript file: &lt;script src='/PersonalWebFormsFrontend/dataSupport.js' type='text/javascript'&gt;&lt;/script&gt; The issue here is that for example the canteen has a different support number then the conference rooms. I have defined the number for the Canteen.jsp as followed: &lt;%! String telnr = "-999"; %&gt; The idea is to send a notifiation to the user if the date is invalid. The telephone number has to be part of this notification. Here starts my problem. How can I pass the telnr to the function defined in the dataSupport.js?
type: Question
has comment: http://stackoverflow.com/comment/45037331
has title: Passing parameter from jsp to javascript function at onblur event
answer count: 1
tagged with: jsp
tagged with: javascript
has answer: http://stackoverflow.com/a/28352199

http://stackoverflow.com/comment/45000636
type: Comment
type: QuestionComment
has text: Trying to figure out how to close it...
comment on: http://stackoverflow.com/q/28282880
score: 0

http://stackoverflow.com/q/28359854
has title: Latitude and longitude exist on a circle on google map
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/14598426
tagged with: google-maps
upvote count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45062900
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
duplicate of: http://stackoverflow.com/q/14598426
answer count: 0
downvote count: 0
score: 1
has body: I have a latitude and longitude for a proper location and by using them I created a circle on google map and now I want to check a point(latitude, longitude) exist inside the circle or not. Simply I need true of false only. if any one having any idear regarding this please share your idea. Thanks a ton in advance google map api Index.html Check For cordinates

http://stackoverflow.com/q/28422141
favorite count: 0
upvote count: 3
tagged with: scroll
has answer: http://stackoverflow.com/a/28422268
answer count: 1
has title: Does 'lazy scroll' exist?
has comment: http://stackoverflow.com/comment/45177584
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28422268
downvote count: 0
tagged with: javascript
has body: Seems like it's only my word) Is there a way to execute a function after some time ? I'm trying to write an advanced scrollspy script for my site and what i was thinking about is to execute onScroll action not immediately but after some time. If user scrolls fast and with many stops, i want scrollspy to refresh navigation links only at stop, and if user scrolls slowly (and maybe without stops) i want scrollspy to refresh nav links every 0.6s for example. Unfortunately, i dunno where to begin. I'm trying to upgrade this code: var lastId, topMenu = jQuery(".a1-nav"), topMenuHeight = document.querySelector('header .top-header').offsetHeight; menuItems = topMenu.find("a"), scrollItems = menuItems.map(function(){ var item = jQuery(jQuery(this).attr("href")); if (item.length) { return item; } }); menuItems.click(function(e){ var href = jQuery(this).attr("href"), offsetTop = href === "#" ? 0 : jQuery(href).offset().top-topMenuHeight+1; jQuery('html, body').stop().animate({ scrollTop: offsetTop }, 300); e.preventDefault(); }); jQuery(window).scroll(function(){ var fromTop = jQuery(this).scrollTop()+topMenuHeight; var cur = scrollItems.map(function(){ if (jQuery(this).offset().top &lt; fromTop) return this; }); cur = cur[cur.length-1]; var id = cur &amp;&amp; cur.length ? cur[0].id : ""; if (lastId !== id) { lastId = id; // Set/remove active class console.log(id); menuItems .removeClass("active") .filter("[href=#"+id+"]").addClass("active"); } });
type: Question
score: 3

http://stackoverflow.com/comment/45131678
type: Comment
type: QuestionComment
has text: script src=app.js IS loaded after script src=angularjs.
comment on: http://stackoverflow.com/q/28397612
score: 0

http://stackoverflow.com/a/28390638
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/28390384
has comment: http://stackoverflow.com/comment/45119800
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28390384
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45119878
has body: I'm assuming here that you have 3 arrays: - sliders - sliderPaginations - arguments Then, you can do it that way: _.each(sliders, function(slider, index) { var argumentsVariable = arguments[index]; slider.setAttribute('id', argumentsVariable); sliderPaginations[index].setAttribute('id', argumentsVariable+'Pagination'); // Initialise swiper var slider = new Slider('#'+argumentsVariable, { pagination: '#'+argumentsVariable+'Pagination', loop:true, grabCursor: true, paginationClickable: true }) } Note that you can use EcmaScript5 forEach method that is defined for each array: sliders.forEach(function(slider, index) { var argumentsVariable = arguments[index]; slider.setAttribute('id', argumentsVariable); sliderPagination.setAttribute('id', argumentsVariable+'Pagination'); // Initialise swiper var slider = new Slider('#'+argumentsVariable, { pagination: '#'+argumentsVariable+'Pagination', loop:true, grabCursor: true, paginationClickable: true }) }
has comment: http://stackoverflow.com/comment/45118678

http://stackoverflow.com/q/28401207
has title: Multiple choice Javascript - Looking for a smart way to make it work
possible better answer: http://stackoverflow.com/a/28401863
tagged with: multiple-choice
accepted answer: http://stackoverflow.com/a/28401507
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45138073
type: AnsweredQuestion
has body: I am trying to make a multiplechoice game with all the text inside variables : For exemple the HTML code is : Choice1 Choice2 Continue The Javascript code is : var Choix = [ "TEST1", "TEST2", "TEST3", "TEST4", "TEST5", ]; document.getElementById("story").innerHTML = Choix[0]; function myFunction() { if (document.getElementById('Button1').checked) { document.getElementById("story").innerHTML = Choix[1]; document.getElementById('choice1').innerHTML = "Choice3"; document.getElementById('choice2').innerHTML = "Choice4"; } else if(document.getElementById('Button2').checked) { document.getElementById("story").innerHTML = Choix[2]; } else if(document.getElementById('Button3').checked) { document.getElementById("story").innerHTML = Choix[3]; } } The main issue actually is that my radio buttons are not changing when I display a different Var... it always lead me to the same part of the function. I made a lot of test but the few Ideas I found sound really bad to me (it includes tons of coding) and I am sure there is a smart way to keep it simple. But I can't find one. :/ I would like to keep the button which call a function. Maybe a switch will be better than an if / else if ? I am a beginner so I hope my question was clear enough :/ Thank you
has comment: http://stackoverflow.com/comment/45138087
tagged with: switch-statement
type: Question
has answer: http://stackoverflow.com/a/28401863
tagged with: if-statement
has answer: http://stackoverflow.com/a/28401507
tagged with: function
tagged with: javascript

http://stackoverflow.com/comment/44990288
score: 1
comment on: http://stackoverflow.com/a/28313068
has text: Thank you SO MUCH for the detailed explanation Rob. I cant tell you how much i appreciate your time and effort. your solution works well!! :)
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28395476
downvote count: 0
tagged with: javascript
tagged with: event-handling
tagged with: http://stackoverflow.com/tag/html
has title: ActiveX object custom event does not show results
favorite count: 0
answer count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: c#
score: 1
has comment: http://stackoverflow.com/comment/72018237
has body: tl/dr The managed C# COM visible object that I created has an event. In the "OnCardRead" method (which fires the actual event) I check to see if the event is subscribed to and it is. The event callback code in javascript appears to never be called. The story The project is simple. Create a webpage that "opens" a rfid device and returns the serial number of the card. That portion of has its own set of unit tests and works just fine. To help my self debug if the Serial Ports address is set to 0 then it uses my MockRfidSDK. But for the sake of being thorough here is the code surrounding that (minus the actual RFID code). IRfidDevice [Guid("E86A9038-368D-4e8f-B389-FDEF38935B2F"), InterfaceType(ComInterfaceType.InterfaceIsDual), ComVisible(true)] public interface IRfidDevice { [DispId(1)] int Open(); [DispId(2)] int Close(); [DispId(3)] void SetComPort(int comport); [DispId(4)] void FlashLed(int led); } IRfidEvent [ComVisible(true), GuidAttribute("0422D916-C11A-474e-947D-45A107038D12"), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)] public interface IRfidEvent { [DispIdAttribute(0x60020000)] void CardUidReceived(byte sak, ushort atq, string uid); } RfidSdk/EmptyRfidSdk internal interface RfidSdk { void Open(); int GetCard(); byte[] SelectCard(); int Close(); void FlashLed(int led); } class EmptyRfidSdk : RfidSdk { public void Open() { } public int GetCard() { System.Threading.Thread.Sleep(10); return 0x0344; } public byte[] SelectCard() { System.Threading.Thread.Sleep(2000); return new byte[] { 0x20, 0x44, 0x03, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37 }; } public int Close() { return 0; } public void FlashLed(int led) { } } RfidDevice [Guid("873355E1-2D0D-476f-9BEF-C7E645024C32"), ProgId("MasterRDActiveX.RfidDevice"), ClassInterface(ClassInterfaceType.None), ComDefaultInterface(typeof(IRfidDevice)), ComVisible(true), ComSourceInterfaces(typeof(IRfidEvent))] public class RfidDevice : InternetSafeObject, IRfidDevice { private RfidSdk sdk; private bool _sea…
has comment: http://stackoverflow.com/comment/72023616
type: Question
tagged with: com

http://stackoverflow.com/comment/62051985
type: Comment
has text: here is 8 no-flux strats for communication: http://andrewhfarmer.com/component-communication/ one of which you can use is something called an Observer Pattern (PubSubJS), which is what I use.
comment on: http://stackoverflow.com/a/28293661
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44918664
comment on: http://stackoverflow.com/q/28281964
has text: No i dont use jquery on my project
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28424575
tagged with: javascript
has body: Same tic tac toe game from earlier for my school, I forgot to figure in if the game is a draw... not sure how to to tell players it is a tie. Need help coding how to tell player if game is a tie. here is my code: Tic-Tac-Toe! message will be here Start New Game Created By Claire Fuesting
answer count: 2
downvote count: 3
has answer: http://stackoverflow.com/a/38010736
favorite count: 0
possible better answer: http://stackoverflow.com/a/38010736
score: -3
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
upvote count: 0
has title: Tie for tic tac toe?
tagged with: tic-tac-toe
type: Question
has comment: http://stackoverflow.com/comment/45181743
has answer: http://stackoverflow.com/a/28424867
accepted answer: http://stackoverflow.com/a/28424867

http://stackoverflow.com/comment/45174511
type: Comment
comment on: http://stackoverflow.com/a/28415118
has text: Use `reduce` instead of `forEach` for such a thing
type: AnswerComment
score: 0

http://stackoverflow.com/a/28351874
has comment: http://stackoverflow.com/comment/45053557
answers question: http://stackoverflow.com/q/28351606
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45051452
has comment: http://stackoverflow.com/comment/45048598
has comment: http://stackoverflow.com/comment/45053373
has comment: http://stackoverflow.com/comment/45047825
has body: Try to add more memory for API or more time excecution, also you can try return data in more small parts. Defining the number of parts to send.

http://stackoverflow.com/q/28289905
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28290001
tagged with: express
upvote count: 2
answer count: 3
has title: How does Express's res.end() work?
has body: The docs don't really say much. Ends the response process. Inherited from Node's http.ServerResponse. Use to quickly end the response without any data. If you need to respond with data, instead use methods such as res.send() and res.json(). res.end(); res.status(404).end(); So is anything sent to the client? I sense that the status line and headers are sent, but no body is sent. Why else would they give the example of res.status(404).end(). If you provide an argument to res.end(), will it send the argument you provided along in the response body like Node's response.end()?
favorite count: 0
possible better answer: http://stackoverflow.com/a/28310456
tagged with: node.js
has answer: http://stackoverflow.com/a/28310456
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/51314735
downvote count: 0
accepted answer: http://stackoverflow.com/a/28290001

http://stackoverflow.com/comment/45115603
type: QuestionComment
comment on: http://stackoverflow.com/q/28386910
score: 0
type: Comment
has text: Open Up Your Console, click on the network tab, then submit the form, you should see the request happen. What is the status code of the response?

http://stackoverflow.com/comment/44993779
comment on: http://stackoverflow.com/a/28322009
type: AnswerComment
score: 0
type: Comment
has text: Do you men write alert(parsedData.status) just before document.body.appendChild(div);? that wont work. The status is coming from c++ code in a Spark Core hooked up to a sensor

http://stackoverflow.com/comment/45154844
type: AnswerComment
has text: My bad, if both dates are the same, then (hire_from - hire_to) will be 0, and the whole expression would be 0. You probably want hire_to to always be at least one millisecond after hire_from so that the ceil() function will work. So var diffDays = Math.ceil(Math.abs((hire_to + 1 - hire_from)/(oneDay))); - Note the to and from should probably be other way around :)
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28410143

http://stackoverflow.com/comment/45415969
comment on: http://stackoverflow.com/a/28355096
has text: This is an amazing answer, I was hoping that you could explain a little more about your thought process, what the code is doing. Likewise, I was wondering if "checkboxes" are the only way to do this as I currently have divs/rectangles that are clicked?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28420331
has body: If the element does not feature the data-foo attribute, a call to dataset.foo will return undefined, rather than null (or an empty string in the case of an empty attribute). You should check the actual value, as follows: var fooVal = document.getElementById('div1').dataset.foo; // data-foo is not present at all: if( fooVal === undefined ) { } // data-foo is present but empty if( fooVal === '' ) { } Of course, you could cast the logic to a simple boolean: var hasFoo = ( document.getElementById('div1').dataset.foo !== undefined ); jsFiddle Demo
downvote count: 0
answers question: http://stackoverflow.com/q/28420267
type: Answer
has comment: http://stackoverflow.com/comment/45174166
upvote count: 2
score: 2
has comment: http://stackoverflow.com/comment/45174226
has comment: http://stackoverflow.com/comment/45174415
has comment: http://stackoverflow.com/comment/45174116
has comment: http://stackoverflow.com/comment/86026101

http://stackoverflow.com/q/28363525
score: 1
has body: Hi I'm making some changes to a bespoke ICT system and am struggling to set a idoc script variable. &lt;$ dDocID = &lt;script&gt; document.getElementById("docID") &lt;/script&gt;$&gt; &lt;$ dDocID = $&gt; &lt;script&gt; document.getElementById("docID") &lt;/script&gt; I have had success setting javascript variables to the values of idoc script variables but not the other way around. Any suggestions or even syntax guesses would be appreciated.
linked to: http://stackoverflow.com/q/13840429
accepted answer: http://stackoverflow.com/a/28363724
type: Question
has title: How can I set an idoc variables value from a HTML element or Javascript variable?
tagged with: oracle-ucm
tagged with: javascript
tagged with: idoc
has comment: http://stackoverflow.com/comment/45070193
has comment: http://stackoverflow.com/comment/45070006
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
favorite count: 0
duplicate of: http://stackoverflow.com/q/13840429
has answer: http://stackoverflow.com/a/28363724
upvote count: 1
type: AnsweredQuestion

http://stackoverflow.com/comment/45013510
score: 0
has text: don't quite understand - so what do you want to happen on what action. Cause I remove the img and add it below the buttons when you click two and when you click one I remove it and add it above the buttons. So you can choose what you like.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28333177

http://stackoverflow.com/q/28339923
tagged with: hover
type: AnsweredQuestion
has title: How to swap more than 3 images when hover it?
has answer: http://stackoverflow.com/a/28341393
tagged with: image
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45028008
has comment: http://stackoverflow.com/comment/45025240
has comment: http://stackoverflow.com/comment/45027685
score: 0
accepted answer: http://stackoverflow.com/a/28341393
has body: I have a image, when I hover it or mouseon it, I want the images change. Not only change once. Like I have the src of images: /images/start/1.jpg, /images/start/2.jpg, /images/start/3.jpg, /images/start/4.jpg, /images/start/5.jpg, /images/start/6.jpg, /images/start/7.jpg, /images/start/8.jpg, /images/start/9.jpg, /images/start/10.jpg. &lt;img src="/images/start/1.jpg" alt="Start" data-count="10" data-path="/images/start/{index}.jpg" /&gt; In the .js file: $(document).ready(function(){ $( "#images img" ).each(function() { var Ding = ''; $('#images img').mouseover(function() { var url=''; var index = 2; var count = $(this).attr('data-count'); var path = $(this).attr('data-path'); var $this = $(this); Ding = setInterval(function() { if (index &lt;= count) { url = path.replace('{index}', index); $this.attr('src', url).fadeIn(); index++; } else { index = 1; url = path.replace('{index}', index); $this.attr('src', url).fadeIn(); index++; } }, 800); }), $('#images img').mouseout(function(){ var path = $(this).attr('data-path'); var $this = $(this); url = path.replace('{index}', 1); $this.attr('src', url).fadeIn(); clearInterval(Ding); }); }); });
answer count: 1
has comment: http://stackoverflow.com/comment/45025143

seem-beacon-manager
tags question: http://stackoverflow.com/q/28435612
tag name: seem-beacon-manager
type: Tag

http://stackoverflow.com/comment/45111661
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28386812
type: Comment
has text: Since I need two-way binding for other reasons, I accepted another answer. But what you say is very useful and thank you for that. :)

http://stackoverflow.com/comment/45114421
type: QuestionComment
type: Comment
has text: Just pasted in Dev console and doesn't work, the console returns: [ #document ]
score: 0
comment on: http://stackoverflow.com/q/28388268

http://stackoverflow.com/comment/45209252
has text: https://github.com/strongloop/loopback/issues/418
score: 0
comment on: http://stackoverflow.com/q/28430480
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45141743
type: Comment
has text: what my point is that the dom can still be loading and the angular.js script can take quite a while to actually get downloaded (even if its in the head tag) ) I just opened the source to the uncompressed angular.js that I have here on my machine, no init is performed until line 22024 of the file ( which is after approximately 764kb into the file. ) There is no way for ng-cloak to do anything until the angular library has loaded fully (im not talking about app.init, im talking about the libraries bootstrap) Throw in a few poor choices and I can see this being a serious issue.
comment on: http://stackoverflow.com/a/28403170
type: AnswerComment
score: 0

http://stackoverflow.com/a/28292053
answers question: http://stackoverflow.com/q/28291939
upvote count: 1
has body: HTML Text box If you want to play sound in text change event then add onchange event to your text box control then in the corresponding function play the sound &lt;input type="text" id="myTextBox" onchange="musicplay()"&gt; Java script &lt;script type="text/javascript"&gt; function musicplay() { var Playsound= new Audio('Sound/Alarm1.wav'); Playsound.play(); } &lt;/script&gt;
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/a/28420720
has comment: http://stackoverflow.com/comment/45175447
type: Answer
answers question: http://stackoverflow.com/q/28420496
has body: I would bind the event listener to the form's submit event rather than the button's click. I know you didn't ask at it in your question, but binding to the form's submit event will give a much better user experience since your user's will still be able to press enter in the form to submit it. Now, as to your issue, it looks like the problem is with your use of Ajax. The form still submits even though your ajax request hasn't return yet. What you need to do is: $(function () { $('#myform').submit(function (e) { e.preventDefault(); // continue on with your business logic }); }); Of course the click event works the same way, so if you need to bind to the submit button's click event you can do the following as well: $(function () { $("button#rezerva").click(function (e) { e.preventDefault(); // continue on with business logic }); });
score: 0

http://stackoverflow.com/comment/45207341
has text: Yep sorry got distracted!
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28420835

http://stackoverflow.com/q/28297941
accepted answer: http://stackoverflow.com/a/28301469
downvote count: 0
tagged with: end-to-end
favorite count: 0
possible better answer: http://stackoverflow.com/a/53344407
tagged with: angularjs
answer count: 5
has answer: http://stackoverflow.com/a/53344407
has answer: http://stackoverflow.com/a/50694001
has answer: http://stackoverflow.com/a/60249393
type: AnsweredQuestion
has title: mouseover element not working using protractor
has body: I have a directive that produces the following html structure: hover time! Popover content The code works fine and the popover content is correctly shown when you mouseover manually using a browser. I'm trying to test the mouseover functionality with the following protractor test: it('should display the popover-content on mouseover', function() { browser.get('http://localhost:9000/'); browser.actions() .mouseMove(element(by.css('.popover')).find()).perform(); expect(element(by.css('.popover-content')) .isDisplayed().toBeTruthy()); }); The test seems to run, the browser opens but I don't see the popup-content displaying before the browser then closes so I'm fairly sure the mousemove bit isn't working for some reason. The following is then output in the terminal: launcher] 0 instance(s) of WebDriver still running [launcher] chrome #1 failed 1 test(s) [launcher] overall: 1 failed spec(s) [launcher] Process exited with error code 1 ycompu:angular ycompu$ I've read the documentation and using browser is definitely the right way to approach this test. I'm at a loss as the syntax looks correct to me.
has answer: http://stackoverflow.com/a/59385700
has answer: http://stackoverflow.com/a/28301469
type: Question
tagged with: testing
tagged with: protractor
tagged with: javascript
score: 15
upvote count: 15

http://stackoverflow.com/comment/45059422
has text: @ribsies I have add my code to http://jsfiddle.net/20f02378/
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28357602
score: 0

http://stackoverflow.com/comment/45122448
score: 0
comment on: http://stackoverflow.com/a/28392765
type: Comment
has text: Check out his `main.js` . I am sure you will find waht you are asking for. But he used lots of js and css, grid system etc. Its not a single line solution
type: AnswerComment

http://stackoverflow.com/a/28325051
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/44997977
accepted answer of: http://stackoverflow.com/q/28324992
has body: If you set an Authorization header then you are making a complex request and you have to handle the OPTIONS preflight before the browser will make the GET request. You can't set the header without handling the OPTIONS request.
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28324992

http://stackoverflow.com/comment/45187756
type: AnswerComment
comment on: http://stackoverflow.com/a/28421091
type: Comment
has text: If you do want to get REALLY dirt, though, you can sort keys! https://gist.github.com/tonylukasavage/5555476
score: 0

http://stackoverflow.com/comment/45116051
type: QuestionComment
has text: Pls add the corresponding html
comment on: http://stackoverflow.com/q/28388084
score: 0
type: Comment

http://stackoverflow.com/q/28299264
has comment: http://stackoverflow.com/comment/44950391
has title: Checking if localstorage item exist directly on div in AngularJS
type: Question
has answer: http://stackoverflow.com/a/28299485
answer count: 1
has comment: http://stackoverflow.com/comment/44950269
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44950158
tagged with: angularjs
score: 0
type: UnansweredQuestion
tagged with: local-storage
has body: how can I check if the localstorage item is not null or it exist directly in div using Angularjs? I tried to use the code below but it's not working. //show something here...

http://stackoverflow.com/comment/44944336
type: Comment
comment on: http://stackoverflow.com/q/28295918
score: 0
has text: Can you post your aspx code?
type: QuestionComment

http://stackoverflow.com/a/28381148
has comment: http://stackoverflow.com/comment/45139811
has body: Just do the same odd thing for your Bar classes: import foo from "Foo" function bar() { var Foo = foo(); return class Bar extends Foo { constructor() { } } } export default bar
score: 1
has comment: http://stackoverflow.com/comment/45154332
has comment: http://stackoverflow.com/comment/45187277
upvote count: 1
has comment: http://stackoverflow.com/comment/45192454
answers question: http://stackoverflow.com/q/28336845
has comment: http://stackoverflow.com/comment/45205194
accepted answer of: http://stackoverflow.com/q/28336845
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45189188
type: Answer
has comment: http://stackoverflow.com/comment/45176319

http://stackoverflow.com/a/28339022
score: 0
answers question: http://stackoverflow.com/q/28338974
type: Answer
has body: More written out and self explanatory solution: var inRange = function(rangeStart3,rangeStop3,value) { if (value &gt; rangeStart3&amp;&amp;value &lt; rangeStop3) { return true; } else { return false; } };
has comment: http://stackoverflow.com/comment/45023312

http://stackoverflow.com/a/28348467
has comment: http://stackoverflow.com/comment/45044249
has comment: http://stackoverflow.com/comment/45045151
score: 1
upvote count: 1
has body: The issue is in CSS. Just remove the display: block from html&gt;body thead.fixedHeader tr and html&gt;body tbody.scrollContent. Here is the jsfiddle.
downvote count: 0
answers question: http://stackoverflow.com/q/28347123
type: Answer

http://stackoverflow.com/comment/45200771
comment on: http://stackoverflow.com/q/28435338
has text: Only if the part of the text you want is wrapped in an element
type: Comment
type: QuestionComment
score: 1

eclipse-cdt
tags question: http://stackoverflow.com/q/28366718
type: Tag
tag name: eclipse-cdt

http://stackoverflow.com/comment/44921262
score: 3
comment on: http://stackoverflow.com/q/28283506
type: QuestionComment
type: Comment
has text: Works fine for me: http://jsfiddle.net/j08691/30jrn9qm/ (provided you're loading jQuery and the plugin properly *and* you're running your jQuery after the page has loaded).

http://stackoverflow.com/a/28296534
has body: I see this line in your code, which specifies width and height of the new window: map = window.open("", target, "status=0, title=0,height=600,width=800,scrollbars=1"); When you specify a width and a height the browser will always open in a new window instead of a new tab. If you specify three parameters, your statement will always open a new window, not a new tab. Your statement should probably read: window.open(&lt;URL&gt;, '_blank'); You can find more details here.
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28296393
has comment: http://stackoverflow.com/comment/44946000
has comment: http://stackoverflow.com/comment/44945694
accepted answer of: http://stackoverflow.com/q/28296393
has comment: http://stackoverflow.com/comment/44946139
type: Answer
score: 0

http://stackoverflow.com/a/28354698
answers question: http://stackoverflow.com/q/28353819
type: Answer
has comment: http://stackoverflow.com/comment/45055518
has body: I think I've done this in the past similar to what @kthornbloom suggested, with something like this on the anchor : position: relative; top: -97px; I'm not 100% on how kosher using a negative number for top is though.
score: 0
has comment: http://stackoverflow.com/comment/45056620

http://stackoverflow.com/a/28424445
type: Answer
answers question: http://stackoverflow.com/q/28424342
score: 0
has body: the easiest way would be: In you html replace: with: And in you JS replace: msg=msg.elements[0].children[0]; with: var msg=document.getElementById('error-message');

http://stackoverflow.com/comment/45122658
type: Comment
score: 0
has text: i added this line for the height only , not for the position !!
comment on: http://stackoverflow.com/a/28392765
type: AnswerComment

http://stackoverflow.com/q/28388885
has comment: http://stackoverflow.com/comment/45115472
has comment: http://stackoverflow.com/comment/45115404
has comment: http://stackoverflow.com/comment/73658965
has answer: http://stackoverflow.com/a/28389178
tagged with: node.js
downvote count: 13
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45115503
has comment: http://stackoverflow.com/comment/45115442
tagged with: v8
has body: A new stable release of Node.js (0.12) has landed recently with an upgraded Google's v8 JavaScript engine, v3.28.73. What ECMAScript 6 features are currently present in Node.js, without using the --harmony flag? I have checked several sites claiming to list the ES 6 features but all of them seem out of date - most prominently, this table (Update: now updated with current Node.js status as of 0.12), because several of the features are listed as requiring the --harmony flag while I found some of them being enabled by default (Maps, Sets, Symbols, to name a few). Update: Node specific tables have since been made available Also, trying to google this information purely for the v8 engine gives too up-to-date information - current v8 release is 4.2.*, which is quite ahead of what Node.js uses. My hopes are that this question (and its answers) will become a comprehensive summary on what ES 6 features are now available to Node.js developers. ES 6 features enabled in Node.js 0.12 I currently know of: Maps, Sets / WeakMaps, WeakSets Symbols Object.observe Promises Number .isInteger .isSafeInteger .isNaN .EPSILON .MIN_SAFE_INTEGER .MAX_SAFE_INTEGER Math .clz32 .imul .sign .log10 .log2 .log1p .expm1 .cosh .sinh .tanh .acosh .asinh .atanh .trunc .fround .cbrt .hypot
has comment: http://stackoverflow.com/comment/45115401
type: Question
has comment: http://stackoverflow.com/comment/45115318
has comment: http://stackoverflow.com/comment/64501199
has comment: http://stackoverflow.com/comment/45115506
accepted answer: http://stackoverflow.com/a/28389178
tagged with: javascript
score: 166
possible better answer: http://stackoverflow.com/a/36131064
tagged with: ecmascript-6
answer count: 2
has title: ECMAScript 6 features available in Node.js 0.12
has answer: http://stackoverflow.com/a/36131064
has comment: http://stackoverflow.com/comment/45115406
favorite count: 0
upvote count: 179

http://stackoverflow.com/comment/45094126
comment on: http://stackoverflow.com/a/28376948
type: AnswerComment
has text: In other words, this smells of homework. While this answer is almost positively not what the OP wanted, it is indeed what they asked for. ++
score: 0
type: Comment

http://stackoverflow.com/q/28310771
has title: Javascript: do not display, if 0, null, or NaN
has body: I've been looking all over (various forums and tutorials, etc.) and trying to find something that can work. Couple of things first: • I'm very new to javascript (and all languages really), but learned a little just for this. • I'm using these javascripts inside validation, calculation and formatting of form fields inside of Adobe Acrobat. Here's what I'm trying to do: Create a form where users input certain whole numbers into several fields: FieldA, FieldB, FieldC, FieldD, FieldE, FieldF, FieldG, FieldH, FieldI. Here's how it goes: • Fields A, B, C, D, F, G - user inputs whole integer. • FieldE = (FieldD)/3 • FieldH = (FieldG)/(FieldF) • FieldI = FieldA+FieldB+FieldC+FieldE+FieldH I'm having trouble with displaying/calculating "0" and "NaN". Instead of dealing with the headache trying to explain to several users what NaN is and why a "0" is there, it's easier to have them not displayed (hidden). On the user end, they won't care if there is no info displayed in any given form field, as long as there aren't a bunch of "0"s or "NaN"s littered throughout the forms. So, the simple solution is: How do I write code to not only detect 0, null, and/or NaN ... but also ... display nothing in any given form field, in these cases. If there is a whole number (in some cases Math.floor implemented for a very specific purpose), then display it. So, I'm looking for a solution to: • Keep a form field empty, when 0, Nan, or null is the case. • Disregard these things in calculations, when this is the case. • Any actual whole number interger is the only thing to display (even if it is a negative). Any suggestions? UPDATE 6/10/2015: This is how I wrote the code.... what am I doing wrong? { If ("FieldE" != null &amp;&amp; !isNaN("FieldE") &amp;&amp;"FieldE" != 0) { //calculate for FieldE } else { // set FieldE = "" { }
tagged with: forms
downvote count: 2
has comment: http://stackoverflow.com/comment/44972396
answer count: 1
tagged with: javascript
tagged with: nan
favorite count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/14636536
upvote count: 0
tagged with: zero
tagged with: hide
type: Question
has answer: http://stackoverflow.com/a/28312226
score: -2

http://stackoverflow.com/q/28357579
tagged with: jquery
has answer: http://stackoverflow.com/a/28357655
has comment: http://stackoverflow.com/comment/45058491
has body: I am having an issue trying to get the timing consistent with the following code. Basically as soon as the page is loaded it should immediately start looping through the li elements and highlighting them, removing the previously highlighted element. It works for the most part but the very first element seems to take about twice as long before it starts looping and then the rest seem to be perfectly timed. I have included a fiddle here This is the code I am using to loop function addColorClass(boom) { $(boom).addClass('li-color'); if($(boom).is(':last-child')) { $(boom).prev().removeClass('li-color'); setTimeout(function() { cycleFeatures(); $(boom).removeClass('li-color'); }, 1000); } else { $(boom).prev().removeClass('li-color'); } } function cycleFeatures() { i = 1; var timer = new Array(); jQuery('.features').first().addClass('li-color'); $('.features').each(function($) { i++; var thiz = this; timer[i] = setTimeout(function() { addColorClass(thiz); }, i * 1000); }); } cycleFeatures(); It is an infinite loop so when it reaches the last li element it will recall the cycleFeatures() function. You can see in the fiddle that the first element seems to stay highlighted about twice as long as all the other elements. I have been banging my head against the wall trying to figure it out, to no avail. Can someone please help me figure out how to keep the highlighted duration consistent.
score: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28357655
has answer: http://stackoverflow.com/a/28357652
answer count: 4
has comment: http://stackoverflow.com/comment/45058469
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28357725
has title: setTimeout timing is off on the first .each() element
has answer: http://stackoverflow.com/a/28357641
type: Question
possible better answer: http://stackoverflow.com/a/28357641
tagged with: javascript

http://stackoverflow.com/comment/44997348
comment on: http://stackoverflow.com/q/28321448
type: Comment
has text: Initially I've just passed some data to load something but in reality I will update the graph via ajax on a click button and the x-axis ticks I will be passing will be dates that's why I've set up the mode to "time".
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45107673
score: 0
type: Comment
type: QuestionComment
has text: @jfriend00 fair point. I still haven't started testing the code. So I'll move it codereview
comment on: http://stackoverflow.com/q/28384583

http://stackoverflow.com/comment/45142854
has text: In your fiddle,but third one is not in bottom right?
type: AnswerComment
comment on: http://stackoverflow.com/a/28404112
score: 0
type: Comment

http://stackoverflow.com/q/28316146
answer count: 1
favorite count: 0
type: UnansweredQuestion
downvote count: 1
score: 2
upvote count: 3
tagged with: address-bar
has answer: http://stackoverflow.com/a/28321835
type: Question
has title: Google Chrome address bar focus
linked to: http://stackoverflow.com/q/2501002
tagged with: javascript
tagged with: omnibox
has body: I am making a simple Google Chrome extension and I was wondering, is there a way to understand in my content script when the focus is on the Chrome's address bar?
tagged with: focus
tagged with: google-chrome-extension

http://stackoverflow.com/a/28353968
accepted answer of: http://stackoverflow.com/q/28353893
score: 1
answers question: http://stackoverflow.com/q/28353893
has comment: http://stackoverflow.com/comment/45052446
has comment: http://stackoverflow.com/comment/45052396
has body: In each function, before you change the iframe's src attribute just set the text of the h1 inside your #header Like this document.getElementById("p1").innerHTML = "New text!";
has comment: http://stackoverflow.com/comment/45052195
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45052185
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/45052159

http://stackoverflow.com/comment/44929200
type: QuestionComment
comment on: http://stackoverflow.com/q/28286385
type: Comment
has text: So are you saying that your code, as presented, does not pass this spec? It looks like it should. Every property of Temperature is a function.
score: 0

http://stackoverflow.com/comment/45196461
comment on: http://stackoverflow.com/q/28432782
type: QuestionComment
type: Comment
score: 0
has text: @Josh, I'm using $scope.jugador to use the variable on my template, for this reason every time that I access to the route home.html I want to load on $scope.jugador the content of $rootScope.players, but it only occurs the first time, the rest of times only can access to the function startMatch

http://stackoverflow.com/comment/44982811
comment on: http://stackoverflow.com/q/28300744
score: 0
type: Comment
type: QuestionComment
has text: @Jerem.Bartman. Yes it will. But this is the only clean way to do it. If your servers are good enough, you won't have problems. Think to video games servers with pings less to 10ms

http://stackoverflow.com/q/28296348
tagged with: image
has title: Node.js/Mongodb/GridFS resize images on upload
upvote count: 3
tagged with: mongodb
answer count: 1
has body: I am saving uploaded images in Mongodb GridFS with Node.js/Express/gridfs-stream/multyparty using streams. Works fine. Now I would like to "normalize" (resize) images to some standard format before storing to database. I could use gm https://github.com/aheckmann/gm and have streaming but I would have to install native ImageMagic (not an option) or Use something like lwip https://github.com/EyalAr/lwip and have a "pure Node" setup, but then I cannot have streaming So is there a solution to have a streaming solution to request -> resize -> store to GridFS without installing external libraries? Current solution (missing the resize step): function storeImage(req, err, succ){ var conn = mongoose.connection; var gfs = Grid(conn.db); var context = {}; var form = new multiparty.Form(); form.on('field', function(name, value){ context[name] = value; console.log(context); }); form.on('part', function(part){ // handle events only if file part if (!part.filename) { return; } var options = { filename: part.filename, metadata: context, mode: 'w', root: 'images' }; var ws = gfs.createWriteStream(options); // success GridFS ws.on('close', function (file) { console.log(file.filename + file._id); succ(file._id); }); // error GridFS ws.on('error', function (errMsg) { console.log('An error occurred!', errMsg); err(errMsg); }); part.pipe(ws); }); // Close emitted after form parsed form.on('close', function() { console.log('Upload completed!'); }); form.parse(req); }
favorite count: 0
accepted answer: http://stackoverflow.com/a/42023118
tagged with: gridfs-stream
tagged with: node.js
has answer: http://stackoverflow.com/a/42023118
type: AnsweredQuestion
downvote count: 0
type: Question
score: 3
tagged with: javascript

http://stackoverflow.com/comment/44994297
has text: @LucasTrzesniewski I guess we shall see who will become braindead once Tony the pony finds out somebody's trying to process HTML with regular expressions.
comment on: http://stackoverflow.com/q/28322908
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28359497
has comment: http://stackoverflow.com/comment/45106179
has comment: http://stackoverflow.com/comment/45077811
score: 7
has comment: http://stackoverflow.com/comment/45106135
upvote count: 7
accepted answer of: http://stackoverflow.com/q/28359060
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28359060
has comment: http://stackoverflow.com/comment/69253282
has body: Something like this will help keep and have 300 chars count. var showChar = 300; var ellipsestext = "..."; var moretext = "more"; var lesstext = "less"; $('.more').each(function() { var content = $(this).html(); var textcontent = $(this).text(); if (textcontent.length > showChar) { var c = textcontent.substr(0, showChar); //var h = content.substr(showChar-1, content.length - showChar); var html = '' + c + '' + '' + ellipsestext + '' + content + ''; $(this).html(html); $(this).after('' + moretext + ''); } }); $(".morelink").click(function() { if ($(this).hasClass("less")) { $(this).removeClass("less"); $(this).html(moretext); $(this).prev().children('.morecontent').fadeToggle(500, function(){ $(this).prev().fadeToggle(500); }); } else { $(this).addClass("less"); $(this).html(lesstext); $(this).prev().children('.container').fadeToggle(500, function(){ $(this).next().fadeToggle(500); }); } //$(this).prev().children().fadeToggle(); //$(this).parent().prev().prev().fadeToggle(500); //$(this).parent().prev().delay(600).fadeToggle(500); return false; }); .morecontent { display: none; } Based on a study of its skull, scientists say that an extinct one-tonne relative of the guinea pig probably used its 30cm incisors like tusks. Based on a study of its skull, scientists say that an extinct one-tonne relative of the guins 30cm incisors like tusks. That an extinct one-tonne relative of the ncisors like tusks. Based on a study of its skull, scientists say that an extinct one-tonne relative guinea picm incisors like tusks. Extinct one-tonne relative of the guinea pig probably used its 30cm incisors like tusks. Based on a study of its skull, scientists say that an extinct one-tonne relative of the guinea pig probably used its 30cm incisors like tusks. Edit: Snippet updated - Added Fade effects with outside container
type: Answer

http://stackoverflow.com/a/28318985
has comment: http://stackoverflow.com/comment/44988174
has comment: http://stackoverflow.com/comment/44988455
answers question: http://stackoverflow.com/q/28318433
score: 0
has comment: http://stackoverflow.com/comment/44988113
has body: You have to declare your variables in the outer scope from both functions to make them defined in the functions. (function(){ var file, filename, filtype, filesize, datafile; $("#image").on("change", function(e) { var name = $("#filename").val(); file = e.target.files[0]; filename = name.length &gt; 1 ? name : file.name; filetype = file.type; filesize = file.size; datafile = { "filename":filename, "filetype":filetype, "filesize":filesize }; console.log(datafile); console.log(file); }); $(document).on('click', '#add', function() { // Here you can access the variables now var id= $('#id').val(); var name = $('#name').val(); var address= $('#address').val(); $.ajax({ type: 'POST', url: '../include/save.php', dataType: "json", data: { id: id, name: name, address: address }, success: function(data) { console.log(data); }, error: function(data) { alert('Error! '); } }); }); })(); However you may have to check in the click-handler if the variable has a correct value EDIT: Fixed your ajax-code Added self-invoking function
type: Answer

http://stackoverflow.com/q/28423877
linked to: http://stackoverflow.com/q/14220321
has title: Variable scope with Javascript
has body: I'm under the impression that my variable scope should be correct, but the value isn't getting set. I'm wondering why that might be. Here's my code: function getUserStatus() { var status; function querySuccess(tx, results) { var row = results.rows.item(0); console.log(row['id']); status = { question: row['id'] }; } function errorCB(err) { console.log(err); } db.transaction(function(tx) { tx.executeSql('SELECT id FROM calculator ORDER by id ASC LIMIT 1', [], querySuccess, errorCB); }); console.log(status); return status; } Now, the status variable inside the querySuccess() function is getting set correctly - I am getting a value of 1 for it. However when I check the second variable of status, outside the scope of the function, I am getting undefined. Am I misunderstanding Javascript variable scope or declaring my variables incorrectly? I'm new to Javascript.
linked to: http://stackoverflow.com/q/28259164
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45181189
has answer: http://stackoverflow.com/a/28423999
has comment: http://stackoverflow.com/comment/45180720
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28424003
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28424016

http://stackoverflow.com/q/28333352
downvote count: 0
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has body: I have a dropdown menu and on the basis of the item selected I want to display a small part of HTML page. abc xyz IF the selected value is "abc" then a popup button is displayed with the following code: Run form Run form Generation Input Data Process log(s) Summary data Thickness data Particle data Steps(s) Run form filename Generate else if the value selected is "xyz" this should be displayed. how can I do it.
has title: Display HTML on the basis of dropdown menu selected
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45013644
linked to: http://stackoverflow.com/q/15137744
has answer: http://stackoverflow.com/a/28333421
has answer: http://stackoverflow.com/a/28333412
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28333466
tagged with: javascript
answer count: 3

http://stackoverflow.com/comment/45066450
comment on: http://stackoverflow.com/a/28362031
type: AnswerComment
has text: thanks, i should have mentioned that the way twitter does it is they write in the iframe code from a js code, so I can't add anything to it as far as I know.
score: 0
type: Comment

http://stackoverflow.com/comment/45155490
comment on: http://stackoverflow.com/q/28410804
score: 0
type: Comment
type: QuestionComment
has text: Adding console.log() after and before .click trigger call behaves like it was only skipping click call. Both log() calls write to console.

http://stackoverflow.com/comment/45057900
score: 0
has text: Bootstrap. It's a dynamic width. That said, I tried removing Bootstrap entirely and have only the canvas element on the page, no styles or anything, and the response is the same.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28357187

http://stackoverflow.com/q/28392679
has comment: http://stackoverflow.com/comment/45122184
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45122967
has comment: http://stackoverflow.com/comment/45122694
score: 2
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45122505
tagged with: jquery
has comment: http://stackoverflow.com/comment/45122158
favorite count: 0
has title: Post a huge html form by jQuery
has comment: http://stackoverflow.com/comment/45122261
has comment: http://stackoverflow.com/comment/45122175
has answer: http://stackoverflow.com/a/28392746
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45122873
has body: I am trying to send a html form consisting of more than 100 sub fieldsets of 10 elements which it totally a huge form of more than 1000 elements. I use jQuery to send this form. The problem is that it doesn't send all of the elements (it sends 84 sub fields out of 100). I've been searching a lot but I have not found a reason or solution. Is it a limitation of jQuery or HTML or am I doing something wrong? Here is the jQuery code: $(document).on("submit", "#video_table", function() { var action = $(this).attr('action'); var image_load = "&lt;img src='/img/loading.gif' /&gt;"; $("#videoupdate-div").html(image_load); // $.post(action, $(this).serialize(), function(data) { // $("#videoupdate-div").html(data); // }); $.ajax({ //dataType: "json", url : action, type : "POST", data : $(this).serialize() , success : function(result) { $("#videoupdate-div").html(result); }, error : function(result) { $("#videoupdate-div").html("Error! Something must be wrong."); } }); return false; });
tagged with: php
has comment: http://stackoverflow.com/comment/45122215
has comment: http://stackoverflow.com/comment/45122247
has comment: http://stackoverflow.com/comment/45122836
upvote count: 2

http://stackoverflow.com/comment/54359006
has text: Possible duplicate of [How to manually reload Google Map with JavaScript](http://stackoverflow.com/questions/17264989/how-to-manually-reload-google-map-with-javascript)
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28345745

http://stackoverflow.com/a/28437456
has comment: http://stackoverflow.com/comment/65614973
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28419242
has comment: http://stackoverflow.com/comment/45219547
has comment: http://stackoverflow.com/comment/45207616
has comment: http://stackoverflow.com/comment/81064999
has comment: http://stackoverflow.com/comment/65614806
upvote count: 54
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45219538
has body: In some plugins I've been using DI to get the ObserverLocator instance from the container: import {inject} from 'aurelia-dependency-injection'; // or from 'aurelia-framework' import {ObserverLocator} from 'aurelia-binding'; // or from 'aurelia-framework' @inject(ObserverLocator) export class Foo { constructor(observerLocator) { this.observerLocator = observerLocator; } ... } You can then do something like this: var subscription = this.observerLocator .getObserver(myObj, 'myPropertyName') .subscribe(myCallback); When you're ready to dispose of the subscription, invoke it: subscription(); I think this is all subject to change but it's something you could use right now if you needed to. More info here October 2015 update The ObserverLocator is Aurelia's internal "bare metal" API. There's now a public API for the binding engine that could be used: import {inject} from 'aurelia-dependency-injection'; // or from 'aurelia-framework' import {BindingEngine} from 'aurelia-binding'; // or from 'aurelia-framework' @inject(BindingEngine) export class ViewModel { constructor(bindingEngine) { this.obj = { foo: 'bar' }; // subscribe let subscription = bindingEngine.propertyObserver(this.obj, 'foo') .subscribe((newValue, oldValue) =&gt; console.log(newValue)); // unsubscribe subscription.dispose(); } }
type: Answer
score: 54
answers question: http://stackoverflow.com/q/28419242

http://stackoverflow.com/comment/45028551
score: 2
comment on: http://stackoverflow.com/q/28341519
has text: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D.scale ?
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28284021
upvote count: 1
answers question: http://stackoverflow.com/q/28283958
downvote count: 1
has comment: http://stackoverflow.com/comment/44922677
has comment: http://stackoverflow.com/comment/44923088
type: Answer
has comment: http://stackoverflow.com/comment/44922335
has body: You have to modify your code like this: .click( function(e) { e.preventDefault(); after this, the rest of your code. If you dont do this, then the original click event handler also will run. after a time. So your code should look like this: $("#subQuestComplete").click( function(e) { e.preventDefault(); $.post( $("#formQuestComplete").attr("action"), $("#formQuestComplete :input").serializeArray(),function(info){ $("#result").html(info); }); });
score: 0

http://stackoverflow.com/q/28296289
has title: Can I get upload path at runtime?
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I need to get upload path of my uploaded files via jquery-file-uploader. $('.new_plotphoto').fileupload({ done: function (e, data) { var filess = data.files[0]; var filename = filess.name; var filepath = filess.filepath; console.log(filename); // this shows filename console.log(filepath); // this shows undefined } });
tagged with: jquery-file-upload
tagged with: file-upload
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/28296659
score: 1
type: Question
answer count: 1

http://stackoverflow.com/comment/45107700
type: Comment
has text: It's still just jumping from one div to another :/
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28383958

http://stackoverflow.com/a/28393484
downvote count: 0
has body: It's very easy to do this sort of check yourself. In this case it is CSS so simply opening the browser console and inspecting the element would tell you that there are two elements, .front and .back position on top of each other absolutely, and the animation is a transform:rotateY(180deg) on hover along with a transition: all 0.6s ease 0s to slow it down. If there is ever a JS animation you are trying to figure out, learn how to use JS breakpoints. You can also break on DOM attribute change, which will be useful for most animations that involve some css or class changes. To learn more visit http://davidwalsh.name/css-flip.
score: 1
answers question: http://stackoverflow.com/q/28393367
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28393367
upvote count: 1
type: Answer

http://stackoverflow.com/comment/45103936
type: Comment
score: 1
has text: I agree that using `window.onload` is suboptimal. However, any library which hijacks that is a buggy piece of garbage that you should not use anyway.
type: AnswerComment
comment on: http://stackoverflow.com/a/28381660

http://stackoverflow.com/comment/45083100
has text: Hi DLeh, there is no error whatsoever. It's actually running the interrupt method - this is from the jQuery scrollface library - but failing to stop the actual slideshow.
type: Comment
comment on: http://stackoverflow.com/q/28369018
score: 0
type: QuestionComment

http://stackoverflow.com/q/28385475
type: AnsweredQuestion
downvote count: 0
has title: Call function on click unless click occurs on certain elements
type: Question
has body: When the user clicks on a modal, I'd like the modal to hide. I'm accomplishing this by using this code: $(".modal").click(function(event){ $('#myModal').modal('hide'); }); However, .modal contains an img and p, and when the user clicks on these elements I don't want the modal to hide. What would be the best way to achieve this? Thanks.
score: 1
accepted answer: http://stackoverflow.com/a/28385502
upvote count: 1
has answer: http://stackoverflow.com/a/28385502
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/q/28425146
has comment: http://stackoverflow.com/comment/45182776
has body: In the second statement, since the parentheses are optional, how do I know if the parentheses are part of the first constructor, the second, or if it is calling a function that does not do anything? function A(){return function(){}} new new A()
has title: How do I know what the parentheses refer to
tagged with: new-operator
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45182733
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/28445610
has comment: http://stackoverflow.com/comment/45182639
has comment: http://stackoverflow.com/comment/45182667
has answer: http://stackoverflow.com/a/28445610
has comment: http://stackoverflow.com/comment/45182688
has comment: http://stackoverflow.com/comment/45183084
type: AnsweredQuestion

http://stackoverflow.com/comment/44924620
has text: You have a typo in your coment (lowercase "t"). This should work. If you have some polymer element that contains <paper-lighbox> and listener for event is in its javascript
comment on: http://stackoverflow.com/a/28284975
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45088963
comment on: http://stackoverflow.com/a/28374154
score: 0
type: AnswerComment
type: Comment
has text: oh right... I was getting setTimeout confused with setInterval. Have you tried setInterval, instead?

http://stackoverflow.com/a/28306139
score: 0
type: Answer
has body: Just an idea, as I can't give you a direct answer so this is more of just looking at a different approach.. but have you looked at changing the page so that there is nothing to actually scroll when on the touch event? ie/ fix the height and add in overflow hidden.
has comment: http://stackoverflow.com/comment/44965709
answers question: http://stackoverflow.com/q/28305960
has comment: http://stackoverflow.com/comment/44963310

http://stackoverflow.com/q/28344195
downvote count: 0
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/45032893
score: 1
has answer: http://stackoverflow.com/a/30841372
has body: I use basic type of highchart to draw graphic, but I do not want to connect the points. Just the point is enough. How can I achieve this?
has title: Basic highcharts plugin, need to remove line between point
type: Question
tagged with: highcharts

http://stackoverflow.com/q/28319119
favorite count: 0
type: UnansweredQuestion
downvote count: 2
upvote count: 1
has body: I am using below code for validating the check box if(!validateForm()) { alert("Please select intrested in required service"); return false; } return true; } function validateForm() { var c = document.getElementsByTagName('input'); for (var i = 0; i &lt; c.length; i++) { if (c[i].type == 'checkbox') { if (c[i].checked) {return true}document.myForm.action="thankyou-enquiry-hrservice.php" ; } } return false; } I have about 5 check boxes. If checked only 1 then it will go to thankyou-enquiry-hrservice.php. If i select multiple check boxes its not redirecting to that page instead its refreshing the current page with empty fields in website.
has comment: http://stackoverflow.com/comment/44986995
type: Question
tagged with: javascript
score: -1
has title: Check Box Validation error
has answer: http://stackoverflow.com/a/28319302
has comment: http://stackoverflow.com/comment/44987080
answer count: 1

http://stackoverflow.com/comment/45053381
comment on: http://stackoverflow.com/a/28354868
has text: This hides the element if it **does** have something that isn't `*`. It doesn't hide it if it **doesn't** have anything.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28403148
has comment: http://stackoverflow.com/comment/45141657
favorite count: 0
score: -4
has answer: http://stackoverflow.com/a/28403657
tagged with: php
type: AnsweredQuestion
has title: Save updated values to database and show them in html table
accepted answer: http://stackoverflow.com/a/28403657
type: Question
downvote count: 4
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: ajax
has body: I have a table like the following: <?php if(count($voucher_info) > 0 ){ ?> S.no Voucher Type Voucher Mode <?php $rownum = 1; foreach ($voucher_info as $eachrecord){ $zibracolor = ($rownum%2==0)?"even":"odd"; ?> <?php echo $eachrecord->voucher_id; ?> <?php echo $eachrecord->voucher_type; ?> <?php echo ucwords($eachrecord->voucher_mode); ?> <?php } } else { echo " "; echo " No records found "; echo " "; } ?> <?php if(count($voucher_info) > 0 ){ ?> S.no Voucher Type Voucher Mode <?php $rownum = 1; foreach ($voucher_info as $eachrecord){ $zibracolor = ($rownum%2==0)?"even":"odd"; ?> <?php echo $eachrecord->voucher_id ; ?><input type="hidden" name="voucher_id[]" value="<?php echo $eachrecord->voucher_id; ?>" /> <input name="vouchertype[]" type="text" value="<?php echo $eachrecord->voucher_type; ?>" /> <option value="paidin" <?php if($eachrecord->voucher_mode=='paidin') { ?> selected="selected" <?php } ?>>Paid In <option value="paidout" <?php if($eachrecord->voucher_mode=='paidout') { ?> selected="selected" <?php } ?>>Paid Out <?php } } else { echo " "; echo " No records found "; echo " "; } ?> <input id="update" type="submit" name="submit" value="Edit"/ In first table I am displaying values from database. But when user click on edit button below the table, Then that table values should be editable for user. I have succeeded in making editable fields but again when user click on submit then updated values are not displaying in first table. I know it's possible with jQuery or JavaScript. When I alert(newsales), the alert is undefined.
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/44916413
score: 0
type: Comment
type: QuestionComment
has text: @Halcyon it's working fine in chrome.
comment on: http://stackoverflow.com/q/28280747

http://stackoverflow.com/comment/45038692
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28347207
score: 1
has text: better not, use [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) as a reference. However I'm suggesting that you [edit] your answer to incorporate the explanation :-)

http://stackoverflow.com/q/28295330
type: Question
has title: Ajax url: parameter and checking for success
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44943185
tagged with: ajax
has comment: http://stackoverflow.com/comment/44943137
score: 0
has answer: http://stackoverflow.com/a/28295470
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44943357
tagged with: php
has body: im not so sure how this works, but where does my success(data) value come from? must I return a value in url: php/login.php? $.ajax({ url: 'php/login.php', //must i return a value in login.php? data: {username:username,password:password}, type: "POST", dataType: 'json', success: function(data) { if(data == true){ console.log("sdfsdfs " + data); login.submit(); } else{ console.log("NO DATA PRESENT"); } } //else do an alert("please lgo in again"); }); in php/login.php i query the DB to see if such a user exists and if password match part of my login.php &lt;?php echo $username = $_POST['username']; //not echo-ing echo $password = $_POST['password']; if ($_POST['login']) //check if the submit button is pressed { $remember = $_POST['remember']; if ($username&amp;&amp;$password) //check if the field username and password have values { $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = ''; $connect=mysqli_connect($dbhost,$dbuser,$dbpass) or die("Unable to Connect"); mysqli_select_db($connect,"clients") or die("Could not open the db"); $sql = "SELECT * FROM clients.users WHERE username='$username'"; $login = mysqli_query($connect, $sql); if (mysqli_num_rows($login)) { while ($row = mysqli_fetch_assoc($login)) { $db_password = $row['password']; if ($password==$db_password) { $loginok = TRUE; echo json_encode( true ); } else { echo json_encode( false ); echo "Please re-enter username and password, they did not match"; header("Location: ../login.php"); } ?&gt;

http://stackoverflow.com/q/28316868
has comment: http://stackoverflow.com/comment/44982853
has answer: http://stackoverflow.com/a/28317144
accepted answer: http://stackoverflow.com/a/28317144
has body: I see a strange behavior when redirecting to a URL with Backbone router. If I try to redirect to: //myserver/component_issues/index?id=org.codehaus.sonar:sonarqube ... everything is fine, but I get a 404 when I try to redirect to: //myserver/component_issues/index?id=org.codehaus.sonar-plugins.javascript:javascript`` The browser JavaScript console tells me that the URL it is trying to open is: //myserver/component_issues/index?id=org.codehaus.sonar-plugins. ... so it loses the javascript:javascript part. What could be going on?
favorite count: 0
tagged with: backbone.js
tagged with: http-redirect
score: 2
type: AnsweredQuestion
downvote count: 0
has title: URL mangled when redirecting with Backbone
type: Question
upvote count: 2
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/28407423
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28320640
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28320640
has comment: http://stackoverflow.com/comment/77868356
downvote count: 1
type: Answer
score: 1
has body: The easiest way is probably to just download the sdk, edit it (as in add the protocol) and just deliver it with your App. As far as I know you can't just change the location.protocol property to make that work so everything else will be quite hacky so you should really stick to the first solution. However, you could just get all "script" tags, iterate over them and check the src. If the src starts with an "//" you just create a new script node with the "http://" + element.src to load it properly. You'd most likely need to run that with a little timeout which slows down the whole App quite a bit and if a coworker of mine would do something like that I'd probably hit him but you know, it would work ;) Ben

http://stackoverflow.com/comment/45036970
type: QuestionComment
comment on: http://stackoverflow.com/q/28346414
type: Comment
score: 1
has text: Can post `html` , `css` , `js` ?

http://stackoverflow.com/a/28378748
score: 5
type: Answer
has comment: http://stackoverflow.com/comment/45097428
has body: I'm not sure that's what you're after, but here are 2 ways of doing what you want: // method 1: use a private scope var click_handler = (function() { var counter = 0; // this is not in global scope! return function() { counter++; }; })(); // method 2: use a function property function click_handler() { click_handler.counter++; } click_handler.counter = 0;
upvote count: 5
answers question: http://stackoverflow.com/q/28378698
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28378698

http://stackoverflow.com/comment/45009332
type: QuestionComment
has text: From the error, it sounds like you're trying to call .replace() on an undefined variable, but I'm not seeing that code. I don't think it's a problem with insertar based on what you posted. Even if it was empty it should be cause in the if statement. Example: http://jsfiddle.net/yq4hvyxj/
comment on: http://stackoverflow.com/q/28330752
score: 0
type: Comment

http://stackoverflow.com/a/28412806
score: 1
has comment: http://stackoverflow.com/comment/45160002
answers question: http://stackoverflow.com/q/28412530
type: Answer
has body: In your success function "this" is not what you expect function (data) { this.$scope.metaD = data; } You can try setting this outside your callback like this: var _this = this; and inside your callback use: function (data) { this.$scope.metaD = data; } Your final code should look like: getData: function () { var _this = this; this.$scope.meta = this.EntityService.getMetaData(); var dataS = {}; this.$scope.meta.then( function (data) { _this.$scope.metaD = data; }, function (err) { alert('Error'); } ) }
upvote count: 2
has comment: http://stackoverflow.com/comment/45159509
downvote count: 1

http://stackoverflow.com/comment/45201971
type: Comment
has text: it's more then just echo it [take a look](http://stackoverflow.com/questions/28435382/pass-an-array-from-php-to-javascript?noredirect=1#comment45201296_28435382)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28432819

http://stackoverflow.com/a/28338374
score: 0
type: AcceptedAnswer
has body: Better you can try bootstrap framework(data tables). it can easily to integrate for large number of rows including the DataTables Bootstrap files (CSS and JS)
type: Answer
has comment: http://stackoverflow.com/comment/45025288
answers question: http://stackoverflow.com/q/28337717
accepted answer of: http://stackoverflow.com/q/28337717

http://stackoverflow.com/a/57120853
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/28350584
has body: For folks who are looking to clear localstorage (web browser, in the window obj) from the server side, include the Clear-Site-Data http header. Clear-Site-Data: "storage" More info here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Clear-Site-Data
type: Answer
downvote count: 0

http://stackoverflow.com/a/28401956
score: 1
downvote count: 0
upvote count: 1
has body: I think your Javascript is not even being triggered - you have a syntax error in your script.js (you can view syntax errors in the javascript console if you are using Google Chrome). I have re-written your application as follows to get it working as expected: flaskapp.py from flask import Flask, render_template, request app = Flask(__name__) app.debug=True @app.route('/') def index(name=None): return render_template('index.html', name=name) @app.route('/serviceidlookup', methods=["GET", "POST"]) def serviceidlookup(): serviceid = request.form.get('serviceid') serviceid2 = serviceid + " extra" return render_template('lookup.html', serviceid=serviceid, serviceid2=serviceid2) if __name__ == '__main__': app.run() static/script.js $(document).ready( function() { $('#submit').click(function() { var serviceid = document.getElementById("field").value; $.post( "/serviceidlookup", { serviceid: serviceid } ).done(function (reply) { $('#reply').empty().append(reply); }); }); });
type: Answer
answers question: http://stackoverflow.com/q/28401402

http://stackoverflow.com/comment/45067852
type: Comment
comment on: http://stackoverflow.com/a/28362956
score: 0
type: AnswerComment
has text: that's what the document ready function is made for: `$(function() { /* DOM loaded for all the code here */});`

http://stackoverflow.com/q/28388619
has answer: http://stackoverflow.com/a/28462971
score: 0
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/45114823
has answer: http://stackoverflow.com/a/28394065
has title: Setting variable limits for cytoscape.js mapData
type: UnansweredQuestion
type: Question
tagged with: cytoscape.js
has comment: http://stackoverflow.com/comment/45124184
has body: Quick question. I am trying to use cytoscape's.js mapData linear mapper to set the colour of edges in a small plot. There is, however, a small problem. The following example works without a hitch. .selector('edge') .css({ 'line-color': 'mapData(similarity,1.8,3.78, blue, red)' 'width': 2, 'opacity': 0.8 }) However, as soon as a I replace the fixed boundaries, I am in a bit of a pickle. .selector('edge') .css({ 'line-color': 'mapData(similarity,min, max, blue, red)', 'width': 2, 'opacity': 0.8 }) the coloured edges disappear, and all turn grey. The min and max variables are set prior, and I can verify this because they are being used to calculate other stuff before the graph is created. I have looked through the documentation but cannot find anything regarding this issue. As @dandavis suggested, It might be a plugin thing. So I tried adding the to add the max and min to each edge json definition. This was done thinking that maybe the mapData function assumes that whenever a "variable" is used, they are stored in the definition of the appropriate selector. id: "133700_307800" max_sim: 3.57829530512 min_sim: 1.9655114484 similarity: 3.57829530512 source: "133700" target: "307800" Any ideas? thanks a lot!

http://stackoverflow.com/comment/45200728
type: Comment
comment on: http://stackoverflow.com/a/28435229
has text: Do you have an entry named 'action' in the model object you are constructing and is it non empty? seems like your backend is expecting data you are not sending
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45144312
comment on: http://stackoverflow.com/q/28400402
has text: @RobG Thats really obvious. I don't know how I could miss that. Thank you.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45023087
type: AnswerComment
comment on: http://stackoverflow.com/a/28338858
type: Comment
has text: `hide` is a method, but you're calling it like a property instead of what it really is..So with methods you need to append `()` at the end
score: 0

http://stackoverflow.com/a/28388557
has comment: http://stackoverflow.com/comment/45115754
type: Answer
has comment: http://stackoverflow.com/comment/45116550
answers question: http://stackoverflow.com/q/28387770
has comment: http://stackoverflow.com/comment/45116585
has comment: http://stackoverflow.com/comment/45116597
has comment: http://stackoverflow.com/comment/45118902
has comment: http://stackoverflow.com/comment/45116192
has comment: http://stackoverflow.com/comment/45116465
has body: function getData(TechRiskTable){ try { var table = document.getElementById(TechRiskTable); var rowCount = table.rows.length; var jsonArray = new Array(); for(var index=0; index &lt; rowCount; index++) { var mapObj = {}; var row = table.rows[index]; var name1 = row.cells[0].childNodes[0]; var name2 = row.cells[1].childNodes[0]; var name3 = row.cells[2].childNodes[0]; var name4 = row.cells[3].childNodes[0]; var name5 = row.cells[4].childNodes[0]; mapObj['name1'] = name1.value; mapObj['name2'] = name2.value; mapObj['name3'] = name3.value; mapObj['name4'] = name4.value; mapObj['name5'] = name5.value; // document.write("Value in jsonArray " + name1.value + "&lt;br /&gt;"); return mapObj; } }catch(e) { alert(e); } return null; I am assuming you are calling this method from somewhere else, var mapObj = getData(TechRiskTable); if(mapObj!=null) { alert("name1 is "+mapObj.name1+" and name2 is "+mapObj.name2); }
score: 0
has comment: http://stackoverflow.com/comment/45116499
has comment: http://stackoverflow.com/comment/45118280
has comment: http://stackoverflow.com/comment/45115643

http://stackoverflow.com/a/28343797
type: Answer
score: 0
has body: Yes, your click handler for the submit was not correct and at the password check you've missed the quotes 'test'. (As the others already answered.) Below is the demo of your code and here at jsFiddle. It uses the jQuery cookie plugin for the cookies, but your PHP cookies will work too. I have just no backend for the demo. Sorry, it's not working on SO because of insecure operation, probably the cookies are not allowed here. But at jsFiddle it is working. Also don't remove the login div with $("#login-bg").remove(); because it will be removed from DOM and you can show it again to the user. It's better to only hide it. // if(!isset($_COOKIE['is_logged'])) $(document).ready(function () { if (!$.cookie('is_logged')) { console.log('not logged in, show form'); //document.cookie.indexOf("is_logged") === -1) { //$('#video').click(function () { //$('#code').val(''); // clear input $("#login-bg").fadeIn('slow'); //}); $('#cancel').click(function () { $('#login-bg').fadeOut('slow'); //window.location = "<?php echo $this->baseUrl; ?>/index"; }); } else { $('#mainContent').fadeIn('slow'); } $('#logout').click(function () { console.log('hide clicked'); $('#code').val(''); // clear input $('#mainContent').hide(); $("#login-bg").fadeIn('slow'); $.removeCookie('is_logged'); }); $("#check-form").on('click', 'input[type=submit]', function (evt) { evt.preventDefault(); var value = $('#code').val(); var pass = 'test'; if (value == pass) { // 'test') { //SetCookie('is_logged', 'is_logged', 365 * 10) $.cookie('is_logged', 'true', { expires: 7 }); $('#mainContent').fadeIn('slow'); $("#login-bg").hide(); // don't remove the login section } else { $('#login-bg').effect("shake"); } }); }); #login-bg { display: none; } #mainContent { display: none; } Provide the code! And enjoy free access! Cancel Login succeeded! Shown after login!! Logout
answers question: http://stackoverflow.com/q/28342851

http://stackoverflow.com/comment/62198639
type: AnswerComment
comment on: http://stackoverflow.com/a/28390818
type: Comment
has text: how to use aggregation `option` in above example?
score: 0

http://stackoverflow.com/a/28294360
has comment: http://stackoverflow.com/comment/46082169
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/46828353
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28282385
answers question: http://stackoverflow.com/q/28282385
has body: Edit the wiki link seems to be outdated, please refer to jib's answer down below. It seems like Firefox has not yet implemented constraints. Constraints have been implemented since Chrome 24 and Opera 18. These can be used to set values for video resolution for getUserMedia() and RTCPeerConnection addStream() calls. and from: https://wiki.mozilla.org/Media/getUserMedia Capture resolution [in Firefox] currently fixed to 640x480 for video; It only supports Minimal constraints supported: (Note: all of these booleans default to 'false') video: true/false audio: true/false fake: true/false picture: true/false

http://stackoverflow.com/a/30240467
score: 5
upvote count: 5
answers question: http://stackoverflow.com/q/28341272
downvote count: 0
type: Answer
has body: Your initialization code is correct. I suspect you're using newer DataTables 1.10.x library (by presence of autoWidth option). Error Cannot read property 'fnGetData' of undefined can occur when you're trying to call older version (1.9.x) method fnGetData() on API instance of newer 1.10.x version of DataTables, for example: var data = $('#example').DataTables().fnGetData(); Correct way to call fnGetData() in both 1.9.x and 1.10.x versions is var data = $('#example').dataTable().fnGetData(); See DataTables 1.9 to 1.10 migration reference for more information.

http://stackoverflow.com/comment/45054780
has text: You probably didn't notice the quotes are around json_encode is no longer there.
comment on: http://stackoverflow.com/q/28354094
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28302077
accepted answer of: http://stackoverflow.com/q/28301842
answers question: http://stackoverflow.com/q/28301842
has body: Use Asynchronous Module Definition (AMD) With RequireJs. Good article on Require and knockout can be found here. Quoting from the site. HTML First name: First name capitalized: scope/init.js require(['knockout-x.y.z', 'appViewModel', 'domReady!'], function(ko, appViewModel) { ko.applyBindings(new appViewModel()); }); scripts/appViewModel.js // Main viewmodel class define(['knockout-x.y.z'], function(ko) { return function appViewModel() { this.firstName = ko.observable('Bert'); this.firstNameCaps = ko.pureComputed(function() { return this.firstName().toUpperCase(); }, this); }; }); According to the code snippet given above you can see that you can make your view model code separate from the html and even can be modularize which is much helpful.
type: Answer
has comment: http://stackoverflow.com/comment/45069599
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45030353
has comment: http://stackoverflow.com/comment/45016452
has comment: http://stackoverflow.com/comment/45043624
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/a/28363020
score: 0
has comment: http://stackoverflow.com/comment/45070722
has comment: http://stackoverflow.com/comment/45070085
type: Answer
has comment: http://stackoverflow.com/comment/45069023
has comment: http://stackoverflow.com/comment/45070173
has body: Your problem is that if you get all the songs id which is specified in table as id="sondId" or name="sondId", and by using request.getParameter("songId"), it wont pick the correct value coz of all the rows will be containing same id and name. So what you need to do is inside the <c:forEach> enter a , like below <c:forEach items="${playlist}" var="canzone" varStatus="count"> ${count.index +1} ${canzone.artistName} ${canzone.title} </c:forEach> You have to decide on how to submit the form after you specified the stars, like onchange() or something else. This is not very good choice, but just what I know..
has comment: http://stackoverflow.com/comment/45070010
answers question: http://stackoverflow.com/q/28362548

http://stackoverflow.com/comment/124394514
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28308103
score: 0
has text: Does this answer your question? [Auto resizing the SELECT element according to selected OPTION's width](https://stackoverflow.com/questions/20091481/auto-resizing-the-select-element-according-to-selected-options-width)

http://stackoverflow.com/comment/45040917
type: Comment
comment on: http://stackoverflow.com/a/28348166
type: AnswerComment
has text: Updated answer. Follow the link.
score: 0

http://stackoverflow.com/comment/45165474
comment on: http://stackoverflow.com/q/28415318
type: Comment
score: 0
has text: yes, those are typos. i'll correct them now..
type: QuestionComment

http://stackoverflow.com/q/28337858
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/45021622
has answer: http://stackoverflow.com/a/28338263
accepted answer: http://stackoverflow.com/a/28338263
favorite count: 0
has comment: http://stackoverflow.com/comment/45021645
has title: dragging not working in internet explorer
tagged with: css
type: AnsweredQuestion
tagged with: internet-explorer
downvote count: 0
score: 1
has body: I m trying to resize as well drag a div in my code.code is below,but i m not able to drag the div at all in ie but i can do the same in chrome.But resizing works in both.Please check and guide me on how can i make dragging work as well in ie. interact('.divname') .resizable(true) .on('resizemove', function (event) { var target = event.target; // add the change in coords to the previous width of the target element var newWidth = parseFloat(target.style.width ) + event.dx, newHeight = parseFloat(target.style.height) + event.dy; // update the element's style target.style.width = newWidth + 'px'; target.style.height = newHeight + 'px'; //target.textContent = newWidth + '×' + newHeight; }); interact('.divname') .draggable({ // enable inertial throwing inertia: true, // keep the element within the area of it's parent restrict: { restriction: "parent", endOnly: true, elementRect: { top: 0, left: 0, bottom: 1, right: 1 } }, // call this function on every dragmove event onmove: function (event) { var target = event.target, // keep the dragged position in the data-x/data-y attributes x = (parseFloat(target.getAttribute('data-x')) || 0) + event.dx, y = (parseFloat(target.getAttribute('data-y')) || 0) + event.dy; // translate the element target.style.webkitTransform = target.style.transform = 'translate(' + x + 'px, ' + y + 'px)'; // update the posiion attributes target.setAttribute('data-x', x); target.setAttribute('data-y', y); }, // call this function on every dragend event onend: function (event) { var textEl = event.target.querySelector('p'); textEl &amp;&amp; (textEl.textContent = 'moved a distance of ' + (Math.sqrt(event.dx * event.dx + event.dy * event.dy)|0) + 'px'); } }); &lt;div class="divname"&gt; &lt;/div&gt;
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/45187843
type: Comment
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28428223
has text: As its pointed out in the comments, using JS is not the best idea. This is really not recommended.

http://stackoverflow.com/q/28362996
answer count: 2
has comment: http://stackoverflow.com/comment/45069131
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/46811870
has body: I have a jQuery msgBox to take usrID &amp; PassWD With a button "Login". I want to associate button click function with "Enter" keypress. When one presses Enter it should work same as onclick on login button. $.msgBox({ type: "prompt", title: "Please Enter Your User Name &amp; Password", inputs: [ {header: "User Name*", type: "text", name: "userName", value: spl[0]}, {header: "Password*", type: "password", name: "password"} ], buttons: [{value: "Login", type: "submit"}], success: function(result, values) { alert("Thanks..."); } });
has comment: http://stackoverflow.com/comment/45070143
has comment: http://stackoverflow.com/comment/45120768
tagged with: msgbox
tagged with: jquery
type: Question
has comment: http://stackoverflow.com/comment/45069755
has title: jQuery msgBox on Enter keypress
has answer: http://stackoverflow.com/a/40653794
score: 0

http://stackoverflow.com/comment/44961514
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28304487
score: 0
has text: The two first patterns are false. where are the replacement strings?

http://stackoverflow.com/q/28280280
answer count: 1
tagged with: jquery
tagged with: ipad
has title: Ipad/Ipad Mini Loads Site, Then Resizes Smaller, Then Resizes to Fullscreen Again
has answer: http://stackoverflow.com/a/28281812
type: UnansweredQuestion
has body: The site loads fine on a desktop and on phones. It tested fine on an online ipad simulators. When I try it on the ipad, the browser window loads, shrinks, then loads proper. On an ipad mini some of the jquery functions thereafter do not work either, but do on a regular ipad. This leads me to believe it's a javascript issue. The site was built on Wordpress (Avada Theme). I added a custom header that uses jQuery(in which everything worked fine at one time). I have tried taking that script out, I've tried taking out @media queries, I've tried disabling plugins. Nothing seems to stop this from happening. Any suggestions? Here is a link to the site http://afflv.com
linked to: http://stackoverflow.com/q/19012135
type: Question
linked to: http://stackoverflow.com/q/20164982
tagged with: javascript
score: 0

http://stackoverflow.com/comment/45100169
type: QuestionComment
comment on: http://stackoverflow.com/q/28379923
score: 0
type: Comment
has text: Angular $http is making the requests

http://stackoverflow.com/comment/45198746
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28434311
score: 0
has text: Neither with extension? :/

http://stackoverflow.com/comment/45072240
type: AnswerComment
comment on: http://stackoverflow.com/a/28365361
type: Comment
has text: Ok, so you are saying that you are unable to pass in event as an argument.
score: 0

http://stackoverflow.com/comment/44945686
type: Comment
comment on: http://stackoverflow.com/q/28295935
score: 0
type: QuestionComment
has text: gestioneUtenti/rotte?filter_id=TLK 500 (Internal Server Error) jquery-2.1.1.js:8623send jquery-2.1.1.js:8623jQuery.extend.ajax jquery-2.1.1.js:8152jQuery.(anonymous function) jquery-2.1.1.js:8298(anonymous function) gestioneUtenti:45jQuery.event.dispatch jquery-2.1.1.js:4409elemData.handle

http://stackoverflow.com/comment/45050523
has text: Also ... is hiding then showing the nav with javascript going to be a problem for certain users / browsers? I assume not, simply because the nav required javascript anyway.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28353356

http://stackoverflow.com/comment/44991815
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28321715
has text: https://browserling.com/browse/firefox/35/http%3A%2F%2Fjsfiddle.net%2Fv804srt2%2F
score: 0

http://stackoverflow.com/comment/45180414
type: Comment
has text: @NeilnGauss yes it works for all computer and devices as well such as tablet, mobile also. Path stands for the location of your file.
comment on: http://stackoverflow.com/a/28403785
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45011881
has text: so, you want the result of this action, to be displayed when the user reaches the second file, correct? In that case localstorage, cookies, or querystring (in that order) would be good storage options for storing which key was pressed. the second page would then need to read from whichever option you chose to display it.
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28332245
type: Comment

http://stackoverflow.com/comment/45112955
score: 0
type: Comment
type: QuestionComment
has text: "alternative to host my javascript" - Where do you host your HTML files?
comment on: http://stackoverflow.com/q/28387675

http://stackoverflow.com/comment/45159303
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28412885
has text: I have effected all the suggestions made but it still doesn't work. Moreover, I wont want to change the name of the text box because ot only that it is automatically echoed by php but it is going to be posted to a php script when submitted

http://stackoverflow.com/comment/45236552
score: 0
comment on: http://stackoverflow.com/a/28454846
type: AnswerComment
has text: I finally used an already implemented login app: https://github.com/braitsch/node-login Thanks
type: Comment

http://stackoverflow.com/a/28394646
upvote count: 2
has body: Please check that you add all the file properly, like jquery.js or theme.atom.css or pace.js etc...
answers question: http://stackoverflow.com/q/28385063
score: 2
downvote count: 0
type: Answer

http://stackoverflow.com/comment/45052428
type: Comment
type: QuestionComment
score: 0
has text: and that's something happening not only with that elements, it happens with all the elements that apply that animate.css classes.
comment on: http://stackoverflow.com/q/28287816

http://stackoverflow.com/q/28290149
type: Question
tagged with: rgraph
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28355693
type: UnansweredQuestion
has title: Legend doesn't show all line's on line Rgraph
has body: I'm using Rgraph to make a line graph with multiple line's on it. The problem i'm having is that some graphs i'm making can have over 30 lines on them which means the legend doesn't show all the lines displayed on the graph. I've looked through the properties of the Rgraph but can't find something that would help me. Is there a way that I can display all this information on the legend in some way, ie a scrollbar. Cheers

http://stackoverflow.com/comment/45050444
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28352722
has text: I see you're setting `overflow-x` to `hidden` on the html, body in your media query `@media (max-width: 767px)` ..
score: 0

http://stackoverflow.com/a/28404844
accepted answer of: http://stackoverflow.com/q/28389395
downvote count: 0
score: 3
has comment: http://stackoverflow.com/comment/45702827
type: AcceptedAnswer
upvote count: 3
has body: As you already noticed the function capser.waitForAlert() is available since version 1.1-beta4. You can copy the function from the code if you don't have the time to upgrade: casper.waitForAlert = function(then, onTimeout, timeout) { ... }; Problem: Alerts and confirm just happen and they don't stop the execution in PhantomJS and CasperJS. They are also not part of the page and cannot be clicked on. If you would register to the error events (resource.error and page.error and remote.message is always a good idea) in CasperJS, you would have seen that a specific resource error was thrown: {"errorCode":6,"errorString":"SSL handshake failed","id":1,"url":"https://www.macysliquidation.com/"} If you would have checked the status of the page, you would have seen that it wasn't loaded. Solution: Run CasperJS with --ignore-ssl-errors=true and depending on your PhantomJS version with --ssl-protocol=tlsv1. More information here.
answers question: http://stackoverflow.com/q/28389395
type: Answer

http://stackoverflow.com/comment/45002052
comment on: http://stackoverflow.com/a/28326837
score: 0
type: AnswerComment
type: Comment
has text: You see `Cross origin requests are only supported for protocol schemes`

http://stackoverflow.com/comment/45135167
type: QuestionComment
has text: `if userAnswer = ("yes")` <--- what's this? Where did you find such an odd syntax for `if`?
score: 2
comment on: http://stackoverflow.com/q/28399760
type: Comment

http://stackoverflow.com/q/28420231
has title: Drawing line to HTML5 canvas not working using javascript
upvote count: 1
downvote count: 1
type: Question
has body: I am using the following codes to draw a line to html canvas. But unfortunately i am not seeing any line in the canvas. I am not finding any error even. TODO supply a title Here is the jsfiddle of the code http://jsfiddle.net/8ebLLwa9/ Can anyone help me too find the mistake?
tagged with: javascript
score: 0
answer count: 2
tagged with: canvas
has answer: http://stackoverflow.com/a/28420477
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28420507
accepted answer: http://stackoverflow.com/a/28420477
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28420507

http://stackoverflow.com/comment/45177939
type: AnswerComment
type: Comment
has text: I would definitely use two routes.
score: 0
comment on: http://stackoverflow.com/a/28415712

http://stackoverflow.com/a/28352553
score: 1
type: Answer
answers question: http://stackoverflow.com/q/28351606
has body: I think you create overhead, maybe I wrong, you can edit me. Did you really need send back all datas back or you just need send modified data? Because in real life hard to imagine that user will review 20.000 of rows. Good example is ExtJS stores, you can see example here Key thing of stores that they send back to the server only modified or deleted data, it save browser, network and server resources.
upvote count: 1
has comment: http://stackoverflow.com/comment/45051348
downvote count: 0

http://stackoverflow.com/comment/45115243
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28388526
type: AnswerComment
has text: Ok so there is data and the select is being populated. That helps us a bit. How do you get to this URL? Is it an ajax call, or a form submit? If it's a simple form submit then it should work fine as it stands. If it's an ajax call then I don't see any code to build the URL.

http://stackoverflow.com/a/28398587
has body: You can think of the | operator in Angular in a similar way as in a bash command. The | is piping the result of the left-hand expression (in your case products to the right-hand side. Underneath, this is just a nice and convenient way to call a filter from the view template. When | is used, the collection that is on the left-hand side is sent in the a filter function to complete the filter. A filter always requires at least on parameter (the array that is being filtered). So, Angular is safe to make the assumption that there will always be something to filter on the left-hand side. It is slightly easier to see the underlying function call with the $filter(name) syntax: $filter('filter')(array, expression, comparator) The 'filter' above is the name of the filter, and then, the first parameter array is the source array to apply the expression to. So, the | is just a convenient way to use $filter without having to explicitly pass the array parameter. Link to documentation here.
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28398405
answers question: http://stackoverflow.com/q/28398405
has comment: http://stackoverflow.com/comment/45133463
score: 0
has comment: http://stackoverflow.com/comment/45133941

datatables
tags question: http://stackoverflow.com/q/28413973
tags question: http://stackoverflow.com/q/28346402
tags question: http://stackoverflow.com/q/28334860
tags question: http://stackoverflow.com/q/28393045
tags question: http://stackoverflow.com/q/28400773
tags question: http://stackoverflow.com/q/28280415
tags question: http://stackoverflow.com/q/28336651
tags question: http://stackoverflow.com/q/28319654
tags question: http://stackoverflow.com/q/28413948
tags question: http://stackoverflow.com/q/28401595
tags question: http://stackoverflow.com/q/28395143
tags question: http://stackoverflow.com/q/28367734
tags question: http://stackoverflow.com/q/28414653
tags question: http://stackoverflow.com/q/28365837
tags question: http://stackoverflow.com/q/28390200
type: Tag
tags question: http://stackoverflow.com/q/28341272
tags question: http://stackoverflow.com/q/28313544
tags question: http://stackoverflow.com/q/28283786
tags question: http://stackoverflow.com/q/28307731
tags question: http://stackoverflow.com/q/28387256
tags question: http://stackoverflow.com/q/28430659
tag name: datatables
tags question: http://stackoverflow.com/q/28375935

http://stackoverflow.com/comment/45165279
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28415848
has text: Yes, I am editing page that I did not create. Is there any other way to create clickable IP address?
type: AnswerComment

http://stackoverflow.com/comment/45148501
type: QuestionComment
has text: @Mars None of my comments qualifies as an answer from my perspective. Probably OP should self-answer this.
score: 0
comment on: http://stackoverflow.com/q/28398997
type: Comment

jquery
tags question: http://stackoverflow.com/q/28334025
tags question: http://stackoverflow.com/q/28429021
tags question: http://stackoverflow.com/q/28427605
tags question: http://stackoverflow.com/q/28309604
tags question: http://stackoverflow.com/q/28347505
tags question: http://stackoverflow.com/q/28299792
tags question: http://stackoverflow.com/q/28339530
tags question: http://stackoverflow.com/q/28353165
tags question: http://stackoverflow.com/q/28325172
tags question: http://stackoverflow.com/q/28400708
tags question: http://stackoverflow.com/q/28336266
tags question: http://stackoverflow.com/q/28356663
tags question: http://stackoverflow.com/q/28403574
tags question: http://stackoverflow.com/q/28352169
tags question: http://stackoverflow.com/q/28329837
tags question: http://stackoverflow.com/q/28413772
tags question: http://stackoverflow.com/q/28389259
tags question: http://stackoverflow.com/q/28282691
tags question: http://stackoverflow.com/q/28287637
tags question: http://stackoverflow.com/q/28283506
tags question: http://stackoverflow.com/q/28435262
tags question: http://stackoverflow.com/q/28430287
tags question: http://stackoverflow.com/q/28419754
tags question: http://stackoverflow.com/q/28338381
tags question: http://stackoverflow.com/q/28299593
tags question: http://stackoverflow.com/q/28281750
tags question: http://stackoverflow.com/q/28308827
tags question: http://stackoverflow.com/q/28388068
tags question: http://stackoverflow.com/q/28346402
tags question: http://stackoverflow.com/q/28394621
tags question: http://stackoverflow.com/q/28313639
tags question: http://stackoverflow.com/q/28293817
tags question: http://stackoverflow.com/q/28280713
tags question: http://stackoverflow.com/q/28339805
tags question: http://stackoverflow.com/q/28303620
tags question: http://stackoverflow.com/q/28338080
tags question: http://stackoverflow.com/q/28290510
tags question: http://stackoverflow.com/q/28328401
tags question: http://stackoverflow.com/q/28291731
tags question: http://stackoverflow.com/q/28391612
tags question: http://stackoverflow.com/q/28406046
tags question: http://stackoverflow.com/q/28374002
tags question: http://stackoverflow.com/q/28413126
tags question: http://stackoverflow.com/q/28331327
tags question: http://stackoverflow.com/q/28426939
tags question: http://stackoverflow.com/q/28288367
tags question: http://stackoverflow.com/q/28326418
tags question: http://stackoverflow.com/q/28405488
tags question: http://stackoverflow.com/q/28415769
tags question: http://stackoverflow.com/q/28296321
tags question: http://stackoverflow.com/q/28282794
tags question: http://stackoverflow.com/q/28306446
tags question: http://stackoverflow.com/q/28288707
tags question: http://stackoverflow.com/q/28305990
tags question: http://stackoverflow.com/q/28374591
tags question: http://stackoverflow.com/q/28430468
tags question: http://stackoverflow.com/q/28315815
tags question: http://stackoverflow.com/q/28330320
tags question: http://stackoverflow.com/q/28405377
tags question: http://stackoverflow.com/q/28392585
tags question: http://stackoverflow.com/q/28324015
tags question: http://stackoverflow.com/q/28295741
tags question: http://stackoverflow.com/q/28435439
tags question: http://stackoverflow.com/q/28436614
tags question: http://stackoverflow.com/q/28347220
tags question: http://stackoverflow.com/q/28413790
tags question: http://stackoverflow.com/q/28368039
tags question: http://stackoverflow.com/q/28334453
tags question: http://stackoverflow.com/q/28331212
tags question: http://stackoverflow.com/q/28298725
tags question: http://stackoverflow.com/q/28287326
tags question: http://stackoverflow.com/q/28361371
tags question: http://stackoverflow.com/q/28436807
tags question: http://stackoverflow.com/q/28295883
tags question: http://stackoverflow.com/q/28414764
tags question: http://stackoverflow.com/q/28313443
tags question: http://stackoverflow.com/q/28324292
tags question: http://stackoverflow.com/q/28417945
tags question: http://stackoverflow.com/q/28333530
tags question: http://stackoverflow.com/q/28399231

http://stackoverflow.com/q/28412590
favorite count: 0
has answer: http://stackoverflow.com/a/28413368
has comment: http://stackoverflow.com/comment/45158926
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45158558
downvote count: 1
has comment: http://stackoverflow.com/comment/45159056
has comment: http://stackoverflow.com/comment/45159522
has body: I'm creating a script where I have the images change when they are selected, however, I would like to be able to have these image options reset to the original image after a specific time interval. Code is underneath. I have the function set up with the setTimer but I feel like I am missing a line. "
score: -1
type: Question
has comment: http://stackoverflow.com/comment/45158967
has comment: http://stackoverflow.com/comment/45158527
upvote count: 0
answer count: 1
tagged with: javascript
has title: Resetting Images using setTimer (onclick)
has comment: http://stackoverflow.com/comment/45158748
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28328319
tagged with: ajax
has title: Get array values by return from a Javascript function containing ajax call
linked to: http://stackoverflow.com/q/14220321
answer count: 0
has comment: http://stackoverflow.com/comment/45004298
score: 0
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/14220321
has comment: http://stackoverflow.com/comment/45004280
has comment: http://stackoverflow.com/comment/45004611
type: Question
has body: I'm trying to read product_info array returned from function getproductInfo containing a ajax call but I still getting undefined value on console.log. Also, I'm using a callback function but still doesn't work. Where am I wrong? $(document).ready(function() { function successCallback(data) { var name = data.name; var image = data.image; var link = data.link; var product_info = [name, image, link]; console.log(product_info); // Correct: show my product_info array return product_info; } function getProductInfo(prodId, successCallback) { $.ajax({ type: "POST", url: "getProductInfo.php", data: "id=" + prodId, dataType: "json", success: function(data) { var p_info = successCallback(data); console.log(p_info); // Correct: show my product_info array return p_info; }, error: function() { alert("Error getProductInfo()..."); } }); return p_info; // Wrong: show "undefined" value } var p_info = getProductInfo(12, successCallback); console.log(p_info); // Wrong: show empty value });
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/45040538
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28348125
has text: Here's an example http://jsfiddle.net/yqwjqx31/

http://stackoverflow.com/a/28592013
type: Answer
answers question: http://stackoverflow.com/q/28386975
score: 0
has body: The browser is handling this just fine. If you change the speed to 3 temporarily you can see that the animation speed is getting slower as the dots settle towards their final destination finally coming to a stop, before starting the next animation. TweenMax.to(elm, 3, { bezier:{ curviness:3, values:[ {left:RN(w), top:RN(h)}, {left:RN(w), top:RN(h)} ] } You should try playing around with various settings to get the dots to have a more even speed throughout the animation.

http://stackoverflow.com/comment/74655520
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28317228
has text: @Brandon can u pls tell me that how can I initialize the value then ? And I don't need initial value
type: Comment

http://stackoverflow.com/a/28377759
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45095933
has comment: http://stackoverflow.com/comment/45095894
type: Answer
accepted answer of: http://stackoverflow.com/q/28377723
score: 2
answers question: http://stackoverflow.com/q/28377723
has comment: http://stackoverflow.com/comment/45095864
upvote count: 2
has body: You need a client side javascript manipulator.. they are known as User Scripts... For firefox, you want something like grease monkey.... its worth a google... This is not the simplest method, but most effective. Otherwise you will just want a ad-remover addon for firefox. Example For Chrome: https://chrome.google.com/webstore/detail/adblock/gighmmpiobklfepjocnamgkkbiglidom?hl=en They simply search for common code that are used to display adverts (like adsense) and will remove the code from the webpage anytime you view/load a page. The GreaseMonkey/UserScripts path would be more if you want to customize how your browser interacts with web sites.. For example, you could say for every image on a webpage to be hidden/removed and so on.. As for monitoring, throttling.. Well, you can monitor.. but to throttle.. well that would require a application/proxy that goes between your browser and net connection. There was one i used years ago that would allow me to simulate a 56k modem speed while developing web pages. Monitors: https://addons.mozilla.org/en-us/firefox/collections/smayer97/for-managing-bandwidth-usage/ Throttle/Limiter: http://www.netlimiter.com/

http://stackoverflow.com/q/28403502
tagged with: angularjs
upvote count: 1
has answer: http://stackoverflow.com/a/28403576
favorite count: 0
downvote count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45142162
score: 1
has title: Angular unknown provider and Cannot POST /signup
type: Question
has body: Before you say anything, I know the solution probably is to inject the dependency but I checked other open source codes and compare it with mine, it is exactly the same. While theirs work while mine's not working Currently the problem is at route '/signup' I got Error: error:unpr Unknown Provider when I check the console at route '/signup' and Whenever I go to '/signup' route and press submit button it supposed to hit the api and redirect to '/' but what I got instead is Cannot POST /signup. The api works just fine when I used POSTMAN, I assume the problem is with angular. index.html ( Does the order of the script is important? ) app.js angular.module('MyApp', ['ngRoute']) .config(function($routeProvider, $locationProvider) { $routeProvider .when('/', { templateUrl: 'app/views/home.html', controller: 'HomeController' }) .when('/signup', { templateUrl: 'app/views/signup.html', controller: 'SignUpController' }); $locationProvider.html5Mode(true); }) userController.js angular.module('MyApp') .controller('SignUpController', function($scope, User) { // sign up the user $scope.signup = function() { User.create({ name: $scope.name, username: $scope.username, password: $scope.password }); } }); factories.js angular.module('MyApp') .factory('User', function($http, $alert, $window, $location) { var userFactory = {}; userFactory.create = function(userData) { return $http.post('/api/signup', userData) .then(function(data) { $window.localStorage.setItem('token', response.data.token); $location.path('/'); }); } return userFactory; }); signup.html New to Project626? Sign up! Sign up for Project626 I like this way of writing angular because its way cleaner for me. For your information the open source that I mention above is https://github.com/sahat/tvshow-tracker/blob/master/public/controllers/signup.js
answer count: 1
tagged with: mean-stack
tagged with: javascript
has comment: http://stackoverflow.com/comment/45142197

http://stackoverflow.com/q/28353170
tagged with: asp.net
favorite count: 0
answer count: 5
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28353236
upvote count: 1
downvote count: 1
has title: adding all js files in one file
has answer: http://stackoverflow.com/a/28353257
type: Question
has body: I have many js files that I reference in the head tag of my webpages. is there a way to put them all in one file (js or aspx) and reference that one file instead of referencing all the files? something instead of the below. given that I can't combine all js files in one file as every file has its own purpose
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28354685
has answer: http://stackoverflow.com/a/28353346
has answer: http://stackoverflow.com/a/28354283

http://stackoverflow.com/q/28432350
tagged with: touch
accepted answer: http://stackoverflow.com/a/28432825
answer count: 3
has body: I would like to get the touchstart and touchend locations if element "#menu" is touched. I wrote this code, but the event doesn't seem to trigger at all: var lastLoc = 0; $(document).on('touchstart', '#menu', function(e) { lastLoc = e.originalEvent.touches[0].pageX; }); $(document).on('touchend', '#menu', function(e) { var newLoc = e.originalEvent.touches[0].pageX; alert("lastLoc = "+lastLoc+", newLoc = "+newLoc); }); As far as I know this should work. Thanks in advance.
downvote count: 0
possible better answer: http://stackoverflow.com/a/28432874
score: 1
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28432825
upvote count: 1
linked to: http://stackoverflow.com/q/10406783
type: Question
has answer: http://stackoverflow.com/a/28432937
has title: Javascript - touchstart and touchend locations
tagged with: javascript
has answer: http://stackoverflow.com/a/28432874

recursion
type: Tag
tag name: recursion
tags question: http://stackoverflow.com/q/28329491
tags question: http://stackoverflow.com/q/28330912
tags question: http://stackoverflow.com/q/28349548
tags question: http://stackoverflow.com/q/28412319
tags question: http://stackoverflow.com/q/28416108
tags question: http://stackoverflow.com/q/28354365
tags question: http://stackoverflow.com/q/28353015
tags question: http://stackoverflow.com/q/28382553

http://stackoverflow.com/q/28291374
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has body: I have div with 300px as width, inside the div I have placed 5 labels. The Labels width is greater than the div width, so I have set the "overflow" of the div to "hidden", which hides the labels that exceeds the div width. Using a dropdown, I have changed the "overflow" to "auto" which allow me to scroll and view the remaining labels. After I scrolled to the end for viewing the remaining labels, I have changed the overflow of div to "hidden". Now the last labels are showing and the labels from the first are hidden. I want to show the labels series0 and series1 as before after I changed the overflow from "auto" to "hidden". Is it possible?
has title: Overflow hidden changes the content location
tagged with: css
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/28291594
has comment: http://stackoverflow.com/comment/44936155
type: Question
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/q/28337912
upvote count: 1
accepted answer: http://stackoverflow.com/a/28340296
type: Question
tagged with: charts
tagged with: javascript
has body: I have requirement of bubble chart as follow:- Bubble Chart having the motion bubble. Bubble leaves the trails in fade color. Bubble motion control with navigation button in the bottom of the chart When bubble navigate to any position that should appear in dark color. Scenario: Y-axis having population in lakh and X-axis have months. Once the chart initialize the bubble move from left to right according to input figure (i.e.. Population, month). As show in the figure chart have navigation button from where bubble can be navigate to other faded bubbles. Selected bubble through navigation will always highlighted in dark colour. In our case, as shown in figure Oct month bubble is a selected with dark highlighted colour where others are faded Any help will be highly appreciated. Thanks
tagged with: highcharts
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28340296
tagged with: kendo-ui
type: AnsweredQuestion
has title: Motion Bubble Chart
score: 1

http://stackoverflow.com/q/28340237
tagged with: conventions
has answer: http://stackoverflow.com/a/28340402
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28340402
has body: I've inherited a backbone.js project. The convention on the project seems to be to put each model, view and controller in its own file. When I look at this tutorial, (hello backbone.js), they use the convention of having controllers and views all in the one file. Now my feeling with JavaScript is that it will just execute whatever is in front of the reader and evaluator, no matter where it is. My question is: Does my backbone.js project require component on a file or is that just a convention?
tagged with: file
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45026068
answer count: 1
tagged with: backbone.js
has title: Does my backbone.js project require component on a file or is that just a convention?

http://stackoverflow.com/a/28433254
score: 1
upvote count: 1
has body: It makes semantic sense and judging from the fastclick docs, it doesn't look harmful. Include fastclick.js in your JavaScript bundle or add it to your HTML page... They are saying that it's safe to include it as a concatenated file or as a standalone. You are free to include the FastClick source code however you see fit. Really their documentation over complicates the initialization of FastClick. The document.documentElement property is available the moment JavaScript begins execution, and represents the &lt;html&gt; element. This could be used as the root element for FastClick, negating the need for a DOMContentLoaded or domready event handler: new FastClick(document.documentElement); No event handlers needed. Now you can respond to clicks as the page is loading if you want, and before the full HTML document has been parsed. Edit: @jungy brings up a good point in his comment: ... you are waiting till the DOM is ready before downloading the library. The complete code example: jQuery.getScript("lib/fastclick.js", function() { new FastClick(document.documentElement); });
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28433123
accepted answer of: http://stackoverflow.com/q/28433123

http://stackoverflow.com/comment/45103009
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28382047
has text: May be the binding comes too early? Did you try to use events for infowindow? Like domready: http://stackoverflow.com/questions/11350234/google-maps-infowindow-events-on-open Into the callback of DomReady-Listener you could put your binding.

http://stackoverflow.com/q/28344390
has body: i am having a loop of textarea which has diferent values and a corresponding button to each textarea. What i need to do is, if i click a button the value in the respective textarea should be alerted using javascript. Here is the code what i tried: <?php $a=0; $b=100; while($a<5) { echo " ".$b." "; echo " click "; $a++; $b++; } ?> But it shows same value (first textarea value) on alert to all button click. So i changed the id of textarea to dynamic id as echo " ".$b." "; echo " click "; But it is not working. It haven't even give any alert message. How can i achieve this? Is there any other ways? Suggest me..
score: 0
accepted answer: http://stackoverflow.com/a/28344432
type: Question
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: pass the dynamic textarea value on button click to javascript-php
has answer: http://stackoverflow.com/a/28344432
tagged with: php
linked to: http://stackoverflow.com/q/3434278
type: AnsweredQuestion

http://stackoverflow.com/q/28288040
has comment: http://stackoverflow.com/comment/44931089
has comment: http://stackoverflow.com/comment/44930293
has answer: http://stackoverflow.com/a/28288693
has body: I'm trying to achieve the result: Get tweets made by user which emails starts with 'a'. var Tweet = mongoose.model('Tweets', new mongoose.Schema({ user_id : String, text : String, date : { type: Date, default: Date.now } }) ); var User = mongoose.model('Users', new mongoose.Schema({ name : String, email : String, date : { type: Date, default: Date.now } }) ); The queries look like: app.get('/mongodb/tweets/users/get', function(req, res, next) { var time = process.hrtime(); User.find({email : /^a/}, { _id:1 }, function(err, users) { var dataArr = []; for(o in users) { dataArr.push(users[o]._id); } Tweet.find({user_id : { $in : dataArr }}, function(err, tweets) { var diff = process.hrtime(time); res.send({ seconds : diff[0], nanoseconds : diff[1], result: tweets.length}); }); }); }); I'm aware that I'm doing something wrong because the performance of those queries are kind of bad in comparison to the normal MySQL query. Tweets : {"seconds":0,"nanoseconds":904058152,"result":4396} Tweets (MySQL) : {"seconds":0,"nanoseconds":455872373,"result":4368} I've also tried to use the populate() method but this occurred in even further lost in performance. Any suggestions how to handle that in order to make it work faster? I'm looking for clean code that won't require me to do workaround (object to array conversion). What would be the solution to this kind of problem with some elegant and most correct approach? @kevin Thanks for the index tip, it helped with performance a lot and made it: {"seconds":0,"nanoseconds":412133579,"result":4396}
tagged with: mongodb
has comment: http://stackoverflow.com/comment/44930869
has title: Getting collection depending on the second collection condition. in MongoDB
has comment: http://stackoverflow.com/comment/44930019
answer count: 1
has comment: http://stackoverflow.com/comment/44930152
tagged with: mongoose
tagged with: javascript
score: 0
type: UnansweredQuestion
type: Question

http://stackoverflow.com/comment/45157861
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28412191
has text: can you use angular js??
score: 0

http://stackoverflow.com/comment/44964606
comment on: http://stackoverflow.com/q/28306803
type: QuestionComment
type: Comment
score: 0
has text: No response code at all?

http://stackoverflow.com/a/28297556
has body: Use this method for easy undertsanding and parsing : npm install --save excel' var xls = require('excel'); xls('Sheet.xlsx', function(err, data) { if(err) throw err; // data is an array of arrays }); As it says, the data it returns is an array of arrays. We want it to be JSON, so that we can do whatever we want with it. This is a function that converts an array of arrays to JSON: function convertToJSON(array) { var first = array[0].join() var headers = first.split(','); var jsonData = []; for ( var i = 1, length = array.length; i &lt; length; i++ ) { var myRow = array[i].join(); var row = myRow.split(','); var data = {}; for ( var x = 0; x &lt; row.length; x++ ) { data[headers[x]] = row[x]; } jsonData.push(data); } return jsonData; }; Then: xlsx('tasks.xlsx', function(err,data) { if(err) throw err; //console.log(jsonDataArray(data)); console.log(JSON.stringify(convertToJSON(data))); //console.log(data); });
upvote count: 12
score: 11
has comment: http://stackoverflow.com/comment/46749294
type: Answer
answers question: http://stackoverflow.com/q/28286319
has comment: http://stackoverflow.com/comment/65182724
downvote count: 1

http://stackoverflow.com/comment/45116141
type: AnswerComment
comment on: http://stackoverflow.com/a/28330333
has text: Not a problem, just change the position `var t = ['100','0px','80px']; var left = ['','15px','0px'];` top is labeled t because top conflicts with JavaScript reserved word. I just wanted to show that it is flexible and when they are not on top one another you can see what's happening. You position them where ever based on the values set in the t and left arrays.
type: Comment
score: 0

http://stackoverflow.com/a/28414365
answers question: http://stackoverflow.com/q/28414318
type: Answer
has body: A promise doesn't expose the interface that allows to resolve it. You can only await the result and do operations on it. A deferred is more than a promise - it also allows you to resolve or reject it.
score: 3
upvote count: 3
downvote count: 0

http://stackoverflow.com/q/28350619
tagged with: angularjs-ng-route
has answer: http://stackoverflow.com/a/28351009
type: Question
tagged with: configuration
tagged with: javascript
has body: I'm trying to build a shell manually trying to figure out how it works Structure: - application(php stuff) - webroot -- app --- app.js -- templates --- main ---- login ----- login.html index.html (with angularjs libs) app.js: function config($routeProvider){ $routeProvider .when("/login",{ templateUrl: "../templates/main/login/login.html" }) .otherwise({ redirectTo:"/other" }); } angular .module("app", ["ngRoute", "ngResource"]) .config(config); login: LOGIN test template "/other" doesn't exit. Besides I tried different pathes as: templateUrl: "templates/main/login/login.html" templateUrl: "webroot/templates/main/login/login.html" By the way the url comes with an "#" (eg. nameDomain.com/#/login, but it should be nameDomain.com/#login) but angularjs seems allow only /nameUrlTemplate
score: 0
answer count: 1
tagged with: angularjs
type: UnansweredQuestion
has title: How can I make $routeProvider to work properly in angularjs

http://stackoverflow.com/a/28421673
score: 6
type: AcceptedAnswer
upvote count: 6
accepted answer of: http://stackoverflow.com/q/28421598
answers question: http://stackoverflow.com/q/28421598
type: Answer
has body: It's cause of you're using keypress which consists of 2 events keydown and keyup, so your function launches on the first one - keydown, so you get your values, as you said "one step behind", cause when the keydown event is fired your input field didn't recieve the pressed key value yet. Use keyup and you will get your result: $('#amount').keyup(function() { var total = $('#amount').val() - $('#fee').val(); if(typeof total != 'undefined') $('#total').val(total) }); Fiddle
downvote count: 0

http://stackoverflow.com/comment/45050751
comment on: http://stackoverflow.com/q/28353352
has text: http://stackoverflow.com/questions/5278262/click-the-poster-image-the-html5-video-plays - look at the comment on the answer - and i can verify it on windows too
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28362833
has comment: http://stackoverflow.com/comment/45138001
has body: In a typical app you would have a high-level controller-view component mounted to the DOM this way, but that component would contain a hierarchy of child components in its render method to build up the structure of your interface. This is the idea of composable views which is an advantage of react. These child components can be used directly within the jsx of the parents' render methods in the same way you had hoped, so you really only have to call React.render once on the top-level component.
has comment: http://stackoverflow.com/comment/45167306
score: 0
answers question: http://stackoverflow.com/q/28362456
has comment: http://stackoverflow.com/comment/45147489
type: Answer

http://stackoverflow.com/q/28389477
favorite count: 0
has comment: http://stackoverflow.com/comment/45116543
upvote count: 1
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28389609
has answer: http://stackoverflow.com/a/28389666
has comment: http://stackoverflow.com/comment/45116480
has title: jQuery animation out of sync
has answer: http://stackoverflow.com/a/28389609
type: Question
has comment: http://stackoverflow.com/comment/45116483
answer count: 2
tagged with: jquery-animate
has comment: http://stackoverflow.com/comment/45116498
has comment: http://stackoverflow.com/comment/45116510
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: Very shortly after my animation starts, it goes out of sync. The divs are supposed to fade in and fade out after one another. Please take a look at my code below... Thanks (document).ready(function(){ animate_loop = function animate_loop(){ $( "#w01" ).animate({ opacity: 0.4, }, 1000, function(){ $( "#w01").animate({ opacity: 1}, 600) animate_loop(); } ); } animate_loop(); animate_loop = function animate_loop(){ $( "#w02" ).animate({ opacity: 0.4, }, 1500, function(){ $( "#w02").animate({ opacity: 1}, 600) animate_loop(); } ); } animate_loop(); animate_loop = function animate_loop(){ $( "#w03" ).animate({ opacity: 0.4, }, 2000, function(){ $( "#w03").animate({ opacity: 1}, 600) animate_loop(); } ); } animate_loop(); animate_loop = function animate_loop(){ $( "#w04" ).animate({ opacity: 0.4, }, 2500, function(){ $( "#w04").animate({ opacity: 1}, 600) animate_loop(); } ); } animate_loop(); });
accepted answer: http://stackoverflow.com/a/28389666
score: 1

http://stackoverflow.com/comment/45001819
type: AnswerComment
comment on: http://stackoverflow.com/a/28327134
has text: of course, but that would not be the most efficient way to achieve that.
type: Comment
score: 0

http://stackoverflow.com/comment/44945412
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28296560
has text: possible duplicate of [What is the difference between a function expression vs declaration in Javascript?](http://stackoverflow.com/questions/1013385/what-is-the-difference-between-a-function-expression-vs-declaration-in-javascrip)

arrays
tags question: http://stackoverflow.com/q/28427925
tags question: http://stackoverflow.com/q/28405619
tags question: http://stackoverflow.com/q/28331109
tags question: http://stackoverflow.com/q/28343457
tags question: http://stackoverflow.com/q/28428065
tags question: http://stackoverflow.com/q/28419183
tags question: http://stackoverflow.com/q/28391564
tags question: http://stackoverflow.com/q/28357971
tags question: http://stackoverflow.com/q/28414398
type: Tag
tags question: http://stackoverflow.com/q/28355043
tags question: http://stackoverflow.com/q/28332778
tags question: http://stackoverflow.com/q/28347669
tags question: http://stackoverflow.com/q/28320979
tags question: http://stackoverflow.com/q/28304934
tags question: http://stackoverflow.com/q/28375959
tags question: http://stackoverflow.com/q/28325699
tags question: http://stackoverflow.com/q/28405677
tags question: http://stackoverflow.com/q/28378932
tags question: http://stackoverflow.com/q/28384459
tags question: http://stackoverflow.com/q/28392475
tags question: http://stackoverflow.com/q/28331097
tags question: http://stackoverflow.com/q/28296892
tags question: http://stackoverflow.com/q/28415206
tags question: http://stackoverflow.com/q/28374694
tags question: http://stackoverflow.com/q/28426210
tags question: http://stackoverflow.com/q/28312382
tags question: http://stackoverflow.com/q/28398429
tags question: http://stackoverflow.com/q/28348167
tags question: http://stackoverflow.com/q/28349077
tags question: http://stackoverflow.com/q/28337641
tags question: http://stackoverflow.com/q/28332783
tags question: http://stackoverflow.com/q/28371261
tags question: http://stackoverflow.com/q/28285900
tags question: http://stackoverflow.com/q/28292125
tags question: http://stackoverflow.com/q/28354117
tags question: http://stackoverflow.com/q/28388690
tags question: http://stackoverflow.com/q/28290657
tags question: http://stackoverflow.com/q/28328606
tags question: http://stackoverflow.com/q/28319656
tags question: http://stackoverflow.com/q/28373430
tags question: http://stackoverflow.com/q/28315162
tags question: http://stackoverflow.com/q/28387770
tags question: http://stackoverflow.com/q/28406967
tags question: http://stackoverflow.com/q/28434778
tags question: http://stackoverflow.com/q/28329491
tags question: http://stackoverflow.com/q/28353074
tags question: http://stackoverflow.com/q/28361572
tags question: http://stackoverflow.com/q/28283304
tags question: http://stackoverflow.com/q/28333537
tags question: http://stackoverflow.com/q/28400207
tags question: http://stackoverflow.com/q/28377374
tags question: http://stackoverflow.com/q/28389746
tags question: http://stackoverflow.com/q/28338832
tags question: http://stackoverflow.com/q/28330237
tags question: http://stackoverflow.com/q/28332152
tags question: http://stackoverflow.com/q/28421313
tags question: http://stackoverflow.com/q/28379774
tags question: http://stackoverflow.com/q/28316151
tags question: http://stackoverflow.com/q/28283769
tags question: http://stackoverflow.com/q/28320438
tags question: http://stackoverflow.com/q/28401119
tags question: http://stackoverflow.com/q/28430849
tags question: http://stackoverflow.com/q/28334868
tags question: http://stackoverflow.com/q/28400400
tags question: http://stackoverflow.com/q/28301299
tags question: http://stackoverflow.com/q/28371865
tags question: http://stackoverflow.com/q/28300967
tags question: http://stackoverflow.com/q/28381835
tags question: http://stackoverflow.com/q/28373567
tags question: http://stackoverflow.com/q/28282135
tags question: http://stackoverflow.com/q/28403805
tags question: http://stackoverflow.com/q/28338537
tags question: http://stackoverflow.com/q/28397983
tags question: http://stackoverflow.com/q/28301428
tags question: http://stackoverflow.com/q/28404200
tags question: http://stackoverflow.com/q/28289027
tags question: http://stackoverflow.com/q/28340084
tags question: http://stackoverflow.com/q/28292620
tags question: http://stackoverflow.com/q/28375173

http://stackoverflow.com/q/28352069
has answer: http://stackoverflow.com/a/28353071
type: Question
tagged with: http://stackoverflow.com/tag/html
has body: I want to know if there is a one line approach without loops for reading the value of radio input in HTML5. In the old HTML: &lt;form&gt; &lt;input type="radio" name="sex" value="male" checked&gt;Male &lt;br&gt; &lt;input type="radio" name="sex" value="female"&gt;Female &lt;/form&gt; The javascript is like: var sexes = document.getElementsByName('sex'); var sex_value; for(var i = 0; i &lt; sexes.length; i++){ if(sexes[i].checked){ sex_value = sexes[i].value; } } But the same can be done with Jquery in one line like $('input[name="sex"]:checked').val(); So I just want to know: Is a better way of doing it in HTML5 without Jquery? Is there any other JS library like Jquery that can do the same one-line approach or better?
has comment: http://stackoverflow.com/comment/45048143
score: -1
downvote count: 2
answer count: 3
upvote count: 1
has comment: http://stackoverflow.com/comment/45048085
accepted answer: http://stackoverflow.com/a/28353071
has answer: http://stackoverflow.com/a/28352842
has comment: http://stackoverflow.com/comment/45048342
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28352309
tagged with: javascript
tagged with: jquery
has title: Reading HTML5 input radio tag with javascript
favorite count: 0
possible better answer: http://stackoverflow.com/a/28352309

http://stackoverflow.com/q/28360991
has comment: http://stackoverflow.com/comment/45064503
type: Question
has answer: http://stackoverflow.com/a/28362015
has comment: http://stackoverflow.com/comment/45064549
accepted answer: http://stackoverflow.com/a/28362047
has comment: http://stackoverflow.com/comment/45065933
upvote count: 5
has comment: http://stackoverflow.com/comment/45064405
has comment: http://stackoverflow.com/comment/45064545
has comment: http://stackoverflow.com/comment/45064655
answer count: 3
has comment: http://stackoverflow.com/comment/45064419
has comment: http://stackoverflow.com/comment/45065794
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/45065992
has comment: http://stackoverflow.com/comment/45065805
has comment: http://stackoverflow.com/comment/45064367
has comment: http://stackoverflow.com/comment/45064809
has answer: http://stackoverflow.com/a/28362047
has comment: http://stackoverflow.com/comment/45064570
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45064393
has comment: http://stackoverflow.com/comment/45064470
has body: I am calling an API from AJAX, When I am Calling AJAX like this, $(function (){ $.ajax({ type:'GET', url :"/tournament", dataType: 'json', success: function(data) { console.log('success',data); }, error:function(exception){ alert('Exception:'+exception); } }); }); This is working fine without any errors but when I am using this.. $('#btnadad').on('click',function (){ alert("ok"); $.ajax({ type:'GET', dataType: 'json', url :"/tournament", success: function(data) { console.log('success',data); }, error:function(exception){ alert('Exception:'+exception); } }); }); This popups "error" alert, can anybody help me whats the error? HTML Body is Like this, <?PHP //print_r($teams); for ($i = 0; $i < $count; $i++) { ?> <input type="checkbox" name=<?php echo $taemId[$i] ?> <?php echo $teamname[$i] ?> <?php } ?> ADD here I am calling one API and Displaying the Checkboxes Dynamically. I am checking The Console...when I am clicking button ,the alert box is popping up and in networks tab tournament path's status is cancelled .when I am clicking it on to see the response it shows fail to load response data. I have Tried calling this function in same html file in tag but it is also not working. function getOnClick() { alert("ok"); $.ajax({ type: 'GET', url: "http://harshal:8888/tournament", success: function(data) { alert("no error in alert"); console.log('success', data); }, error: function() { alert("error in alert"); } }); } and calling it on button's onclick Event ut it also gives me the same result
has answer: http://stackoverflow.com/a/58246901
downvote count: 3
has title: Calling AJAX is not working onclick of button
possible better answer: http://stackoverflow.com/a/28362015

http://stackoverflow.com/comment/45153896
type: Comment
comment on: http://stackoverflow.com/a/28410210
has text: Thank you! I will be accepting your answer as soon as it lets me. May I ask why it needs to be `.text` instead of `.name`?
score: 0
type: AnswerComment

http://stackoverflow.com/q/28336626
accepted answer: http://stackoverflow.com/a/28346010
has comment: http://stackoverflow.com/comment/45024227
score: 0
has title: I've just compiled some dojo files together: How do I call a function inside the anonymous wrapper?
answer count: 1
has comment: http://stackoverflow.com/comment/45021023
has comment: http://stackoverflow.com/comment/45035199
tagged with: dojo-build
tagged with: dojo
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45024023
type: Question
has comment: http://stackoverflow.com/comment/45033082
tagged with: javascript
has answer: http://stackoverflow.com/a/28346010
has body: I'm compiling some of my dojo stuff for the first time today. Just for simplicity while fighting this beast, I compiled everything I had (except dojo.js) into this one file called all.js. But in all.js, I have an entry point that's totally sealed in this anonymous function that I need to call, but it's not very obvious to me how to get at it. Here's the start of the file: require({cache:{ 'dojo/dom-geometry':function(){ define(["./sniff", "./_base/window","./dom", "./dom-style"], function(has, win, dom, style){ // module: // dojo/dom-geometry // the result object var geom = { // summary: // This module defines the core dojo DOM geometry API. }; //dom-geometry continues on for awhile.... and the part I'm interested in, on line 14798! How can I call CreateActivityEntryPoint? //end of previous part return singleton; }); }, 'app/Activity/Create':function(){ function CreateActivityEntryPoint() { //do things here. } Here's the part that comes after: }, //closing bracket of Activity/Create anon function 'dojo/dom-attr':function(){ define(["exports", "./sniff", "./_base/lang", "./dom", "./dom-style", "./dom-prop"], function(exports, has, lang, dom, style, prop){ // module: In my main page view, I just need to call the entry point. Previously it was simply on the window object, but not anymore! How do I call the Create.js file functions out of this "cache:" object? I've tried: require(["app/Activity/Create"], function (create) { create.CreateActivityEntryPoint(); }); but create is undefined, it seems.

http://stackoverflow.com/q/28400802
tagged with: scope
score: 0
answer count: 1
tagged with: angularjs
has title: How can i pass scope in template in angular js
has answer: http://stackoverflow.com/a/28402519
accepted answer: http://stackoverflow.com/a/28402519
type: AnsweredQuestion
has body: I have one BaseController with common functions which my all other controllers inherit . The controller is like this function BaseController () { this.defaultFilters = {}; this.doStuff = function ($scope) { $scope.myobj.value = 1; this.otherfunction(); }; I inherit that in my controller like this BaseController.call($scope); Now in my do stuff function i need to pass $scope because myobj is only visible there. Now i want to know that how can i pass that in my template because i want to call that function when some click on some button ng-click="doStuff(scope)"
type: Question
tagged with: javascript

http://stackoverflow.com/a/28324872
has body: JavaScript cannot close windows that were not opened via JavaScript. If websites could close people's browsers, a lot of people would be angry. Your non-malicious intent is unknown to the browser.
score: 0
answers question: http://stackoverflow.com/q/28324309
type: Answer

http://stackoverflow.com/q/28313856
has comment: http://stackoverflow.com/comment/44977858
tagged with: javascript
has answer: http://stackoverflow.com/a/28313893
has comment: http://stackoverflow.com/comment/44977804
answer count: 2
has title: Extract object from a modified string
has comment: http://stackoverflow.com/comment/44977618
has comment: http://stackoverflow.com/comment/44978046
has body: I am getting an object by name response, which has a property by name attribute_dim. On hovering on response.attribute_dim I see "{"Coupon Circle":"coupon_circle"}" in chrome developer tools.(see Image) On doing below JSON.parse(response.attributes_dim); I get Uncaught SyntaxError: Unexpected identifier What should I do in order to get the object out of it?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44977974
has comment: http://stackoverflow.com/comment/44977600
score: 0
has answer: http://stackoverflow.com/a/28313964
type: Question

http://stackoverflow.com/q/28366512
answer count: 0
has comment: http://stackoverflow.com/comment/45074433
has comment: http://stackoverflow.com/comment/45075399
has comment: http://stackoverflow.com/comment/45074646
type: Question
has body: I am trying to implement Remote Data Select2. I am accessing data from api. The format is as follows: concept_id,name 228,Pelecypoda 286,Pelecypoda When I try to console data in results, it doesn't get consoled. But if I replace the word results with success, I can see the data in console but not in the search results. Script $("#search_text").select2({ minimumInputLength: 3, ajax: { url: "http://192.241.245.176:4567/api1", dataType: 'text', type: "GET", quietMillis: 250, data: function (term) { console.log(term) return { q: term.term //search term } }, results: function (data,page) { console.log(data,"-----RESULTS-----"); return d3.csv.parse(data, function (d) { console.log(d); return {results: d.name} }); }, dropdownCssClass: "bigdrop" }); Can anyone please tell me where am I going wrong? Do I have to specify formatResults and formatSelection provided by select2?
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/1489373
downvote count: 0
favorite count: 0
tagged with: jquery-select2
has title: select2 not displaying search results
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45079095
has comment: http://stackoverflow.com/comment/45074062
has comment: http://stackoverflow.com/comment/45081822
score: 2

http://stackoverflow.com/q/28412001
tagged with: ember.js
linked to: http://stackoverflow.com/q/24727503
score: 8
accepted answer: http://stackoverflow.com/a/28416914
type: AnsweredQuestion
has body: I'm trying to figure out how to include an external javascript source (Exhibit), but only for a single page on the site. Can it be done in the view or template? I found that simply adding &lt;script src="exhibit.js"&gt;&lt;/script&gt; to the page template doesn't work. If I add it to the template for the entire site it loads just fine, however it loads on every page. The other side of my problem may be more specific to exhibit. Is there a way to have the script sourced every time the page is loaded? Example: When I first visit the page that contains the exhibit script, it loads the ember app including exhibit and the page is displayed properly. I navigate away from the page, when I return to the page the exhibit script is not reloaded, thus not redrawing the page properly as it did the first time it was visited.
has comment: http://stackoverflow.com/comment/45162081
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28416914
has title: Ember.js include external script on specific page
favorite count: 0
upvote count: 8

http://stackoverflow.com/q/28339217
downvote count: 0
linked to: http://stackoverflow.com/q/14392645
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/55020494
accepted answer: http://stackoverflow.com/a/36591458
tagged with: google-maps-api-3
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/36591458
tagged with: google-maps
answer count: 1
has body: I'm experiencing a big problem with googles maxZoomService.getMaxZoomAtLatLng, since it absolutely random decides to return error state, sometimes 10 times in a row, sometimes it works, but I can't figure out why the zoom sometimes just fails. I tried to solve it by retrying the request multiple times, but it seems like that if I get an error on the first request I'll get the error for all retries too. At the same time I'm facing an issue that got listed in another topic but this isn't my main problem, it just occurs too. Following my example code: setMap : function() { wirkonf.frontend.triggerLoadAnim(); wirkonf.storage.mapOptions = { zoom: 11, center: new google.maps.LatLng(wirkonf.storage.geoCoords.lat, wirkonf.storage.geoCoords.lng), mapTypeId: google.maps.MapTypeId.SATELLITE, disableDefaultUI: true }; wirkonf.storage.map = new google.maps.Map(document.getElementById('gmc'), wirkonf.storage.mapOptions); wirkonf.storage.map.setTilt(0); var maxZoomService = new google.maps.MaxZoomService(); maxZoomService.getMaxZoomAtLatLng(wirkonf.storage.mapOptions.center, function(response){ wirkonf.storage.mapZoomMax = response.zoom; var ret; if (response.zoom &gt; 20) { ret = 20; } else { ret = response.zoom; } wirkonf.storage.mapZoomCurr = ret; wirkonf.storage.map.setZoom(ret); } ); }, So my question is, has anyone else experienced this problem or maybe even knows a good workaround to solve it?
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45034775
has title: Constant error return on google maps maxZoomService.getMaxZoomAtLatLng()
score: 2

http://stackoverflow.com/comment/45150450
comment on: http://stackoverflow.com/a/28408237
score: 0
type: Comment
has text: because 'getCat' works with some scopes and functions from my controller )
type: AnswerComment

css
tags question: http://stackoverflow.com/q/28342402
tags question: http://stackoverflow.com/q/28371559
tags question: http://stackoverflow.com/q/28357682
tags question: http://stackoverflow.com/q/28396883
tags question: http://stackoverflow.com/q/28350748
tags question: http://stackoverflow.com/q/28288116
tags question: http://stackoverflow.com/q/28394602
tags question: http://stackoverflow.com/q/28287387
tags question: http://stackoverflow.com/q/28281216
tags question: http://stackoverflow.com/q/28329947
tags question: http://stackoverflow.com/q/28338326
tags question: http://stackoverflow.com/q/28422178
tags question: http://stackoverflow.com/q/28335350
tags question: http://stackoverflow.com/q/28365572
tags question: http://stackoverflow.com/q/28394949
tags question: http://stackoverflow.com/q/28310133
tags question: http://stackoverflow.com/q/28310102
tags question: http://stackoverflow.com/q/28321979
tags question: http://stackoverflow.com/q/28299934
tags question: http://stackoverflow.com/q/28355688
tags question: http://stackoverflow.com/q/28414459
tags question: http://stackoverflow.com/q/28335085
tags question: http://stackoverflow.com/q/28360838
tags question: http://stackoverflow.com/q/28288567
tags question: http://stackoverflow.com/q/28380976
tags question: http://stackoverflow.com/q/28403056
tags question: http://stackoverflow.com/q/28339628
tags question: http://stackoverflow.com/q/28287307
tags question: http://stackoverflow.com/q/28386369
tags question: http://stackoverflow.com/q/28364124
tags question: http://stackoverflow.com/q/28391458
tags question: http://stackoverflow.com/q/28336581
tags question: http://stackoverflow.com/q/28388057
tags question: http://stackoverflow.com/q/28317592
tags question: http://stackoverflow.com/q/28406445
tags question: http://stackoverflow.com/q/28398289
tags question: http://stackoverflow.com/q/28315011
tags question: http://stackoverflow.com/q/28284046
tags question: http://stackoverflow.com/q/28390046
tags question: http://stackoverflow.com/q/28425773
tags question: http://stackoverflow.com/q/28363869
tags question: http://stackoverflow.com/q/28287300
tags question: http://stackoverflow.com/q/28397135
tags question: http://stackoverflow.com/q/28382030
tags question: http://stackoverflow.com/q/28304747
tags question: http://stackoverflow.com/q/28416776
tags question: http://stackoverflow.com/q/28365359
tags question: http://stackoverflow.com/q/28361171
tags question: http://stackoverflow.com/q/28381709
tags question: http://stackoverflow.com/q/28319174
tags question: http://stackoverflow.com/q/28418611
tags question: http://stackoverflow.com/q/28429925
tags question: http://stackoverflow.com/q/28378736
tags question: http://stackoverflow.com/q/28396315
tags question: http://stackoverflow.com/q/28292009
tags question: http://stackoverflow.com/q/28297344
tags question: http://stackoverflow.com/q/28285510
tags question: http://stackoverflow.com/q/28343019
tags question: http://stackoverflow.com/q/28347477
tags question: http://stackoverflow.com/q/28387810
tags question: http://stackoverflow.com/q/28337014
tags question: http://stackoverflow.com/q/28343333
tags question: http://stackoverflow.com/q/28313310
tags question: http://stackoverflow.com/q/28319291
tags question: http://stackoverflow.com/q/28433589
tags question: http://stackoverflow.com/q/28335790
tags question: http://stackoverflow.com/q/28326943
tags question: http://stackoverflow.com/q/28316985
tags question: http://stackoverflow.com/q/28380195
tags question: http://stackoverflow.com/q/28405890
tags question: http://stackoverflow.com/q/28356348
tags question: http://stackoverflow.com/q/28352417
tags question: http://stackoverflow.com/q/28394962
tags question: http://stackoverflow.com/q/28322384
tags question: http://stackoverflow.com/q/28427853
tags question: http://stackoverflow.com/q/28396244
tags question: http://stackoverflow.com/q/28388524
tags question: http://stackoverflow.com/q/28378494
tags question: http://stackoverflow.com/q/28379344
tags question: http://stackoverflow.com/q/28283859

http://stackoverflow.com/a/28352536
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28348939
score: 4
has body: Your code is responding to child_added events: var myDataRead = new Firebase('https://myappURL/Addr_states'); myDataRead.on('child_added', function(snapshot) { A child_added event fires for every child that is added under the indicated node. So in your case: a child_added event is fired for every state. That also means that your callback function is invoked for every state. And you then overwrite whatever was in local storage with the information for that state: myDataStore (myDataGroup); So essentially your local storage will now contain whatever the last state was that came from Firebase. Given that you named your local storage States, it seems like you want to store all states in there. This can be most easily accomplished by listening for Firebase's value event: var myDataRead = new Firebase('https://myappURL/Addr_states'); myDataRead.on('value', function(snapshot) { myDataGroup = snapshot.val(); console.log(myDataGroup); myDataStore (myDataGroup); }); If you also want to loop over the individual states, you can use forEach: var myDataRead = new Firebase('https://myappURL/Addr_states'); myDataRead.on('value', function(allStates) { allStates.forEach(function(stateSnapshot) { console.log(stateSnapshot.val()); }); });
answers question: http://stackoverflow.com/q/28348939
upvote count: 4
type: AcceptedAnswer

http://stackoverflow.com/q/28281616
has comment: http://stackoverflow.com/comment/44917952
linked to: http://stackoverflow.com/q/23113833
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28282420
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/28282376
has comment: http://stackoverflow.com/comment/44917559
upvote count: 1
has body: I have written a navigation bar based on the example given in the components link in Bootstrap. But the navigation bar does not collapse in a right way as it is supposed to do. As shown in the process below: State 1 State 2 State 3 the navigation bar is not collapsed sharply, rather, it will become 2 columns first and then collapse. I have found a same problem that has been asked previously in stackoverflow. It seems like the problem is caused by the default breaking point defined in bootstrap. However, I do not know where to change the breaking point and how can I do it. I am using the latest bootstrap version, and following is the snippet of my navigation bar code. Thanks in advance for any help and advice! Logo HOME ABOUT WORK BLOG CONTACT My Account Settings Update Profile Sign Out <!end of the user account menu--> Update I have looked into the solution provide by this link, which does not work in the newest version of Bootstrap. And I have locate the code block which defines the breakpoint of the collapsing effect: @media (min-width: 768px) { .navbar-collapse { width: auto; border-top: 0; -webkit-box-shadow: none; box-shadow: none; } .navbar-collapse.collapse { display: block !important; height: auto !important; padding-bottom: 0; overflow: visible !important; visibility: visible !important; } .navbar-collapse.in { overflow-y: visible; } .navbar-fixed-top .navbar-collapse, .navbar-static-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse { padding-right: 0; padding-left: 0; } } And I tried to modify the defined min-width, however I changed, it just does not work.
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44917444
has answer: http://stackoverflow.com/a/28285436
favorite count: 0
has title: Bootstrap navigation bar collapsing issue
tagged with: twitter-bootstrap
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28282668
linked to: http://stackoverflow.com/q/19827605
tagged with: css
answer count: 4

http://stackoverflow.com/a/28345861
downvote count: 0
type: Answer
has body: function rdRelatedJobs(param1,param2,param3) { var completeURL = param1 + param2 + param3; // return an ajax promise from this function return $.ajax({ type: "GET", url:completeURL, dataType: "xml", success: function (xml) { // We parse the XML here }, error: function () { console.log("An error occurred while processing XML file."); } }); } // compile the promises by passing them into an array function getPromises() { var promises = []; promises.push(rdRelatedJobs(1, 2, 3)); promises.push(rdRelatedJobs(3, 4, 5)); return promises; } // use $.when by passing in the promise array using the apply method $.when.apply(null, getPromises()).then(function () { // do a thing });
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28345693

http://stackoverflow.com/a/28330578
upvote count: 1
has comment: http://stackoverflow.com/comment/45008732
score: 1
answers question: http://stackoverflow.com/q/28330141
downvote count: 0
has comment: http://stackoverflow.com/comment/45008529
type: Answer
has body: You "should" add the script-tag just before the closing body-tag (there are a lot great articles about that topic): Note, that you have to include a library before you "execute" it ;) It seems your selector is wrong. Try this:

http://stackoverflow.com/comment/45060905
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28358113
type: Comment
has text: Should i add sessionStorage to the script?

http://stackoverflow.com/q/28420827
has title: Javascript how to use High order functions and Map/Reduce function to sum up multiple arrays
upvote count: 2
has comment: http://stackoverflow.com/comment/45175589
linked to: http://stackoverflow.com/q/4856717
has comment: http://stackoverflow.com/comment/45175228
has body: I want to combine two array to sum up each element or the array up and return the result array.I AM PRACTICING HIGH ORDER FUNCTION, and although this can be easily solved, I am more inclined to seek advice for higher order function suggestions. something like this: var a=[1,2,3], b=[7,8,9]; func(a,b);// should return [8,10,12]; I need to do it more elegantly using high order functions, so cannot use a a simple loop to add each elements up. I know Map/Reduce function can apply to 1D array, but how about between the arrays? any elegant implementations? My effort: var arr=[a,b]; var toReturn=arr[0].map(function(_, i) { return arr.reduce(function(max, row) { return max+row[i]; }, 0); }); I know it is more complicated than it should be, but i am trying to learn higher order function that's it.
type: AnsweredQuestion
downvote count: 3
has answer: http://stackoverflow.com/a/28426617
type: Question
has answer: http://stackoverflow.com/a/28421019
has comment: http://stackoverflow.com/comment/45174780
tagged with: javascript
score: -1
possible better answer: http://stackoverflow.com/a/28421019
answer count: 2
has comment: http://stackoverflow.com/comment/45174829
accepted answer: http://stackoverflow.com/a/28426617
favorite count: 0

http://stackoverflow.com/comment/46416043
has text: ya..header needs to be constant when I m viewing external website content.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28433766

http://stackoverflow.com/comment/45002820
has text: It's a library I got for encryption that does this. I believe that the encryption do not work well if the data doesn't get base64 encoded... Not sure. But if the only way to make it work is not encoding base64, I'll try to make it work without base64... Maybe not possible.
comment on: http://stackoverflow.com/q/28311185
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28326458
has body: You can define your own dialogs like this: $(" Test message ").dialog(); If no, you can define your own function to use. custom_alert(); custom_alert("Display Message"); custom_alert("Display Message", "Set Title"); function custom_alert(output_msg, title_msg) { if (!title_msg) title_msg = 'Alert'; if (!output_msg) output_msg = 'No Message to Display.'; $(" ").html(output_msg).dialog({ title: title_msg, resizable: false, modal: true, buttons: { "Ok": function() { $( this ).dialog( "close" ); } } }); }
has comment: http://stackoverflow.com/comment/45000464
upvote count: 0
downvote count: 1
score: -1
has comment: http://stackoverflow.com/comment/46130323
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28326405
type: Answer
answers question: http://stackoverflow.com/q/28326405

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

http://stackoverflow.com/q/28419348
has body: Using Q for Node.js, I am promising a HTTP request, and upon fulfillment calling another function passing in the response of that HTTP request, that function then iterates over a JSON array from the HTTP requests, builds up a new array, and returns it. Debugging Reddit.prototype.parseData I can see the HTTP JSON is passed in, and within the for statement I can console.log data as it's been built, but at the end of the foreach I cannot console.log, or return the data object, it returns undefined Reddit.js var Reddit = function(){ this.endpoint = "https://www.reddit.com/r/programming/hot.json?limit=10"; } Reddit.prototype.parseData = function(json, q){ var dataLength = json.data.children.length, data = []; for(var i = 0; i &lt;= dataLength; i++){ var post = {}; post.url = json.data.children[i].data.url; post.title = json.data.children[i].data.title; post.score = json.data.children[i].data.score; console.log(data); //returns data data.push(post); } console.log(data); // returns undefined return data; } module.exports = Reddit; Feeds.js var https = require('https'), q = require('q'), Reddit = require('./sources/reddit'); var Feeds = function(){ this.reddit = new Reddit(); console.log(this.parseRedditData()); //undefined } Feeds.prototype.getData = function(endpoint){ var deferred = q.defer(); https.get(endpoint, function(res) { var body = ''; res.on('data', function(chunk) { body += chunk; }); res.on('end', function() { deferred.resolve(JSON.parse(body)); }); }).on('error', function(e) { deferred.reject(e); }); return deferred.promise; } Feeds.prototype.parseRedditData = function(){ var _this = this; this.getData(this.reddit.endpoint).then(function(data){ return _this.reddit.parseData(data); }); } var fe = new Feeds()
answer count: 1
has answer: http://stackoverflow.com/a/28419468
favorite count: 0
tagged with: promise
has comment: http://stackoverflow.com/comment/45171935
tagged with: node.js
type: AnsweredQuestion
downvote count: 0
score: 1
has title: Node.js Q promise forEach returning undefined
has comment: http://stackoverflow.com/comment/45172135
tagged with: http
type: Question
has comment: http://stackoverflow.com/comment/45172003
tagged with: javascript
tagged with: http://stackoverflow.com/tag/q
accepted answer: http://stackoverflow.com/a/28419468
upvote count: 1

http://stackoverflow.com/q/28412916
has answer: http://stackoverflow.com/a/28413017
accepted answer: http://stackoverflow.com/a/28413010
has comment: http://stackoverflow.com/comment/45159271
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28413017
has comment: http://stackoverflow.com/comment/45159185
has title: Using on/off event bindings?
type: Question
answer count: 2
score: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28413010
has comment: http://stackoverflow.com/comment/45159206
has comment: http://stackoverflow.com/comment/45159198
favorite count: 0
upvote count: 2
has body: Im trying to unbind an event. My event is: $(window).on('drop', this.onFileSelect.bind(this)); Later I: $(window).off('drop', this.onFileSelect.bind(this)); But I can still drop. Where am I going wrong?

http://stackoverflow.com/comment/44922085
has text: I'm graphing the data on the same set of axes so I need them at the same time, but I could get either one first or simultaneously. Just can't build the graph until I have them both.
comment on: http://stackoverflow.com/q/28283838
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45011384
type: QuestionComment
has text: This no way. But if you do echo "captcha_correct"; if success, then you can check it in javascript by this way: if( response == "captcha_correct" ) alert("Success"); else { alert("unsuccess.."); }
comment on: http://stackoverflow.com/q/28331252
score: 0
type: Comment

http://stackoverflow.com/comment/45077789
comment on: http://stackoverflow.com/q/28368417
type: Comment
type: QuestionComment
has text: "... with a mother mutton ..." ??? ?? ? ???
score: 1

http://stackoverflow.com/q/28422288
has answer: http://stackoverflow.com/a/28422365
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28422365
type: AnsweredQuestion
score: 0
type: Question
has body: I am just using basic Grails, with the default client-side validation that looks like this (not even sure what plugin it is): Just looking for how I can test that manually? In the past with jQuery validation I had done something like this: if($('#myForm').valid()) { // do stuff } Thank you.
tagged with: grails
has title: How do I fire client-side Grails validation manually via JavaScript?

http://stackoverflow.com/comment/45076817
type: QuestionComment
comment on: http://stackoverflow.com/q/28367734
score: 0
has text: You could be use [fnDrawCallback](http://legacy.datatables.net/ref#fnDrawCallback) for this
type: Comment

http://stackoverflow.com/q/28398107
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45132527
tagged with: jquery
answer count: 3
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45132173
favorite count: 0
has title: On click, blur my content behind
has answer: http://stackoverflow.com/a/28398441
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/45132520
has comment: http://stackoverflow.com/comment/45132036
has answer: http://stackoverflow.com/a/28398835
score: 1
has body: Is there a way when I click my menu button (and menu is revealed) my content in the background has a blur on it and when clicked again, the content goes back to normal? Currently working with this HTML: A B C D This CSS: $square: 50px; * { @include box-sizing(border-box); } body { background: #111; font: 300 14px Consolas, system, monospace; color: #fff; } .menu { position: fixed; height: $square; width: $square; cursor: pointer; top: 0; right: 0; background: #fff; @include transition(all 250ms ease-in-out); z-index: 100; overflow: hidden; nav { position: fixed; left: 50%; top: 50%; @include transform(translateY(-50%) translateX(-50%)); opacity: 0; @include transition(all 250ms linear 250ms); pointer-events: none; ul { list-style-type: none; padding: 0; li a { display: block; padding: 10px; text-decoration: none; color: #000; text-align: center; &:hover { background: #000; color: #fff; } } } } .line { height: 5px; width: $square - 10; background: #000; position: absolute; top: ($square/2)-(5/2); left: ($square - ($square - 10))/2; @include transition(all 250ms linear); &:after, &:before { content: ' '; height: 5px; width: $square - 10; background: #000; position: absolute; @include transition(all 250ms linear); } &:before { top: -10px; } &:after { bottom: -10px; } } &.active { width: 100%; height: 100%; nav { opacity: 1; pointer-events: all; } .line { background: transparent; &:before { background: #000; @include transform(rotate(-405deg)); top: 0px; } &:after { background: #000; @include transform(rotate(405deg)); bottom: 0px; } } } } This JS: $('.menu').click(function(){ $this = $(this); if ($this.hasClass('active')) { $this.removeClass('active'); } else { $this.addClass('active'); } }); I would be very grateful if anyone could help. Cheers
has answer: http://stackoverflow.com/a/28398960
type: Question

http://stackoverflow.com/q/28402042
has answer: http://stackoverflow.com/a/31288589
score: 0
has body: I am using t4toolbox extension (https://visualstudiogallery.msdn.microsoft.com/791817a4-eb9a-4000-9c85-972cc60fd5aa) to output js file. But I find some text block auto-generated in js files as: // // This file was generated by T4 code generator XX.tt. // Any changes made to this file manually will be lost next time the file is regenerated. // This comment does not be supported for javascript syntax. How to remove this text block from T4toolbox? Thanks!
has title: How to remove comments created automatically from t4toolbox？
type: UnansweredQuestion
type: Question
answer count: 1
tagged with: t4-toolbox
tagged with: javascript

http://stackoverflow.com/comment/44978149
type: QuestionComment
comment on: http://stackoverflow.com/q/28294349
has text: I know that we can use Eclipse to create a typical web application project, where the backend is supported by Java Servlet. All I have to do is to write JS and Java code, the Eclipse project will take care of their connection, as long as I set up the Tomcat environment. Can I have this kind of convenience when the frontend now becomes a firefox add-on? Thank you.
score: 0
type: Comment

http://stackoverflow.com/q/28333613
answer count: 5
has answer: http://stackoverflow.com/a/28333805
linked to: http://stackoverflow.com/q/23139876
tagged with: onsubmit
upvote count: 24
possible better answer: http://stackoverflow.com/a/57250225
type: AnsweredQuestion
score: 24
has answer: http://stackoverflow.com/a/45711017
has answer: http://stackoverflow.com/a/64398198
type: Question
has comment: http://stackoverflow.com/comment/45014188
accepted answer: http://stackoverflow.com/a/28333805
downvote count: 0
has body: Is it possible to catch the URL generated from a form when firing its 'submit' event? I know I can generate the URL from data I'm not talking about form's action URL I mean the ?field=value&amp;other-input-name=value&amp; ... part Scenario: We have a form and a JavaScript script which sends an Ajax request to a PHP script. I usually do like this: Register for the form's submit event Prevent the default behavior Construct a URL from data Open an HTTP request with the constructed URL Now, I was wondering, when firing 'submit' normally (on non-Ajax requests) the URL gets constructed by the form, which then uses that URL to send data to the PHP counterpart. How can I 'catch' that URL? There aren't any clues from the event itself which doesn't seem to store it, or at least I haven't been able to find it. It must be somewhere!
tagged with: javascript
tagged with: dom-events
tagged with: ajax
has answer: http://stackoverflow.com/a/28333716
has title: Get the URL generated from a form on submit with JavaScript
favorite count: 0
tagged with: form-submit
has answer: http://stackoverflow.com/a/57250225

http://stackoverflow.com/comment/44946634
type: QuestionComment
type: Comment
score: 2
comment on: http://stackoverflow.com/q/28297178
has text: I presume this is being run through ASP.NET, in which case please show the RENDERED code, not the original source

http://stackoverflow.com/a/28330292
type: Answer
has body: I guess you've put the scripts into the body tag. Script tag with src attribute get executed once the script is available while inline js gets executed inmediately. So the script tag with src is evaluated after your inline script while two inline script are evaluated in the order in which they are defined.
has comment: http://stackoverflow.com/comment/45027290
score: 0
answers question: http://stackoverflow.com/q/28325379

http://stackoverflow.com/comment/45051358
type: AnswerComment
type: Comment
has text: Just to be clear, the line `document.getElementById('textarea').value = ""; ` in the first example is not needed.
comment on: http://stackoverflow.com/a/28353679
score: 0

http://stackoverflow.com/q/28371867
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/3065342
has body: I have below form containing table A B C D A B C D --- --- ` I will have dynamic rows in the table. I want to pass whole table to JavaScript function & want to access values of cells in JavaScript function in array variable. function playt() { var i = document.getElementsByTagName('td').length; var composition = document.getElementsByTagName('td'); document.getElementById("demo").innerHTML = "Found " + composition[0] + " elements in the form."; }
has comment: http://stackoverflow.com/comment/45084212
has comment: http://stackoverflow.com/comment/45084168
has comment: http://stackoverflow.com/comment/45084284
type: Question
has comment: http://stackoverflow.com/comment/45084282
has comment: http://stackoverflow.com/comment/45084346
tagged with: javascript
has comment: http://stackoverflow.com/comment/45084191
score: 0
has comment: http://stackoverflow.com/comment/45084689
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/3065342
linked to: http://stackoverflow.com/q/9579721
answer count: 0
has title: How to pass HTML table values to Javascript function

http://stackoverflow.com/comment/45048085
score: 0
has text: Reading the the values to do what?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28352069

http://stackoverflow.com/q/28320152
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44989444
has title: object created with "new" keywords and the object created with "Object.create" gives different result
has comment: http://stackoverflow.com/comment/44989609
has answer: http://stackoverflow.com/a/28320261
has comment: http://stackoverflow.com/comment/44989662
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/44988796
tagged with: javascript
tagged with: jquery
score: 0
upvote count: 1
downvote count: 1
has body: Can anyone explain to me why object created with "new" keywords and the object created with "Object.create" keywords gives different result? function Car (desc) { this.desc = 'test'; this.color = "red"; } Car.prototype.getInfo = function() { return 'A ' + this.color + ' ' + this.desc + '.'; } //if i create object with "new" it's alert "A blue test" var car = new Car(); car.color = "blue"; alert(car.getInfo()); //A blue test // but if i create object with it's alert "A blue undefined" var car = Object.create(Car.prototype); car.color = "blue"; alert(car.getInfo()); //A blue undefined
has comment: http://stackoverflow.com/comment/44988767
favorite count: 0
has answer: http://stackoverflow.com/a/28329624

http://stackoverflow.com/q/28389811
tagged with: zurb-foundation
answer count: 1
type: UnansweredQuestion
tagged with: zurb-foundation-5
tagged with: css
has answer: http://stackoverflow.com/a/28413295
score: 0
has body: I've made a simple menu, where the hover effect is moving with the cursor, but it feels like there should be a way to automate the process more. Right now, im saying how big and where the hover effect should be, based on how much text there is in the menu by manually putting pixels into the width, and left margin. HTML Menu Forside Bartender Deejay Pakkeløsninger Kontakt CSS .top-bar { background-color: #3e6979; height: 80px; text-align: center; transition: all 0.4s ease; width: 100%; z-index: 1; background-position: center; position: absolute; } .box { background-color: #265364; height: 5rem; margin-left: 0.5%; width: 6.3rem; } .activelinkone { margin-left: 0.5%; width: 6.3rem; transition: all 0.2s 0.1s ease; } .activelinktwo { margin-left: 17.2%; width: 8rem; transition: all 0.2s 0.1s ease; } .activelinkthree { margin-left: 38.5%; width: 5.5rem; transition: all 0.2s 0.1s ease; } .activelinkfour { margin-left: 53.5%; width: 11.5rem; transition: all 0.2s 0.1s ease; } .activelinkfive { margin-left: 81.7%; width: 8rem; transition: all 0.2s 0.1s ease; } .one:hover ~ .box { margin-left: 0.5%; transition: all 0.4s ease; width: 6.3rem; } .two:hover ~ .box { margin-left: 17.2%; transition: all 0.4s ease; width: 8rem; } .three:hover ~ .box { margin-left: 38.5%; transition: all 0.4s ease; width: 5.5rem; } .four:hover ~ .box { margin-left: 53.5%; transition: all 0.4s ease; width: 11.5rem; } .five:hover ~ .box { margin-left: 81.7%; transition: all 0.4s ease; width: 8rem; } .top-bar-section ul { margin-right: 5.5rem; } .top-bar-section ul li { background: none; } .top-bar-section ul li > a { font-size: 18px; font-weight: 500; font-family: 'Raleway', sans-serif; text-transform: uppercase; color: #000; } .top-bar-section ul li:not(.has-form) > a { background: none; } .top-bar-section ul li:hover:not(.has-form) > a { color: #fff; transition: all 0.4s ease; } .top-bar-section li:not(.has-form) a:not(.button) { padding-top: 1rem; padding-bottom: 1.16rem; background: none; } .top-bar…
type: Question
has comment: http://stackoverflow.com/comment/45117225
tagged with: javascript
has title: Easier way to do this? - CSS/JS

http://stackoverflow.com/comment/45149379
type: QuestionComment
has text: It gets called every 500 millis: `var fetch = setInterval(loadStatus, 500);`
comment on: http://stackoverflow.com/q/28407507
score: 0
type: Comment

http://stackoverflow.com/comment/44986048
score: 0
type: AnswerComment
type: Comment
has text: Man, if you have a background image to your body, it gets harder. I had a new, much simpler idea : cover your whole page with a full white overlay. I have edited my answer.
comment on: http://stackoverflow.com/a/28317024

http://stackoverflow.com/q/28410804
tagged with: javascript
type: Question
score: 0
has comment: http://stackoverflow.com/comment/45155307
has comment: http://stackoverflow.com/comment/45155490
linked to: http://stackoverflow.com/q/12146445
has comment: http://stackoverflow.com/comment/45155726
has comment: http://stackoverflow.com/comment/45155378
has comment: http://stackoverflow.com/comment/45155804
has title: Scriptish .click event only working after "Run" but not with run-at
tagged with: scriptish
answer count: 0
type: UnansweredQuestion
has body: I'm using scriptish. I wanted to write a macro that would click for me. But it only works when I press Run in script editor. Does not work on autoload. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js // @run-at document-end // @delay 100 // ==/UserScript== $('.pagination.pagination-centered li:last a').click(); What could be a reason? I want to write a script that would go through all available pages by clicking next.
has comment: http://stackoverflow.com/comment/45155242

http://stackoverflow.com/q/28367540
has answer: http://stackoverflow.com/a/28370685
has comment: http://stackoverflow.com/comment/45078563
has comment: http://stackoverflow.com/comment/45079692
tagged with: javascript
type: Question
has title: Info-window not getting refreshed: AngularJS and Google Maps
score: 0
tagged with: google-maps
answer count: 1
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45078617
has body: I am struggling a lot with info-windows to show when clicking on custom markers. I finally got to show them, but the result is not quite correct. In fact, clicking on the first marker, the info box shows its content correctly. However, clicking on any other marker after the first causes the info-window to show but with the previous content. This happens for any marker: first clicked works, successors show the previous content. Code: {{item.name}} <marker ng-repeat="item in list" position="[{{item.coordinates}}]" itemTitle="{{item.name}}" icon="./images/i.png" on-click="showInfoWindow('bar')" /> {{this.itemTitle}}
has comment: http://stackoverflow.com/comment/45076816
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45078643

http://stackoverflow.com/comment/45107893
score: 0
comment on: http://stackoverflow.com/a/28384641
type: AnswerComment
type: Comment
has text: I would make sure they are deployed (recompile and redeploy to tomcat), other than that I cant see a reason why they should not work from what you posted. You might want to take a look [here](http://stackoverflow.com/questions/18369036/bootstrap-3-glyphicons-not-working) hopefully you will find some help.

http://stackoverflow.com/q/28420708
tagged with: export
has body: I'm aware of this post, but if I'm using var material = new THREE.MeshBasicMaterial( { color: 0xffff00 } ); var mesh = new THREE.Mesh( totalGeom, material ); THREE.OBJExporter.parse( mesh ); I get Uncaught TypeError: Cannot read property 'parse' of undefined I read the example source (at line 154) but didn't find a solution by myself.. any help?
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28423404
tagged with: three.js
upvote count: 1
has title: How to use THREE.OBJExporter
type: AnsweredQuestion
score: 1
type: Question
accepted answer: http://stackoverflow.com/a/28423404
linked to: http://stackoverflow.com/q/11367822
tagged with: javascript

http://stackoverflow.com/q/28353352
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
upvote count: 4
has body: I've added a video to my site using the default HTML5 video player. The code is like this: &lt;video width="100%" height="100%" controls&gt; &lt;source src="http://media.sublimevideo.net/v/midnight-sun-short-edit-360p.mp4" type="video/mp4"&gt; &lt;/video&gt; I wanted to make it so a click on the video stops or starts the video. So I added this: onclick="this.paused?this.play():this.pause();" And all good. Until Firefox 35 adds this very function to the player. So now you can only play the video by right clicking and selecting play - an ordinary click would first make the video play via the native behaviour, and then immediately pause it via my click handler. Terrible. So I thought up a JavaScript function something like this: function startstop() { if ( FirefoxVersionNumber &gt; 34 ) { // do nothing } else { // start or stop video } } The bit I'm stuck on is how to check the browser version? All the ones I tried returned that Firefox version number was 5... which I think comes from the Netscape part.
has comment: http://stackoverflow.com/comment/45050555
has answer: http://stackoverflow.com/a/28353845
tagged with: video
downvote count: 0
has title: Click handler on conflicts with Firefox's native behaviour
linked to: http://stackoverflow.com/q/5278262
linked to: http://stackoverflow.com/q/9847580
type: Question
tagged with: firefox
has comment: http://stackoverflow.com/comment/45050751
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/28354941
has comment: http://stackoverflow.com/comment/45050657
has comment: http://stackoverflow.com/comment/45052700
answer count: 2
has comment: http://stackoverflow.com/comment/45050473
has comment: http://stackoverflow.com/comment/45050604
favorite count: 0

http://stackoverflow.com/a/28311021
upvote count: 3
has comment: http://stackoverflow.com/comment/44993216
score: 3
has body: The Rails Way Just append the ID of the listing to their ID in your erb (since your form is not there I am assuming some structure as the following): &lt;div id="like-form-&lt;%= @listing.id %&gt;"&gt; &lt;!-- your content --&gt; &lt;/div&gt; and do the same in your JS file: $("#like-form-&lt;%= @listing.id %&gt;").html("&lt;%= escape_javascript(render('listings/unlike')) %&gt;") $("#like-size-&lt;%= @listing.id %&gt;").html('&lt;%= @listing.get_likes.size %&gt;') This way you will always target the correct element. JS way Let's say that you have a list of listings generated through a loop and each item has the following markup: &lt;div class="listing"&gt; &lt;!-- your content --&gt; &lt;div class="like-form"&gt; &lt;%= link_to like_listing_path(@listing), class: "like-btn" do %&gt; &lt;i class="fa fa-heart-o"&gt;&lt;/i&gt; &lt;% end %&gt; &lt;%= link_to unlike_listing_path(@listing), class: "unlike-btn" do %&gt; &lt;i class="fa fa-heart liked"&gt;&lt;/i&gt; &lt;% end %&gt; &lt;/div&gt; &lt;/div&gt; Now you could do something write some JS like this: $(".like-btn, .unlike-btn").click(function(e) { e.preventDefault(); var el = $(this); $.ajax({ url: el.attr("href"), method: post }).done(function(data) { el.parent().html(data); }); }); Same thing applies for the number of likes. A word on REST I have notices that you have two different paths to like and unlike so I am assuming that you have added those paths manually to your routes.rb. If you really want to leverage the power of REST you really only need a single path to your listing like and then use POST to create a like and DELETE to remove a like (i.e. unlike).
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28310537
has comment: http://stackoverflow.com/comment/44994242
type: Answer
answers question: http://stackoverflow.com/q/28310537

http://stackoverflow.com/q/28306756
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45567413
possible better answer: http://stackoverflow.com/a/61667960
has answer: http://stackoverflow.com/a/61667960
has answer: http://stackoverflow.com/a/28306768
favorite count: 0
score: 56
upvote count: 56
has title: Is it safe to delete elements in a Set while iterating with for..of?
has comment: http://stackoverflow.com/comment/45550177
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28306768
tagged with: set
has body: Is it specified that you can delete any element in an instance of Set while iterating using for..of and that you won't iterate more than once on an element you won't miss any other element that was in the set at the start of the iteration other than the ones you remove ?
type: Question
tagged with: ecmascript-6
answer count: 2
tagged with: iterator

http://stackoverflow.com/a/28392675
has body: It executes the same way as ordinary javascript. submitInput() executes first. I would not reccomend doing it this way though. It would be considered bad practice. keep your javascript out of your HTML ok. Lastly, just because something executes first, does not mean that it will finish first.. javascript is both async and synchronous in some cases.
score: 0
answers question: http://stackoverflow.com/q/28392546
type: Answer

http://stackoverflow.com/comment/45030819
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28342858
type: Comment
has text: gives same result, no different :/

http://stackoverflow.com/q/28358776
tagged with: javascript
favorite count: 0
has body: I am getting two instances of a module when I am using the module with two different parameters. How to make it a single instance? // module.js module.exports = function(declared){ var count = { total : 0 } var definedVariable = declared; function increment(){ count.total++; return { defined : definedVariable, count : count.total } } return { increment : increment } } // app.js var express = require('express'); var bodyparser = require('body-parser'); var mod1 = require('./module.js')(); var mod2 = require('./module.js')('defined now'); app = express(); app.use(bodyparser.urlencoded({ extended: false })) app.use(bodyparser.json()); app.route('/').get(function(req, res, next) { var cnt1 = mod1.increment(); res.json(cnt1); }); app.route('/defined').get(function(req,res,next){ var cnt2 = mod2.increment(); res.json(cnt2); }); app.listen(8000, function(){ console.log('listening 8000'); }) When I run http://localhost:8000 and http://localhost:8000/defined, I am getting different counts and different instances. How to let them point to the single instance?
has answer: http://stackoverflow.com/a/28359566
tagged with: node.js
has title: In nodejs how to have single instance of module having constructor with different parameters?
type: UnansweredQuestion
downvote count: 1
has comment: http://stackoverflow.com/comment/45084567
score: -1
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28358900
upvote count: 0

http://stackoverflow.com/a/28339021
type: Answer
has body: you havent added the return value if the case is not within in var inRange = function(rangeStart3,rangeStop3,value) { return (value &gt; rangeStart3 &amp;&amp; value &lt; rangeStop3); };
answers question: http://stackoverflow.com/q/28338974
score: 0

http://stackoverflow.com/comment/45165680
type: Comment
has text: Just so you know, I was able to count the number of checked rows with this line : `var countchecked = $('#' + tableID).find('input[type="checkbox"]:checked').length;`
comment on: http://stackoverflow.com/a/28415545
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45173592
type: Comment
type: QuestionComment
has text: Stackoverflow is for coding questions. Your so called question has no code. So don't be surprised when you get down voted and closed
comment on: http://stackoverflow.com/q/28419990
score: 0

http://stackoverflow.com/comment/44928144
has text: Have you cleared your browser cache? Has it cached some older version of your style/script that only seems to reload intermittently?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28286554

http://stackoverflow.com/comment/45017896
comment on: http://stackoverflow.com/q/28335583
score: 0
has text: change $http.get('/api/me', {cache: true}); to $http.get('/api/me?rand=' + Math.random(), {cache: true});
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45013340
has text: @DavidSherret I would post that as the answer
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28321316
score: 1

http://stackoverflow.com/comment/45066766
score: 0
has text: Note: as you seems open to d3, you must know that D3 geographic stuff is handled by *topojson*, both a D3js plugin (topojson.js) and a smart geojson format (.topojson files). Google is your friend: topojson api. Check out bl.ocksplorer.org
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28359690

http://stackoverflow.com/comment/45107950
type: QuestionComment
comment on: http://stackoverflow.com/q/28375543
has text: @WayneEllery This was the problem. Thank you very much. I thought the first angular.min.js file was all that I needed. I will look into other files for different features. Thanks again.
score: 0
type: Comment

http://stackoverflow.com/q/28357647
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: io.js
has comment: http://stackoverflow.com/comment/45059913
upvote count: 6
has title: How to use ES6 Hash Map on any object without maintaing a reference (I.e. Java hashcode)
type: AnsweredQuestion
has body: I've been experimenting with ES6 Map in io.js and realized that I can't do the following: var map = new Map() map.set( {key:"value"}, "some string"); map.get( {key:"value"} ); // undefined. I want "some string" This is because {key:"value"} === {key:"value"} is false. I need to be able to use an object as a key but not require the ACTUAL object to lookup the value like how java HashMap uses hashcode and equals. Is this possible?
score: 6
has answer: http://stackoverflow.com/a/28365120
type: Question
has comment: http://stackoverflow.com/comment/114098838
tagged with: ecmascript-6
accepted answer: http://stackoverflow.com/a/28365120

http://stackoverflow.com/comment/45128081
has text: When you use highchart it realy does not matter if you use jquery or not. You can always wrap it in your own directive or you can use one of the open source wrappers for highchart https://github.com/pablojim/highcharts-ng
type: Comment
comment on: http://stackoverflow.com/q/28395882
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44981239
type: Comment
score: 1
type: AnswerComment
has text: perfect case for a ternary: `period = period == "PM" ? "AM" : "PM";`
comment on: http://stackoverflow.com/a/28315932

http://stackoverflow.com/q/28396928
tagged with: angularjs
type: Question
accepted answer: http://stackoverflow.com/a/28396984
has body: Is it possible to watch a whole object in angularJS ? I created a plunker to show you what i mean: http://plnkr.co/edit/QxLzbwKkJ5k50DiP8OP1 When i change the R G or B value the colors object won't fire a change event, only the R G or B value fires. Can i fire a event myself so that it i know that the whole object changed ? Besides the plunker here is the code: function ColorObject() { this.r = 0; this.g = 0; this.b = 0; this.c = 0; this.m = 0; this.y = 0; this.k = 0; this.hex = "#ff0000"; this.oppositeHex = "#00ffff"; } var chColorChanger = angular.module('chColorChanger',[]); chColorChanger.controller('chColorChangerCtrl', function ($scope,$document,$element) { $scope.colors = new ColorObject(); $scope.gMessage = 0; $scope.message = 'scope initialized'; }); chColorChanger.directive('chColorValue',['$document',function($document) { return { link: function (scope, elem, attrs) { scope.$watch('colors',function(newValue,oldValue){ scope.gMessage++; }); scope.$watch('colors.r', function (newValue,oldValue) { scope.message = 'r changed'; }); scope.$watch('colors.g', function (newValue,oldValue) { scope.message = 'g changed'; }); scope.$watch('colors.b', function (newValue,oldValue) { scope.message = 'b changed'; }); } } }]);
score: 4
answer count: 1
tagged with: angularjs-directive
has title: angularJS scope.$watch whole object
tagged with: angularjs-scope
upvote count: 4
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28396984
favorite count: 0

http://stackoverflow.com/q/28285405
has comment: http://stackoverflow.com/comment/44924965
type: Question
has body: I am looking for a way to take input from an HTML form and store it into a JSON object for use with AJAX. I can't use the normal $('#id').val();, because, as you can see below, there are a lot of fields. Here is some sample code Javascript/jQuery: $(document).ready(function() { $('.add-to-cart').click(function() { var id = $(this).attr('id'); //var qty = $(this).attr('qty'); <- need the quantity from the field console.log(id); //console.log(qty); $.ajax({ url: 'addproduct', type: 'POST', datazType: 'JSON', data: { "id": id //"qty": qty }, success: function(addedproduct) { console.log(addedproduct.name); $('#cart').append(' '+ addedproduct.name +' '); }, error: function() { console.log('failed to add product'); } }) }); }); HTML: {{$product->name}} id}}" class="add-to-cart">Add to cart Help me please, or at least guide me in the right direction, this HAS to happen using AJAX.
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/44924888
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28285442
answer count: 1
downvote count: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/28285442
favorite count: 0
tagged with: ajax
tagged with: http://stackoverflow.com/tag/html
has title: Take input from html field and store it in JSON object (lots of input fields)
linked to: http://stackoverflow.com/q/1960240
type: AnsweredQuestion
score: 1
upvote count: 1

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

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

http://stackoverflow.com/q/28424285
has title: javascript textbox validation in asp.net c#
has body: I Want To Validate A Textbox in asp.net With Javascript that does not allow White space at the Begining but allow space in between words like "hello World" But Not As " hello world" And also not allow More than 4 character including white space in between words
type: Question
has comment: http://stackoverflow.com/comment/45181256
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/45181288
answer count: 1
downvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/43519128
upvote count: 0
has comment: http://stackoverflow.com/comment/45181343
type: UnansweredQuestion

http://stackoverflow.com/q/28378500
downvote count: 0
score: 1
type: Question
has body: I have this piece of angularjs code $http.get(sprintf("/posts/%s", post.id)). success(function(data, status, headers, config) { $scope.post = data; }) I expected in the backend (rails) to get a json format request respond_to do |format| format.html format.json { render json: @post} end But I got a html format request. Something I am missing? Thanks for any help.
tagged with: javascript
has title: rails - angularjs sends http.get as html format request
upvote count: 1
has answer: http://stackoverflow.com/a/28378546
answer count: 1
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
tagged with: ruby-on-rails

http://stackoverflow.com/a/28400559
score: 0
type: Answer
has body: You can simply use simple_format(model.description) in ActionView::Helpers::TextHelper if you are gonna display it in a view. Documentation for simple_format
answers question: http://stackoverflow.com/q/28400375

http://stackoverflow.com/q/28313269
downvote count: 3
has comment: http://stackoverflow.com/comment/44976839
has comment: http://stackoverflow.com/comment/44976807
has comment: http://stackoverflow.com/comment/44976711
favorite count: 0
has comment: http://stackoverflow.com/comment/44976882
has comment: http://stackoverflow.com/comment/44976784
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44976822
has body: Looking to convert a jQuery snippet to javascript. Totally hitting a wall with this. Are there any automated tools for doing this? The reason we're converting this is because the code is used as part of a product that we're planning on injecting in the future and we can't guarantee that the site has the appropriate (or any) version of jQuery running. EDIT: The reason we can't control the use of jQuery is that the customer will be copying and pasting this code themselves. It's highly likely that they will be non-technical and as such not willing/able to setup the appropriate version of jQuery This is the jQuery code we're using now: $(function() { $.getJSON('http://api.seedthechange.org/get/?method=getCount&amp;str=suitjamas&amp;jsoncallback=?', function(data) { treecount = csn(data[0]); $('span.SeedTheChangeCount').text(treecount); }); }) function csn(val){ // convert int to comma separated number (1000 -&gt; 1,000) while (/(\d+)(\d{3})/.test(val.toString())){ val = val.toString().replace(/(\d+)(\d{3})/, '$1'+','+'$2'); } return val; } Thanks in advance for any help or tips.
type: Question
has comment: http://stackoverflow.com/comment/44976835
has comment: http://stackoverflow.com/comment/44976691
has comment: http://stackoverflow.com/comment/44977000
has comment: http://stackoverflow.com/comment/44976946
linked to: http://stackoverflow.com/q/6132796
tagged with: jsonp
answer count: 2
has answer: http://stackoverflow.com/a/28313424
tagged with: javascript
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/28313488
has title: jQuery to Javascript Conversion for AJAX request
upvote count: 3
score: 0

http://stackoverflow.com/q/28393498
tagged with: javascript
tagged with: document.write
has title: document.getElementById innerHTML Not working in loop
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45123807
accepted answer: http://stackoverflow.com/a/28397599
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45123920
type: Question
tagged with: innerhtml
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/45124762
has body: Hy ! I am trying to put the result of an XMLHttpRequest inside a div using document.getElementById innerHTML without success. In the head : XMLHttpRequest is fine (I tried document.write and it show my results). Here is my code : if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.open("GET","http://www.mywebsite.com/my.php",false); xmlhttp.send(); xmlDoc=xmlhttp.responseXML; for(var i=0; i &lt; xmlDoc.getElementsByTagName("place").length; i++) { name = xmlDoc.getElementsByTagName("name")[i].childNodes[0].nodeValue; document.getElementById('name').innerHTML += name +"&lt;br&gt;"; } In the body : &lt;div id="name"&gt;&lt;/div&gt; NB : my.php generate xml file and replacing the line document.getElementById... by document.write(name + "br tag"); is working fine. Thanks in advance for help.
has comment: http://stackoverflow.com/comment/45123739
has comment: http://stackoverflow.com/comment/45124047
has comment: http://stackoverflow.com/comment/45125047
has answer: http://stackoverflow.com/a/28397599
has comment: http://stackoverflow.com/comment/45129396
tagged with: xml-parsing
has comment: http://stackoverflow.com/comment/45124492
downvote count: 0

http://stackoverflow.com/q/28385989
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45111520
has body: I'm trying to change a value that was set from javascript(jQuery) from another field. I want to target only one word from that value. Here's my code (http://jsfiddle.net/zL4pc90d/): jQuery get input Text value example jQuery Get and Set input Text value Car Model: Make: Honda Toyota Ford Contract: For the new values, wherever it says "", I'd like it to be what I enter in the first input field. I'd prefer to do it dynamically too, so maybe calling the keyup function or something. How would I do this?
answer count: 1
score: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45111225
has comment: http://stackoverflow.com/comment/45112300
has title: Changing a value from another field
has answer: http://stackoverflow.com/a/28388236

http://stackoverflow.com/comment/45183887
type: Comment
type: QuestionComment
has text: it is the jquery mobile link that causes the problem. if i removeit , i can navigate, but swipe isn't working
comment on: http://stackoverflow.com/q/28410632
score: 0

sticky-windows
tags question: http://stackoverflow.com/q/28365359
tag name: sticky-windows
type: Tag

http://stackoverflow.com/q/28427605
has title: empty().append() appending last item in loop
accepted answer: http://stackoverflow.com/a/28427648
score: 0
answer count: 3
tagged with: jquery
has answer: http://stackoverflow.com/a/28427687
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28427648
possible better answer: http://stackoverflow.com/a/28427662
has answer: http://stackoverflow.com/a/28427662
type: Question
has body: I'm doing the following: $('.document-content').on('input', function() { var headers; headers = $('.document-content &gt; h2').each(function() { var headerId, headerText; headerId = $(this).attr('id'); headerText = $(this).text(); $('.document-outline').empty().append("&lt;h2&gt;&lt;a href='#" + headerId + "'&gt;" + headerText + "&lt;/h2&gt;"); }); }); In order to avoid duplication, I added empty() but now only the last item in the each loop is being appended to .document-outline. How can I fix this?
tagged with: javascript

http://stackoverflow.com/comment/45155828
comment on: http://stackoverflow.com/q/28410707
type: Comment
type: QuestionComment
has text: @jbutler483 seems good, but better if with JS , as wheels Spokes will have some text also
score: 0

http://stackoverflow.com/comment/45067326
comment on: http://stackoverflow.com/a/28359710
has text: Hi @Tristan Bailey, The line no.2 check the variable $a and based on the condition the new value of the $a is assigned. Without the line no.1 the result of echo will be "the result is no".
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28365643
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45092096
has comment: http://stackoverflow.com/comment/45072427
has comment: http://stackoverflow.com/comment/45162230
has answer: http://stackoverflow.com/a/28366004
type: Question
has comment: http://stackoverflow.com/comment/45147260
tagged with: javascript
has comment: http://stackoverflow.com/comment/45092014
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I've been using the following function to hide my div's when I no longer wanted them to be visible function hide(div) { document.getElementById(div).style.display = 'none'; } However the problem has arrived with the div inparticular. &lt;div id="loading"&gt; &lt;img src="./img/loading.gif"/&gt; &lt;/div&gt; When I call the function hide('loading') only parts are the image are hidden, and slices of it are burnt onto the page. Considering this is supposed to be a little loading icon, having is stamped into the page isn't really what I'm going for, how can I prevent this? I'm using the loading icon while processing network data, then hiding it upon receiving and processing data from the server(nodejs). css as requested: #loading { position: fixed; top: 50%; left: 50%; margin-top: -64px; margin-left: -64px; z-index: 999; }
has title: Pieces of image stick around after altering display to "display: none"

http://stackoverflow.com/comment/45155516
type: QuestionComment
score: 3
comment on: http://stackoverflow.com/q/28410843
has text: Please add your JS code to the question.
type: Comment

http://stackoverflow.com/q/28312921
tagged with: javascript
answer count: 2
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has title: Play/Pause Audio Button Using HTML5 And JavaScript
has answer: http://stackoverflow.com/a/28312945
tagged with: audio
linked to: http://stackoverflow.com/q/2229118
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/28313034
type: Question
has body: I am facing a problem for a couple of hours. I have some Radio Channels into a HTML document. Every channel has an image (it's logo). I can't figure out how to make the "click to Play/Pause" working. Here's the JSFiddle document : http://jsfiddle.net/s35vk80m/1/ 123 If you click on the first image, it will play/pause the channel. The second button act like the first one. How can I make it work, so that both of them would work independently and if I click on the second one while the first one is running, it would stop the first channel and start the second one? I am sorry, I am a begginer :-).

http://stackoverflow.com/q/28413223
favorite count: 0
answer count: 3
has body: I have a form with 4 input (can be even many more) where the user can put a number or nothing. The only rule is that if you put a number in a input you cannot submit if the same number is in another input (no duplicates). You can submit with as many empty input as you want. To validate the input I compare the length of the array of all the inputs with the same array with only unique values. If they have the same length it's ok. I need to improve my code because now it works only if the user enters all the input fields. If some inputs are empty they are considered in the array with unique value as they all have "" as a value. So, if the user enters just one number I will get that array length is 4 and array unique is 2 but it should be 1 and 1 (skipping the blank items). I was thinking about using splice() on arr, but is this the best way to do this validation? **EDIT: I applied splice BUT if the array is ('1','','') my code gives me ('1','') instead of just (1) as I'd expect... ** This is because splice remove the item and change array length so that the for loop point to the wrong index. Any idea? HTML: Messaggi inclusi Prova di messaggio che scorre Ordine: Titoli di film Ordine: Prova a testo fisso Ordine: JAVASCRIPT: function uniqueArray(arr) { return $.grep(arr,function(v,k) { return $.inArray(v,arr) === k; }); } $(document).ready(function() { $('#invia').click(function(e) { e.preventDefault(); var arr = $(".seq").map(function(){ return $(this).val(); }).toArray(); var empty = $(".seq").filter(function() { return this.value == ""; }) for (index = 0; index < arr.length; ++index) { if (arr[index]=='') { new_arr = arr.splice([index],1); } console.log(arr); } if(empty.length == $('.seq').length) { alert('Non hai scelto alcun messaggio per il workflow. Correggi per procedere.'); } else if(uniqueArray(arr).length != $('.seq').length) { console.log(uniqueArray(arr)); alert('Ci sono voci duplicate nella sequenza. Correggi per procedere.'); } else if($('#dt_from').val()=…
accepted answer: http://stackoverflow.com/a/28413576
has title: compare two arrays based on length: skip empty values
has answer: http://stackoverflow.com/a/28414373
upvote count: 1
has answer: http://stackoverflow.com/a/28414471
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28414373
score: 1
tagged with: javascript
type: Question
has answer: http://stackoverflow.com/a/28413576
tagged with: arrays
downvote count: 0
tagged with: jquery

http://stackoverflow.com/q/28429377
favorite count: 0
has comment: http://stackoverflow.com/comment/45190569
has body: I am trying to use classic Jumo .... some content and with this some javascript code .... if ( ! window.console ) console = { log: function(){} }; $('.single-page-nav').singlePageNav({ offset: $('.single-page-nav').outerHeight(true), filter: ':not(.external)', updateHash: true, beforeStart: function() { console.log('begin scrolling'); }, onComplete: function() { console.log('done scrolling'); } }); But it slide not exactly on the top of the div, but some pixels above ... can you help me with this? Thanks.
answer count: 0
type: UnansweredQuestion
upvote count: 1
score: 1
type: Question
has comment: http://stackoverflow.com/comment/45192035
has title: How to slide to div element using javascript
downvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/44925953
score: 0
type: Comment
type: QuestionComment
has text: @JustinY Thank you for pointing out, I've tried correcting it, but it didn't fix the problem yet.
comment on: http://stackoverflow.com/q/28285793

http://stackoverflow.com/q/28289699
has comment: http://stackoverflow.com/comment/116987264
upvote count: 8
has answer: http://stackoverflow.com/a/28289762
tagged with: python
linked to: http://stackoverflow.com/q/2148493
type: AnsweredQuestion
tagged with: web-scraping
type: Question
accepted answer: http://stackoverflow.com/a/28289762
tagged with: javascript
has body: I am trying to use python3 to return the bibtex citation generated by http://www.doi2bib.org/. The url's are predictable so the script can work out the url without having to interact with the web page. I have tried using selenium, bs4, etc but cant get the text inside the box. url = "http://www.doi2bib.org/#/doi/10.1007/s00425-007-0544-9" import urllib.request from bs4 import BeautifulSoup text = BeautifulSoup(urllib.request.urlopen(url).read()) print(text) Can anyone suggest a way of returning the bibtex citation as a string (or whatever) in python?
has title: Python web scraping for javascript generated content
downvote count: 0
answer count: 1
score: 8
favorite count: 0

http://stackoverflow.com/q/28395114
type: AnsweredQuestion
has title: Ember route model blocks javascript
type: Question
has answer: http://stackoverflow.com/a/28407051
tagged with: ember-data
tagged with: javascript
has body: I have an IndexRoute and a PricingRoute, both are using the plan model in order to retrieve a list of plans from a JSON API. The models load just fine, there's no problem there. I also have the Google+ SDK added on the index.html page. Also, the Materialize CSS library with a side-nav that is initialized through Javascript inside the application controller. The problem is that whenever I refresh/initially load either of those 2 routes, the Google+ follow widget is not showing and the Materialize side-nav is not working (probably the JS init didn't work). However, if I just remove the model on the route (whichever of the 2), both the Google+ widget and the Materialize side-nav work as intended. So what exactly is wrong with the route model that it makes it interfere with the Google+ and Materialize libs ? Worth noting is that I also have the Facebook lib initialized before the side-nav in the application controller, but that works just fine even with the models. application.js controller: export default Ember.Controller.extend({ init: function () { // initialize facebook SDK var facebook_id = this.facebook_app_id; window.fbAsyncInit = function () { FB.init({ appId: facebook_id, xfbml: true, version: 'v2.1' }); }; (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')); // load side nav drawer Ember.$(document).ready(function () { Ember.$('.button-collapse').sideNav(); }); } }); index.js route: export default Ember.Route.extend({ model: function () { return this.store.find('plan'); } }); pricing.js route: export default Ember.Route.extend({ model: function () { return this.store.find('plan'); } }); index.html &lt;html&gt; &lt;head&gt; ... &lt;script src="https://apis.google.com/js/client:platform.js" async defer&gt;&lt;/script&gt; &lt;/head&gt; ... &lt;/html&…
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/28407051
tagged with: ember.js

http://stackoverflow.com/a/28333466
has body: Try something like this. $('#menuHandler').change(function(){ var selectedValue = $(this).val(); if(selectedValue === 'abc') { $('#runFormPopup').show(); $('#form_generate').hide(); } else { $('#runFormPopup').hide(); $('#form_generate').show(); } });
answers question: http://stackoverflow.com/q/28333352
type: Answer
score: 1
upvote count: 1
downvote count: 0

http://stackoverflow.com/q/28390401
accepted answer: http://stackoverflow.com/a/28390667
favorite count: 0
has comment: http://stackoverflow.com/comment/45118231
has answer: http://stackoverflow.com/a/28390667
type: AnsweredQuestion
score: 3
upvote count: 3
has title: Is there a total order on JavaScript objects?
tagged with: comparison
has body: The title pretty much says it all. Does JavaScript guarantee a total order on objects when using the &lt;, &gt;, &lt;= and &gt;= operators? I wrote some code just to check total ordering on some objects. The result is consistent with total ordering, but that doesn't prove anything: function thereIsTotalOrder(items){ var one, other, theThird; // warning: n^3 complexity follows // If a &lt;= b and b &lt;= a then a = b (antisymmetry); for(var i=0; i&lt;items.length; i++){ for(var j=0; j&lt;items.length; j++){ one = items[i]; other = items[j]; if((one &lt;= other) &amp;&amp; (other &lt;= one) &amp;&amp; (one != other)){ return false; } } } // If a &lt;= b and b &lt;= c then a &lt;= c (transitivity) for(var i=0; i&lt;items.length; i++){ for(var j=0; j&lt;items.length; j++){ for(var k=0; k&lt;items.length; k++){ one = items[i]; other = items[j]; theThird = items[k]; if((one &lt;= other) &amp;&amp; (other &lt;= theThird) &amp;&amp; !(one &lt;= theThird)) { return false; } } } } // a &lt;= b or b &lt;= a (totality). for(var i=0; i&lt;items.length; i++){ for(var j=0; j&lt;items.length; j++){ one = items[i]; other = items[j]; if(!((one &lt;= other) || (other &lt;= one))) { return false; } } } return true; } function a(){}; function b(){}; var c = "foo"; var d = "bar"; var e = "bar"; var f = function(){}; var g = {name : "bananas"}; console.log(thereIsTotalOrder([a, b, c, d, e, f, g])); // prints "true"
type: Question
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/28369123
tagged with: cordova-plugins
has comment: http://stackoverflow.com/comment/45498551
tagged with: cordova
type: Question
tagged with: android
linked to: http://stackoverflow.com/q/6468805
has comment: http://stackoverflow.com/comment/45473957
has comment: http://stackoverflow.com/comment/45500148
upvote count: 2
has comment: http://stackoverflow.com/comment/45333061
has body: I have recently created a Cordova Application to work on a Android table. everything is working great and my application saves audio files that have been recorded by the user by using the org.apache.cordova.media plugin. I am saving recorded sound files to a specific directory within "mnt/sdcard/" and when exploring the device using ES File Explorer i can see the .mp3 files. However if i navigate to the same directory within Windows Explorer (with my device attached via USB) i am unable to see the files. I have been looking around the web for a fix for this and a few forums said that restarting the device would show the files. I tried restarting and my files did show up. However I do not want to have to restart my device everytime i want to get files off the device. This post clearly describes a way to fix this if you are writing a native Android application however I am writing my application using Cordova and the media plugin. Does anyone know a way around this for Cordova or more specifically the media plugin? *Edit Also something I tried was going into ES File Explorer and cutting the file and pasting it in a different directory. This seemed to work and showed the file within Windows Explorer. It looks like the file is still attached to the application and so wont show up. Ive tried quitting out of the application and even doing a force close and still not working.
has answer: http://stackoverflow.com/a/28600688
answer count: 1
has comment: http://stackoverflow.com/comment/45468695
has comment: http://stackoverflow.com/comment/45084928
tagged with: javascript
type: UnansweredQuestion
tagged with: phonegap-plugins
has title: Cordova created files not showing in Windows Explorer unless restart of device
has comment: http://stackoverflow.com/comment/45448901
has comment: http://stackoverflow.com/comment/45480413
has comment: http://stackoverflow.com/comment/45333224
score: 2
has comment: http://stackoverflow.com/comment/45492467
downvote count: 0
has comment: http://stackoverflow.com/comment/45084716
favorite count: 0

http://stackoverflow.com/comment/56483286
has text: I had a similar problem because I hadn't add the plugin: cordova plugin add https://github.com/VitaliiBlagodir/cordova-plugin-datepicker.git
type: AnswerComment
comment on: http://stackoverflow.com/a/28334503
score: 0
type: Comment

http://stackoverflow.com/comment/68504730
comment on: http://stackoverflow.com/a/40009466
has text: Sometimes Google API did not allow to find the distance without departure Time. You will get error message like "departure_time is in the past. Traffic information is only available for future and current times". Please add the "drivingOptions"
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45149280
has text: No, when i check my codesource, i have : SUPPRESSION
comment on: http://stackoverflow.com/a/28407558
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45197164
score: 0
type: Comment
has text: @HusseinFawzy by ticking a answer you can close the discussion.
comment on: http://stackoverflow.com/a/28410306
type: AnswerComment

http://stackoverflow.com/a/28402526
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45140981
type: Answer
upvote count: 1
has body: You cannot create a function that blocks (i.e. forces the caller to wait for it to complete) in Javascript without freezing the UI completely. Look at setTimeout, callbacks, and possibly Promises as ways to perform these actions asynchronously. https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers.setTimeout http://www.html5rocks.com/en/tutorials/es6/promises/
answers question: http://stackoverflow.com/q/28402451

http://stackoverflow.com/comment/44918896
type: AnswerComment
comment on: http://stackoverflow.com/a/28282211
score: 0
has text: This is for Javascript. The text with the newline is from a server control, so the value has to be replaced on the server and not on the client. Furthermore a ` ` tag won't work at all in a prompt.
type: Comment

http://stackoverflow.com/a/28307630
has comment: http://stackoverflow.com/comment/44967114
score: 1
has comment: http://stackoverflow.com/comment/44967166
has comment: http://stackoverflow.com/comment/44969094
has comment: http://stackoverflow.com/comment/44968866
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28307338
type: Answer
has comment: http://stackoverflow.com/comment/44969798
has body: Using the getByTitle method from sp.js you should use like this. SP.ListCollection.getByTitle() NOTE: With this you will get only the list name not the array of objects. Returns the list with the specified title from the collection. To get the items inside the list you should use this method. SP.List.getItems() Returns a collection of items from the list based on the specified query From SP.Listgetitemns docs Instead of just: var testList = listCollection.getByTitle("TestList"); Try var testList = listCollection.getByTitle("TestList"); listItemCollection = testList.getItems(""); // or use a CAMLQuery to be more specific context.load(listItemCollection); context.executeQueryAsync(onQuerySucceeded, onQueryFailed); Then it should be populated and should look like the second example.
has comment: http://stackoverflow.com/comment/44968491
answers question: http://stackoverflow.com/q/28307338
has comment: http://stackoverflow.com/comment/44967382
has comment: http://stackoverflow.com/comment/44969451
upvote count: 1

http://stackoverflow.com/a/28444589
answers question: http://stackoverflow.com/q/28421400
has body: Assuming you have components/ComponentName.coffee (or .js), and this file is registered in package.json as noflo: { components: { "ComponentName": "components/ComponentName.coffee" } } then you should be able to refer to it in a .fbp file as 'hello' -&gt; IN node(ComponentName) or 'hello' -&gt; IN node(packagename/ComponentName) where packagename is the project name set in package.json. The declaration in the package.json can be automated using grunt-noflo-manifest. It is the same for noflo-browser, just with component.json instead of package.json
upvote count: 4
type: AcceptedAnswer
downvote count: 0
score: 4
accepted answer of: http://stackoverflow.com/q/28421400
type: Answer
has comment: http://stackoverflow.com/comment/50224147

date
tags question: http://stackoverflow.com/q/28295681
tags question: http://stackoverflow.com/q/28347425
tags question: http://stackoverflow.com/q/28290055
tags question: http://stackoverflow.com/q/28367353
tag name: date
tags question: http://stackoverflow.com/q/28414145
tags question: http://stackoverflow.com/q/28335618
tags question: http://stackoverflow.com/q/28335803
tags question: http://stackoverflow.com/q/28370847
tags question: http://stackoverflow.com/q/28287920
tags question: http://stackoverflow.com/q/28378885
tags question: http://stackoverflow.com/q/28311750
tags question: http://stackoverflow.com/q/28344550
tags question: http://stackoverflow.com/q/28412342
tags question: http://stackoverflow.com/q/28394572
tags question: http://stackoverflow.com/q/28299169
tags question: http://stackoverflow.com/q/28373097
tags question: http://stackoverflow.com/q/28425132
type: Tag
tags question: http://stackoverflow.com/q/28425884
tags question: http://stackoverflow.com/q/28380867
tags question: http://stackoverflow.com/q/28342553
tags question: http://stackoverflow.com/q/28413855
tags question: http://stackoverflow.com/q/28326980
tags question: http://stackoverflow.com/q/28403940
tags question: http://stackoverflow.com/q/28344408
tags question: http://stackoverflow.com/q/28367765
tags question: http://stackoverflow.com/q/28338282
tags question: http://stackoverflow.com/q/28325061
tags question: http://stackoverflow.com/q/28343052
tags question: http://stackoverflow.com/q/28421475
tags question: http://stackoverflow.com/q/28348227
tags question: http://stackoverflow.com/q/28282874
tags question: http://stackoverflow.com/q/28329529
tags question: http://stackoverflow.com/q/28283012

http://stackoverflow.com/comment/45385906
comment on: http://stackoverflow.com/q/28336846
score: 0
type: Comment
type: QuestionComment
has text: Sorry for the delay. It is working now. Actually the first method itself is working now. I think the issue was due to browser settings in tablet.

http://stackoverflow.com/comment/45005550
comment on: http://stackoverflow.com/q/28329013
type: QuestionComment
has text: Tried "escape quotes"? Like this: `"{\"error\":\"Wrong account\"}"`?
score: 0
type: Comment

http://stackoverflow.com/comment/45477313
type: QuestionComment
has text: You can start with adding an afterEach where you disconnect your socket. You should probably also do some more cleanup of socket events that you add.
comment on: http://stackoverflow.com/q/28353076
score: 0
type: Comment

http://stackoverflow.com/comment/45067635
score: 0
has text: @kasperTaeymans — How would that test to tell the difference between the two implementations of `scroll` that the question describes? That won't even tell you if it is supported *at all* until the event is fired.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28362570

http://stackoverflow.com/comment/44967566
type: QuestionComment
comment on: http://stackoverflow.com/q/28290460
type: Comment
has text: Yes but it looks like it is supported from IE10 onward. https://msdn.microsoft.com/en-us/library/ie/hh772948%28v=vs.85%29.aspx. We have to support IE11.
score: 0

http://stackoverflow.com/comment/45193023
type: Comment
comment on: http://stackoverflow.com/a/28430657
has text: How could I use `jQuery.param()` in this situation? Can you provide an example usage please?
score: 0
type: AnswerComment

ios
tags question: http://stackoverflow.com/q/28339130
tags question: http://stackoverflow.com/q/28433197
type: Tag
tags question: http://stackoverflow.com/q/28303587
tags question: http://stackoverflow.com/q/28367884
tags question: http://stackoverflow.com/q/28343965
tags question: http://stackoverflow.com/q/28402685
tags question: http://stackoverflow.com/q/28329585
tags question: http://stackoverflow.com/q/28284093
tags question: http://stackoverflow.com/q/28345463
tags question: http://stackoverflow.com/q/28353067
tags question: http://stackoverflow.com/q/28322427
tags question: http://stackoverflow.com/q/28435612
tag name: ios
tags question: http://stackoverflow.com/q/28355957
tags question: http://stackoverflow.com/q/28425773
tags question: http://stackoverflow.com/q/28402370
tags question: http://stackoverflow.com/q/28375072
tags question: http://stackoverflow.com/q/28435847
tags question: http://stackoverflow.com/q/28362570
tags question: http://stackoverflow.com/q/28405455
tags question: http://stackoverflow.com/q/28336573
tags question: http://stackoverflow.com/q/28282073
tags question: http://stackoverflow.com/q/28350270
tags question: http://stackoverflow.com/q/28373349
tags question: http://stackoverflow.com/q/28431233
tags question: http://stackoverflow.com/q/28298585
tags question: http://stackoverflow.com/q/28366865

http://stackoverflow.com/comment/45205515
comment on: http://stackoverflow.com/q/28418496
score: 0
type: Comment
type: QuestionComment
has text: Yes. I can create a new build file fine. The problem is that I don't want to run that new build file as my default one. I want to add a menu item command that runs it.

http://stackoverflow.com/q/28388068
tagged with: canvas
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28388605
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: css
type: UnansweredQuestion
upvote count: 1
has title: How do I keep my fixed header flowing with rest of the body when using an off-canvas solution?
score: 1
type: Question
has body: I am using the headhesive plugin and it's really slick, however I can't get it to flow with the off-canvas navigation I am using. As you can see the header is now over-lapping, it should be shifting over with the rest of the content. I tried changing the position property in the .masthead--clone selector below but that didn't work. I also tried simply moving the element in the html, but that didn't work as well. Any suggestions? .masthead--clone { /* Required styles */ position: fixed; top: 0; left: 0; background: #fcf6e9; border-bottom: 1px solid rgba(253, 246, 232, .5)!important; box-shadow: 0px 3px 5px rgba(100, 100, 100, 0.49); /* Translate -100% to move off screen */ -webkit-transform: translateY(-100%); -ms-transform: translateY(-100%); transform: translateY(-100%); /* Animations */ -webkit-transition: all 300ms ease-in-out; -moz-transition: all 300ms ease-in-out; transition: all 300ms ease-in-out; }

http://stackoverflow.com/comment/45195120
has text: You are right, we need to quote the element name. I also changed the link to the relevant question.
comment on: http://stackoverflow.com/a/28431424
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28329382
has answer: http://stackoverflow.com/a/73423652
upvote count: 1094
has answer: http://stackoverflow.com/a/43892905
score: 1090
has answer: http://stackoverflow.com/a/67974404
has answer: http://stackoverflow.com/a/77655153
type: Question
has comment: http://stackoverflow.com/comment/45006194
has answer: http://stackoverflow.com/a/52475498
has answer: http://stackoverflow.com/a/74916084
tagged with: reactjs
has title: Understanding unique keys for array children in React.js
has answer: http://stackoverflow.com/a/72247160
has answer: http://stackoverflow.com/a/77384539
has answer: http://stackoverflow.com/a/50072646
has answer: http://stackoverflow.com/a/72090317
has answer: http://stackoverflow.com/a/59786738
has answer: http://stackoverflow.com/a/68532008
tagged with: javascript
answer count: 32
has answer: http://stackoverflow.com/a/28329550
accepted answer: http://stackoverflow.com/a/28329550
has answer: http://stackoverflow.com/a/67123655
has answer: http://stackoverflow.com/a/68928291
has answer: http://stackoverflow.com/a/64554032
has answer: http://stackoverflow.com/a/67098125
has answer: http://stackoverflow.com/a/79261393
has answer: http://stackoverflow.com/a/59029201
has comment: http://stackoverflow.com/comment/45006284
has answer: http://stackoverflow.com/a/77712625
has comment: http://stackoverflow.com/comment/45006431
favorite count: 0
has answer: http://stackoverflow.com/a/72159419
has answer: http://stackoverflow.com/a/77432431
has comment: http://stackoverflow.com/comment/45006395
has answer: http://stackoverflow.com/a/50551566
has answer: http://stackoverflow.com/a/60176969
has answer: http://stackoverflow.com/a/60824306
has answer: http://stackoverflow.com/a/65297567
has answer: http://stackoverflow.com/a/69208168
has answer: http://stackoverflow.com/a/55653411
downvote count: 4
has answer: http://stackoverflow.com/a/75045190
has answer: http://stackoverflow.com/a/70706019
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/66170364
has body: I'm building a React component that accepts a JSON data source and creates a sortable table. Each of the dynamic data rows has a unique key assigned to it but I'm still getting an error of: Each child in an array should have a unique "key" prop. Check the render method of TableComponent. My TableComponent render method returns: <TableHeader columns={columnNames}/> { rows } The TableHeader component is a single row and also has a unique key assigned to it. Each row in rows is built from a component with a unique key: <TableRowItem key={item.id} data={item} columns={columnNames}/> And the TableRowItem looks like this: var TableRowItem = React.createClass({ render: function() { var td = function() { return this.props.columns.map(function(c) { return {this.props.data[c]} ; }, this); }.bind(this); return ( { td(this.props.item) } ) } }); What is causing the unique key prop error?
has answer: http://stackoverflow.com/a/76891651
possible better answer: http://stackoverflow.com/a/43892905
linked to: http://stackoverflow.com/q/37982842

http://stackoverflow.com/comment/45090793
type: Comment
type: QuestionComment
has text: Code looks correct except for the javascript should be if(avatarType === 'gravatar')
comment on: http://stackoverflow.com/q/28375030
score: 0

http://stackoverflow.com/a/28399424
has comment: http://stackoverflow.com/comment/45134579
answers question: http://stackoverflow.com/q/28399393
accepted answer of: http://stackoverflow.com/q/28399393
has comment: http://stackoverflow.com/comment/45134637
score: 0
type: AcceptedAnswer
type: Answer
has body: You have to make sure that "oldBlock" contains a number before trying to do math with it (like adding 1): var oldBlock = +document.getElementsByClassName("block")[0].id; That's one way of doing it. You could also use parseInt(): var oldBlock = parseInt(document.getElementsByClassName("block")[0].id, 10); The value of the "id" property will be a string, so if you involve that in an addition operation JavaScript will treat it as string concatenation. By forcing it to be a number first, you'll get the effect you want.

twitter-bootstrap
tags question: http://stackoverflow.com/q/28280732
tags question: http://stackoverflow.com/q/28429412
tags question: http://stackoverflow.com/q/28282326
tags question: http://stackoverflow.com/q/28374525
tags question: http://stackoverflow.com/q/28309890
tag name: twitter-bootstrap
tags question: http://stackoverflow.com/q/28281616
tags question: http://stackoverflow.com/q/28335143
tags question: http://stackoverflow.com/q/28410704
tags question: http://stackoverflow.com/q/28362563
tags question: http://stackoverflow.com/q/28420485
tags question: http://stackoverflow.com/q/28421284
tags question: http://stackoverflow.com/q/28383667
tags question: http://stackoverflow.com/q/28336099
tags question: http://stackoverflow.com/q/28381433
tags question: http://stackoverflow.com/q/28362894
tags question: http://stackoverflow.com/q/28309604
tags question: http://stackoverflow.com/q/28347505
tags question: http://stackoverflow.com/q/28282691
tags question: http://stackoverflow.com/q/28346402
tags question: http://stackoverflow.com/q/28305914
tags question: http://stackoverflow.com/q/28314490
tags question: http://stackoverflow.com/q/28429190
tags question: http://stackoverflow.com/q/28346938
tags question: http://stackoverflow.com/q/28284357
tags question: http://stackoverflow.com/q/28396526
tags question: http://stackoverflow.com/q/28425957
tags question: http://stackoverflow.com/q/28365867
tags question: http://stackoverflow.com/q/28375030
tags question: http://stackoverflow.com/q/28383124
tags question: http://stackoverflow.com/q/28372890
tags question: http://stackoverflow.com/q/28314447
tags question: http://stackoverflow.com/q/28390802
tags question: http://stackoverflow.com/q/28365103
tags question: http://stackoverflow.com/q/28433975
tags question: http://stackoverflow.com/q/28281442
tags question: http://stackoverflow.com/q/28412881
tags question: http://stackoverflow.com/q/28285890
tags question: http://stackoverflow.com/q/28313106
tags question: http://stackoverflow.com/q/28338632
tags question: http://stackoverflow.com/q/28392555
tags question: http://stackoverflow.com/q/28433197
tags question: http://stackoverflow.com/q/28292437
tags question: http://stackoverflow.com/q/28436313
tags question: http://stackoverflow.com/q/28369836
tags question: http://stackoverflow.com/q/28430298
tags question: http://stackoverflow.com/q/28387161
tags question: http://stackoverflow.com/q/28317314
tags question: http://stackoverflow.com/q/28338132
tags question: http://stackoverflow.com/q/28360725
tags question: http://stackoverflow.com/q/28421727
tags question: http://stackoverflow.com/q/28296680
tags question: http://stackoverflow.com/q/28336639
tags question: http://stackoverflow.com/q/28393045
tags question: http://stackoverflow.com/q/28379593
tags question: http://stackoverflow.com/q/28384414
tags question: http://stackoverflow.com/q/28297706
type: Tag
tags question: http://stackoverflow.com/q/28391820
tags question: http://stackoverflow.com/q/28422035
tags question: http://stackoverflow.com/q/28334910
tags question: http://stackoverflow.com/q/28420106
tags question: http://stackoverflow.com/q/28379278
tags question: http://stackoverflow.com/q/28368417
tags question: http://stackoverflow.com/q/28325461
tags question: http://stackoverflow.com/q/28431937
tags question: http://stackoverflow.com/q/28312032
tags question: http://stackoverflow.com/q/28285052
tags question: http://stackoverflow.com/q/28322680
tags question: http://stackoverflow.com/q/28355976
tags question: http://stackoverflow.com/q/28339763
tags question: http://stackoverflow.com/q/28369286
tags question: http://stackoverflow.com/q/28321641
tags question: http://stackoverflow.com/q/28315211
tags question: http://stackoverflow.com/q/28361365
tags question: http://stackoverflow.com/q/28405913
tags question: http://stackoverflow.com/q/28376310
tags question: http://stackoverflow.com/q/28312240
tags question: http://stackoverflow.com/q/28367728
tags question: http://stackoverflow.com/q/28335583

http://stackoverflow.com/comment/45188242
comment on: http://stackoverflow.com/a/28428030
has text: @SamanthaJ to elaborate on the `.forEach` issue - if on the first iteration `tests[0]` is removed, there's no way to tell `.forEach` to revist the "new" `tests[0]` instead of jumping to `tests[1]`. That's why my plain `for` version above doesn't increment `i` if a match is found. That said, if there's at most one match then this doesn't matter.
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45044450
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28350044
has text: @eldarerathis just for the record, a single `\ ` in the character class with `*` would have no impact, as it is interpreted as the escape symbol. it would take a double backslash to cause trouble ( `move.split(/[/][\\*]?/)`; nb: the `RegExp` constructor takes a string as its argument, thus a double escape would apply, thus it takes `new RegExp("[/][\\\\*]?")` to fail). Anyway, you are perfectly right that the escaping inside the character class is superfluous.

http://stackoverflow.com/a/28299834
downvote count: 0
type: Answer
has body: It's because when you submit a form, it redirects the page to the action attribute. In your case, since you have none, it will refresh the page. So, you are changing the div2 to visible, but then the page refreshs and goes back to the initial state...
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28299401

http://stackoverflow.com/comment/45077680
score: 0
type: Comment
type: QuestionComment
has text: Stop using `click` events for `option`s. That may not even work across all browsers. Use `change` on the `select` instead. @phillip100 has a nicer example
comment on: http://stackoverflow.com/q/28368231

http://stackoverflow.com/comment/45099215
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28345717
has text: @jdphenix WeakMaps cannot be polyfilled unfortunately, but no ones should care about IE8 in 2015.

http://stackoverflow.com/a/28352676
downvote count: 0
score: 4
accepted answer of: http://stackoverflow.com/q/28352642
type: Answer
answers question: http://stackoverflow.com/q/28352642
has comment: http://stackoverflow.com/comment/45049115
upvote count: 4
has body: document.getElementById("b").addEventListener("click", function(){ document.getElementById("p").innerHTML = "white"; document.getElementById("p").style.color = "white"; }); or better... document.getElementById("b").addEventListener("click", function(){ var el = document.getElementById("p"); el.innerHTML = "white"; el.style.color = "white"; });
type: AcceptedAnswer

http://stackoverflow.com/a/28384557
has comment: http://stackoverflow.com/comment/45107098
downvote count: 0
answers question: http://stackoverflow.com/q/28383478
has comment: http://stackoverflow.com/comment/45120321
type: Answer
score: 2
upvote count: 2
has body: How about this: string AlienJSON = "your alien JSON"; JavaScriptSerializer js = new JavaScriptSerializer(); string ProperJSON = js.Serialize(js.DeserializeObject(AlienJSON)); Or just consume the object after deserialize instead of converting it back to string and passing it to a JSON parser for extra headache As Mouser also mentioned you need to use System.Web.Script.Serialization which is available by including system.web.extensions.dll in your project and to do that you need to change Target framework in project properties to .NET Framework 4. EDIT Trick to consume deserialized object is using dynamic JavaScriptSerializer js = new JavaScriptSerializer(); dynamic obj = js.DeserializeObject(AlienJSON); for JSON in your question simply use string body = obj["body"]; or if your JSON is an array if (obj is Array) { foreach(dynamic o in obj){ string body = obj[0]["body"]; // ... do something with it } }

http://stackoverflow.com/comment/45202962
has text: You forgot to mention that to have the effect he wishes, the url **must** start with `http://`, `https://`or even `//` do identify that it is a full url. Without it, the browser will (correctly) assume that the IP is simply a folder in the server.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28436279
type: AnswerComment

http://stackoverflow.com/q/28363869
has comment: http://stackoverflow.com/comment/45069492
answer count: 2
has title: Highlight next menu item using jquery
has comment: http://stackoverflow.com/comment/45069579
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28364361
favorite count: 0
upvote count: 3
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/45069720
type: UnansweredQuestion
has body: Hi I am trying to implement a feature in my website where when i click on a menu item the highlight should be able to flow to the next menu item.From the below example if I click on people the menu should highlight people and then also highlight the next case in the menu which is tourist.. I am using CSS for hover but what I understand from other posts is that a:active doesn't work with CSS? This is what I have so done so far: HTML People Tourist Joints Project Products cafes jQuery CSS #nav{ width:100%; text-align:center; min-width:1300px; height:80px; position:absolute; top:0; left:0; background:#fff; list-style:none; border-bottom: 1px solid #000; } #nav li{ display:inline; } #nav .nav{ display:inline-block; background-color:#000; color:#FFF; font-family: 'Oswald', sans-serif; letter-spacing:1px; font-size:16pt; line-height:18pt; font-weight:400; text-decoration:none; margin-right: 3px; margin-left: 3px; margin-top:35px; padding:0px 3px 2px 3px; } #nav .nav:hover{ background:#FFFF00; color:#000; } .active{ background:#FFFF00; color:#000; } Please help me with this.I am stuck up on this
type: Question
score: 3
tagged with: jquery-ui
has answer: http://stackoverflow.com/a/28364371
has comment: http://stackoverflow.com/comment/45069444

http://stackoverflow.com/a/28388526
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45115124
has comment: http://stackoverflow.com/comment/45114913
has comment: http://stackoverflow.com/comment/45114977
has comment: http://stackoverflow.com/comment/45115330
has comment: http://stackoverflow.com/comment/45115243
has comment: http://stackoverflow.com/comment/45115801
has comment: http://stackoverflow.com/comment/45114998
has comment: http://stackoverflow.com/comment/45115205
has comment: http://stackoverflow.com/comment/45115270
has body: On your page that you display the data, you have an error on the html structure: Select Category First change to: As you can see, you are closing the div first and than adding an option and than closing the select which seems like the main issue.
has comment: http://stackoverflow.com/comment/45114861
has comment: http://stackoverflow.com/comment/45115104
type: Answer
has comment: http://stackoverflow.com/comment/45115022
has comment: http://stackoverflow.com/comment/45115149
has comment: http://stackoverflow.com/comment/45114726
has comment: http://stackoverflow.com/comment/45115348
has comment: http://stackoverflow.com/comment/45115357
has comment: http://stackoverflow.com/comment/45115108
score: 1
has comment: http://stackoverflow.com/comment/45115301
has comment: http://stackoverflow.com/comment/45114848
has comment: http://stackoverflow.com/comment/45115256
upvote count: 1
has comment: http://stackoverflow.com/comment/45115688
has comment: http://stackoverflow.com/comment/45115075
has comment: http://stackoverflow.com/comment/45115904
has comment: http://stackoverflow.com/comment/45115639
answers question: http://stackoverflow.com/q/28388227
has comment: http://stackoverflow.com/comment/45115332
has comment: http://stackoverflow.com/comment/45114897
has comment: http://stackoverflow.com/comment/45114880
has comment: http://stackoverflow.com/comment/45115333
has comment: http://stackoverflow.com/comment/45114702
accepted answer of: http://stackoverflow.com/q/28388227

http://stackoverflow.com/q/28358780
favorite count: 0
has body: I have HTML forms being created by Javascript. I also have regular forms not created by Javascript. When I submit the regular HTML form, the PHP script parses it just fine, but when I submit the Javascript created forms, it's not parsed. I can't for the life of me figure out why one parses, and the other one doesn't. Javascript: function addWeapon(){ var weapsForm = document.createElement("form"); weapsForm.setAttribute('name',"savefile"); weapsForm.setAttribute('method',"post"); weapsForm.setAttribute('action',""); var weapsName = document.createElement("input"); weapsName.setAttribute('type',"text"); weapsName.setAttribute('name',"textdata[]"); var weapsNameQt = document.createElement("input"); weapsNameQt.setAttribute('type',"number"); weapsNameQt.setAttribute('name',"textdata[]"); weapsNameQt.setAttribute('value',"0"); var weapsNameSubmit = document.createElement("input"); weapsNameSubmit.setAttribute('type',"submit"); weapsNameSubmit.setAttribute('name',"submitsave"); weapsNameSubmit.setAttribute('value',"Done!"); weapsForm.appendChild(weapsName); weapsForm.appendChild(weapsNameQt); weapsForm.appendChild(weapsNameSubmit); document.getElementsByTagName('body')[0].appendChild(weapsForm); } And here's the PHP code which parses the HTML form no problem. I'd also like to add, the Javascript created HTML is exactly the same as the regular HTML. PHP: &lt;?php if (isset($_POST)){ if ($_POST['submitsave'] == "Done!" &amp;&amp; !empty($_POST['filename'])) { foreach($_POST["textdata"] as $text){ if(!file_exists($_POST['filename'] . ".txt")){ $file = tmpfile(); } $file = fopen($_POST['filename'] . ".txt","a+"); while(!feof($file)){ $old = $old . fgets($file); } file_put_contents($_POST['filename'] . ".txt", trim($text).PHP_EOL, FILE_APPEND); } fclose($file); } } ?&gt; Thanks for any help guys! EDIT: I forgot to mention the "filename" field is in the HTML document, and is not created by Javascript. EDIT: Also, the file is created on the server, but the forms are not being p…
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45060636
has comment: http://stackoverflow.com/comment/45062928
tagged with: php
has answer: http://stackoverflow.com/a/28359003
has answer: http://stackoverflow.com/a/28358842
accepted answer: http://stackoverflow.com/a/28358842
type: AnsweredQuestion
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45061355
has answer: http://stackoverflow.com/a/28359643
type: Question
has comment: http://stackoverflow.com/comment/45062262
has title: PHP not parsing Javascript created HTML forms
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28359003
upvote count: 2
answer count: 3

http://stackoverflow.com/comment/45031647
type: Comment
comment on: http://stackoverflow.com/a/28341923
has text: It seems that your file also has some text in it which is not rendering, not quite shure why... could be a bug in WebView, badly designed webpage, or other things. EDIT: try enabling JavaScript in your webview (See the other answer above)
score: 0
type: AnswerComment

http://stackoverflow.com/comment/52340696
type: Comment
has text: Agree, DIMM. `angular.element(...).scope()` would be better.
comment on: http://stackoverflow.com/a/28417199
type: AnswerComment
score: 0

http://stackoverflow.com/q/28296142
has comment: http://stackoverflow.com/comment/44944860
has title: Using Google Custom Search engine with a little privacy
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/57346932
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28381064
has comment: http://stackoverflow.com/comment/44947082
score: 1
tagged with: search-engine
favorite count: 0
upvote count: 1
type: AnsweredQuestion
tagged with: google-search
has body: I would like to use a Google Custom Search Engine on my website. With Google's default implementation, you have to put Javascript on each page that has the search box. For privacy reasons, I would like to load that Javascript only for those users who actually use the search engine. I would like to have a generic &lt;form&gt; &lt;input type=text&gt; &lt;sinput type=submit&gt; &lt;/form&gt; on each page and then submit to another page where the Google code gets loaded and executed without the user having to click a 2nd time. I could easily place the Google code on a page and just have a link to the search page on every page, but I can't get it to work with a search box on very page and no 2nd click from the user.
has answer: http://stackoverflow.com/a/28381064
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/57346932
has comment: http://stackoverflow.com/comment/44970048

http://stackoverflow.com/comment/44969680
has text: Good to hear that it solved your issue! I will write an answer that is a bit more precise for other readers and submit it, so you can accept that if you still agree :)
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28305949
type: QuestionComment

http://stackoverflow.com/comment/45493822
score: 0
comment on: http://stackoverflow.com/q/28382105
type: Comment
has text: Have found that the URL
type: QuestionComment

http://stackoverflow.com/comment/45158103
score: 1
type: AnswerComment
has text: This doesn't work if I delete a character, or use mouse to paste something into it.
type: Comment
comment on: http://stackoverflow.com/a/28412362

http://stackoverflow.com/comment/45009375
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28331016
has text: what is your js code? Also - side point is encore.scranton.edu your domain? Have you checked for CSRF issues?
score: 0

http://stackoverflow.com/comment/45151492
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28408599
has text: @closure Glad to hear it helped :D. Please make sure you use a `if ( matches)` statement to take care of cases where the string is not matched by your regex.
type: AnswerComment

http://stackoverflow.com/q/28369798
downvote count: 0
tagged with: meteor
tagged with: meteor-blaze
favorite count: 0
has comment: http://stackoverflow.com/comment/45083662
accepted answer: http://stackoverflow.com/a/28371101
has body: I need to compare two template helper values that are located in nested templates. I was wondering if there is an easy way to compare two template helpers (one from the parent template) in an {{#if}} statement like so: {{#each bids}} {{#if bid.price===../job.price}} some text {{else}} some other text {{/if}} {{/each}} If you can't do this, I guess the other option is to use Template.parentData in a new template inside the each block? I'm not opposed to this, just the way I outlined above would be much faster and simpler if it's possible. Thanks.
tagged with: templates
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/51815595
upvote count: 2
tagged with: spacebars
possible better answer: http://stackoverflow.com/a/28370839
has title: Compare template helper values in Spacebars {{#if}} block
type: Question
has answer: http://stackoverflow.com/a/28370839
has comment: http://stackoverflow.com/comment/45082806
tagged with: javascript
has answer: http://stackoverflow.com/a/28371101
answer count: 2
score: 2
has comment: http://stackoverflow.com/comment/45081129

http://stackoverflow.com/comment/44999832
has text: Ok I see, let me check what I can do to help.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28324015

http://stackoverflow.com/comment/45000434
has text: @MikeK can you explain **why** you're adding it over and over again to the same element? Most plugins like that are not designed to be removed once they've been applied.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28326337
type: Comment

http://stackoverflow.com/q/28359335
type: Question
has body: In Meteor there is the Accounts.onCreateUser function that calls when a user is created. Is is possible to do this on collections other than the User collection?
answer count: 1
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28359375
tagged with: meteor
type: UnansweredQuestion
has title: On Create collection in Meteor

http://stackoverflow.com/q/28355976
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: 2
type: AnsweredQuestion
downvote count: 0
tagged with: twitter-bootstrap
has title: Bootstrap affix in both left and right side of the page
type: Question
has body: This is how my page is structured. Left column (col-lg-3) Center Column (col-lg-6) Right column (col-lg-3) While my main content would be in center column, I want my left column and right column to be fixed (or sticky ) after certain scroll position. Most of the solutions I found in the internet was with 1 left column to be sticky. I think there's something javascript works needs to be done. Please visit http://www.bootply.com/LiOE57ZlwI. So far left column is working exactly the way I want it to be..and I want right column to behave same as left column. Also please visit http://www.bootply.com/101100. I want the exact same behavior. I don't want to use this code because it's all messed up in low screen size. Thanks
tagged with: javascript
upvote count: 2
has answer: http://stackoverflow.com/a/28356157
accepted answer: http://stackoverflow.com/a/28356157
answer count: 1
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/45003239
score: 0
comment on: http://stackoverflow.com/q/28286385
type: Comment
type: QuestionComment
has text: The test does not pass - did you try running the code?

http://stackoverflow.com/q/28412671
has comment: http://stackoverflow.com/comment/45165558
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/1357118
has comment: http://stackoverflow.com/comment/45158888
has comment: http://stackoverflow.com/comment/45162105
linked to: http://stackoverflow.com/q/18793392
linked to: http://stackoverflow.com/q/18971284
has comment: http://stackoverflow.com/comment/45163618
possible better answer: http://stackoverflow.com/a/28412828
has title: How can I highlight a link on first click; and follow it on second click, unless clicked elsewhere, then reinitialize non-highlighted state?
has comment: http://stackoverflow.com/comment/45161230
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45163376
accepted answer: http://stackoverflow.com/a/28786292
upvote count: 3
has comment: http://stackoverflow.com/comment/45159015
has body: How can one (probably using the usual suspect Javascript), have a few (at first non-highlighted links) and then achieve: Toggle on (make permanent) and off highlighting & differentiate between highlighting and redirect? Clicking on a term makes higlighting permanent (toggle on). Clicking again (after toggle on) on that term redirects to article. Clicking elsewhere removes higlighting (toggle off). EDIT (to clarify, after question had been put on hold): Toggle highlighting I understand this highlighting can be handled using .addClass("active"); and .removeClass("active");, but have no clue on how to include the links when the Class("active") is added and/or how to disable the links when that Class is removed. CSS would then need (e.g.) .active{background:green} Toggle redirect (link follow) So, it is now figured out preventDefault(); plays a central role in enabling or disabling link following; since, as one can read in its entry in the jQuery-api: If this method is called, the default action of the event will not be triggered. For example, clicked anchors will not take the browser to a new URL. Another way to do this might be using return false;. The difference between the 2 has to do with propagating (or "bubbling up") the DOM. About this difference, one can read at CSS-tricks or have a look at the answer below by somethinghere, when he adds event.stopImmediatePropagation(); to stop this bubbling up The difference between the two is the following: return false; also prevents this propagation by itself, whereas preventDefault(); doesn't. The CSS-tricks-article sais: function() {return false;} Is equal to: function(e) {e.preventDefault(); e.stopPropagation();} More literature about the difference can be found on StackExchange, which might feature some duplicate posts? What's the difference between e.preventDefault(); and return false?, event.preventDefault() vs. return false, event.preventDefault() vs. return false (no jQuery), Difference - "e.preventDefault();" and …
linked to: http://stackoverflow.com/q/2017755
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45162332
has comment: http://stackoverflow.com/comment/45165663
has comment: http://stackoverflow.com/comment/45164725
has comment: http://stackoverflow.com/comment/45160300
tagged with: javascript
has comment: http://stackoverflow.com/comment/45160136
linked to: http://stackoverflow.com/q/6654958
answer count: 3
score: 2
linked to: http://stackoverflow.com/q/111102
has answer: http://stackoverflow.com/a/28786292
has comment: http://stackoverflow.com/comment/45163382
has comment: http://stackoverflow.com/comment/45164290
has comment: http://stackoverflow.com/comment/45162221
tagged with: jquery
has comment: http://stackoverflow.com/comment/45165412
has comment: http://stackoverflow.com/comment/45159960
linked to: http://stackoverflow.com/q/20003458
favorite count: 0
has answer: http://stackoverflow.com/a/28412828
has answer: http://stackoverflow.com/a/28412800
has comment: http://stackoverflow.com/comment/45161733

http://stackoverflow.com/q/28316950
accepted answer: http://stackoverflow.com/a/28316986
type: AnsweredQuestion
has body: I have Model In javascript that I fill this model with value except one of them . var files = $("#fileUpload").get(0).files[0]; // Add the uploaded image content to the form data collection if (files.length &gt; 0) { data.append("UploadedImage", files[0]); } var ResturantSharingViewModel = { Type: $("#SharingTargetType").val(), SharingTitle: $("#SharingTitle").val(), content: $("#Content").val(), ItemId : $("#ItemId").val(), Photos: files[0] } The Photo parameter in Model is undefined . i want fill the Photo object with array of files but i do not know how to do it ?
has answer: http://stackoverflow.com/a/28316986
type: Question
upvote count: 2
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/44982998
downvote count: 3
answer count: 1
favorite count: 0
has title: Fill the object with array in javascript

http://stackoverflow.com/a/28289488
answers question: http://stackoverflow.com/q/28289459
type: Answer
has body: when referencing an element in jquery, you need to use it's css selector. For an element with an id "myDivName" that selector would be #myDivName so your jquery would look like: $('#kittens').click(function() { $('#myDivName').html('Kittens'); });
score: 0

http://stackoverflow.com/comment/45012884
score: 0
comment on: http://stackoverflow.com/q/28332815
has text: can you show the code on jsfiddle or something?
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28385498
upvote count: 1
has body: Change the tuple to list: List&lt;List&lt;object&gt;&gt; list = new List&lt;List&lt;object&gt;&gt;(); list.Add(new List&lt;object&gt; {"Feb 2 to Feb 6", 1}); list.Add(new List&lt;object&gt; {"Feb 7 to Feb 15", 10}); list.Add(new List&lt;object&gt; {"Feb 16 to Feb 24", 4}); return Json(list, JsonRequestBehavior.AllowGet);
downvote count: 0
answers question: http://stackoverflow.com/q/28385418
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28385418
type: Answer
score: 1

http://stackoverflow.com/q/28346945
answer count: 1
duplicate of: http://stackoverflow.com/q/2802341
favorite count: 0
has body: I had the problem of sorting alphanumeric array. sort pattern number comes first then letter 09312d27-4ddc-458e-95dd-74531f787368, 1edcdde8-702e-4703-a505-ca81b77accdd, ..... Code: var alphaNumericArray = ['8a337e46-7d3f-46bc-b661-579f8d25fe09', '09312d27-4ddc-458e-95dd-74531f787368', 'e7c5fba1-ce59-439a-a560-8f558e7c0ac4', '1edcdde8-702e-4703-a505-ca81b77accdd', '2f66ba6c-7fd2-4d52-8ed6-b0ee6d4d0310', '7529217d-ee80-41eb-ade7-208674924ab9', '523f4f75-8d0a-4ad1-8f40-e8bc679956be', '80871291-c8de-47d9-9b02-3f8444c5d64e', '7529217d-ee80-41eb-ade7-208674924ab9']; alphaNumericArray.sort(function(a, b) { a = a.value; b = b.value; return a-b; }); //console.log(alphaNumericArray); //alert(alphaNumericArray); The output is not sorted. It shows me same array in alert popup and in console log.
has title: How to sort alphanumeric array in javascript
type: AnsweredQuestion
tagged with: alphanumeric
linked to: http://stackoverflow.com/q/2802341
has comment: http://stackoverflow.com/comment/45038356
downvote count: 1
has comment: http://stackoverflow.com/comment/45038120
type: Question
has answer: http://stackoverflow.com/a/28347207
has comment: http://stackoverflow.com/comment/45038628
tagged with: algorithm
upvote count: 0
tagged with: arrays
tagged with: javascript
score: -1
tagged with: sorting
accepted answer: http://stackoverflow.com/a/28347207
has comment: http://stackoverflow.com/comment/45038075
has comment: http://stackoverflow.com/comment/45038330
has comment: http://stackoverflow.com/comment/45038339
has comment: http://stackoverflow.com/comment/45038073
has comment: http://stackoverflow.com/comment/45038040

http://stackoverflow.com/comment/45093781
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28369355
has text: This sounds like a bug in Chrome. Could you share some sample code for verification?

http://stackoverflow.com/q/28360074
downvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/28363193
tagged with: mobile-application
tagged with: javascript
type: UnansweredQuestion
has title: creating a blackjack game using javascript, html and css only
favorite count: 0
type: Question
tagged with: android
tagged with: http://stackoverflow.com/tag/html
tagged with: blackjack
score: 0
has body: I am coding a mobile app using PhoneGap, and I am only using HTML and JavaScript. so far, i have made all of the betting functions, such as starting an initial bet, buttons to increase or decrease the bet, and the functions that are called when the player wins, loses, or gets blackjack. My problem is with the deck. It might be helpful to know what I called my functions, I don't know, but here they are anyway: function win() adds the value in the bet to the total money. function lose() subtracts the value that was bet from the total money. function blackjack() adds one and a half times the value bet to the total money, and I used the Math.floor() on that one. So with that in mind, I have two questions. I want to have a deck that is just like a physical deck. I might be a little picky, but i want it so that if a card is shown, it will not be called again until all 52 cards are used, or the deck is shuffled. The cards can come out at random, i don't care as long as the cards are not repeated. also, how would you separate the piles that are dealt? For example, one pile is the user, the other is the dealer. i kinda think this is needed because we will use the card values to add and decide who has won. This next part is not required, but would be nice. Would there be a way that I could add an image to the card that is chosen, so that the player can visually see the card that is drawn? Using JavaScript, html and css __ONLY__, could I save a value to the apps internal memory or something? What I'm trying to achieve is that when, the player closes the app, the amount of money that is their "winnings" will be saved, and shown the next time they open the app. I also have one more question, but this one is not part of the app. Do anyone know how old you have to be to sign up for a Google developer account? I want to publish my app when I finish, but I'm only 17 and I don't know if I'm allowed to create a Google developer account to post my app on Google play because of my age.
upvote count: 1

http://stackoverflow.com/comment/45105498
score: 0
has text: added less and html, thank you
type: Comment
comment on: http://stackoverflow.com/q/28383558
type: QuestionComment

http://stackoverflow.com/comment/44978399
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28314241
has text: jfriennd00 please check the updated question

http://stackoverflow.com/comment/92863017
score: 4
comment on: http://stackoverflow.com/a/28283399
type: AnswerComment
has text: Wow that's confusing. They should just make 'day' represent day and then have a separate one for 'dayOfMonth'.
type: Comment

http://stackoverflow.com/a/28350559
type: Answer
upvote count: 1
has body: you can do a javascript function to be called on the onclick event in the submit button , like this Save and Continue and define the function callAfunction() { //do the checks with: document.getElementById('close').value // display an alert("a message"); }
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28350387

http://stackoverflow.com/q/28374580
type: Question
answer count: 1
has body: Is there a way with javascript to replace an iframe, for example with a link like this... go here only if browser detects IE9? If I write a pure javascript code from my area. I want this action to occur before the iframe is fully loaded onto the page.
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28374693
linked to: http://stackoverflow.com/q/843680
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28374693
has title: How to replace iframe in IE9

http://stackoverflow.com/q/28436142
type: AnsweredQuestion
has body: This should be simple to do. I just can't pass the value of the input to the product-details view. I'm trying to create a unique template page for each item added to the list. Clicking the 'details' link should take the user to the unique page. I understand how dynamic segments works, I'm just getting stuck somewhere. Thanks! http://emberjs.jsbin.com/midivu/1/edit?html,js,output
type: Question
score: 0
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28436318
tagged with: ember.js
has title: having trouble with dynamic segments in emberjs
has answer: http://stackoverflow.com/a/28436318

http://stackoverflow.com/comment/45098397
score: 3
type: AnswerComment
has text: Isn't this more procedural than functional?
type: Comment
comment on: http://stackoverflow.com/a/28379415

http://stackoverflow.com/q/28338847
accepted answer: http://stackoverflow.com/a/28338885
possible better answer: http://stackoverflow.com/a/28338963
tagged with: php
type: AnsweredQuestion
tagged with: forms
has body: Why my form is not again submitting to another URL after ajax submit. with the below script i want to post form with ajax and then submit same form to other url. first my form will submit to Ajax URL (http://www.mywebsite.com/insertdata.php) and then it same form will submit to form action URL (http://www.example.com/mail.php) HTML &lt;form id="contact_form" action="http://www.example.com/mail.php" method="post" novalidate="novalidate" data-track="formSubmit" name="contact_form"&gt; &lt;!------Form Elements -------&gt; &lt;input class="form-control submit" type="submit" value="Submit"&gt; &lt;/form&gt; JavaScript $("form").on("submit", function(event) { event.preventDefault(); $.ajax({ url: "http://www.mywebsite.com/insertdata.php", type: "post", crossDomain: true, data: $(this).serialize(), success: function(responce) { console.log(responce); return true; } }); });
type: Question
upvote count: 1
has answer: http://stackoverflow.com/a/28338963
has comment: http://stackoverflow.com/comment/45023044
tagged with: javascript
tagged with: jquery
has title: Post form with ajax and then submit same form to other url
favorite count: 0
tagged with: ajax
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/45023031
downvote count: 1
has answer: http://stackoverflow.com/a/28339061
has answer: http://stackoverflow.com/a/28338885

http://stackoverflow.com/a/28353399
has body: I think what you have is perfectly fine in the Meteor world. Since you do not want to instantiate anything when the Template is created, and you are not looking to track the state of the Template, then registering an event to call that bit of jQuery code seems like the straightforward way of going about it. EDIT: Looked at your response to another answer, here is what you need: Template.item.rendered = function () { # this.$() will only look for elements inside this template this.$('.materialboxed').materialbox(); }; To optimize your implementation a bit, we only initiate your jQuery plugin on the element that is clicked on. Instead of initializing it onto every element with a .materialboxed class each time an item template is rendered. The template.$() function works exactly like jQuery but only finds elements within the template. I am not sure how this function works with jQuery plugins, but you could first return the exact element using this function, save it, and then convert it to a jQuery object manually. More info on this here: http://docs.meteor.com/#/basic/Blaze-TemplateInstance-findAll
has comment: http://stackoverflow.com/comment/45091347
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28351197
has comment: http://stackoverflow.com/comment/45051322

http://stackoverflow.com/a/28388607
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28385821
answers question: http://stackoverflow.com/q/28385821
type: AcceptedAnswer
has body: The problem was that the $post variable wasn't declared as global, so get_post_meta failed because it wasn't passed a valid post ID. Just add global $post to the beginning of the function to reference the global variable. See php docs here: http://php.net/manual/en/language.variables.scope.php

http://stackoverflow.com/a/31653529
score: 2
answers question: http://stackoverflow.com/q/28285502
downvote count: 0
has body: I may be very late to answer this, but here is a similar question: jsTree AJAX search with some node childs? The accepted answer has detailed information what gets sent to the server and what the response should be (an array of unique parent IDs). Make sure you remove the function from search.ajax.data - this property can not be a function - it is a standard jQuery AJAX config (so it should be an object, and jstree will add a str property to it). Btw, make sure you can actually send requests to 127.0.0.1:5000 because of the same origin policy - maybe you need to add CORS headers. If this does not help, please provide the server response (headers and body).
upvote count: 2
type: Answer

http://stackoverflow.com/comment/45077854
has text: i guess what im saying is that you cant use the `.click()` on a select because the click even will trigger before you even select something (it'll trigger when you open the select in essence), you'll have to use this `.change()`, but you can put the rest of your general code for animation (if its functional) inside this change event and it'll work as you intended it to work
type: AnswerComment
comment on: http://stackoverflow.com/a/28368454
score: 0
type: Comment

http://stackoverflow.com/a/28393708
has comment: http://stackoverflow.com/comment/45124670
upvote count: 3
has body: Adapted from this solution to a similar problem the below should do what you want: $(function() { $('#select').filterByValues( $('.filterElements') ); $('.filterElements').change(); }); jQuery.fn.filterByValues = function(masterSelects) { return this.each(function() { var select = this; var options = []; $(select).find('option').each(function() { options.push({value: $(this).val(), text: $(this).text()}); }); $(select).data('options', options); masterSelects.bind('change', function() { var options = $(select).empty().scrollTop(0).data('options'); var vals=[]; $(masterSelects).each(function(i,e){ vals.push('^'+$.trim($(e).val())+'$' ); }); var search = vals.join('|'); var regex = new RegExp(search,'gi'); $.each(options, function(i) { var option = options[i]; if(option.value.match(regex) !== null) { $(select).append( $(' ').text(option.text).val(option.value) ); } }); }); }); }; (Select category) Terræn Fundamentsystem Vægsystem Dæksystem Tagsystem (Select category) Terræn Fundamentsystem Vægsystem Dæksystem Tagsystem Jordprofil Befæstet Areal Beplantning Fundamentkonstruktion Bærelag Åbning Lukning Inddækning Afslutning Afskærmning Fuge Samling Overflade
downvote count: 1
answers question: http://stackoverflow.com/q/28393102
has comment: http://stackoverflow.com/comment/45124940
has comment: http://stackoverflow.com/comment/45124270
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45124597
accepted answer of: http://stackoverflow.com/q/28393102
has comment: http://stackoverflow.com/comment/45125281
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/45124214

http://stackoverflow.com/a/28337480
has body: Input type submit is trying to submit a form. You need to add an action to that submit button or you can change it to a button and the event will fire.
has comment: http://stackoverflow.com/comment/45020908
has comment: http://stackoverflow.com/comment/45020726
has comment: http://stackoverflow.com/comment/45020803
type: Answer
answers question: http://stackoverflow.com/q/28337409
score: 0
has comment: http://stackoverflow.com/comment/45020689
has comment: http://stackoverflow.com/comment/45020837
has comment: http://stackoverflow.com/comment/45020999

http://stackoverflow.com/comment/44992275
comment on: http://stackoverflow.com/a/28322009
score: 0
type: AnswerComment
has text: aha. I should put this outside of the addeventlistener() right?
type: Comment

http://stackoverflow.com/a/28351583
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28351515
answers question: http://stackoverflow.com/q/28351515
has comment: http://stackoverflow.com/comment/45047382
upvote count: 10
type: Answer
downvote count: 0
has body: You are almost there... The function is correct, you just have to assign it to the change event of the input: &lt;script type="text/javascript"&gt; $(document).ready(function () { function onchange() { //Since you have JQuery, why aren't you using it? var box1 = $('#field_1'); var box2 = $('#field_2'); box2.val(box1.val()); } $('#field_1').on('change', onchange); });
score: 10

http://stackoverflow.com/a/28391915
type: Answer
has body: Use keyup event, there is no onkeyup event $('#name').keyup(function(){ var info = $('#name').val(); if(info.length &gt;3){alert('thank you');} });
upvote count: 2
answers question: http://stackoverflow.com/q/28391898
score: 2
downvote count: 0

http://stackoverflow.com/a/28312499
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28312382
has body: As far as the information you have provided, you cannot access a parameter that is not yet in scope from the class methods. in your example spelling corrected //'array' is undefined / out of scope this.doSomething = function(name,array){ //array is defined / in scope! }; Otherwise if the variable array you are talking about is defined in the scope somewhere, the first answer will work.

http://stackoverflow.com/comment/45161023
type: QuestionComment
type: Comment
has text: Think you're calling init before you receive the API response. Try moving the `$http` call to the bottom and move `init()` to the `success` callback
score: 0
comment on: http://stackoverflow.com/q/28411966

http://stackoverflow.com/a/28282595
accepted answer of: http://stackoverflow.com/q/28282538
has comment: http://stackoverflow.com/comment/44919509
score: 0
has body: Try to change #container style with this: #container { position: fixed; top: 50%; left: 50%; max-height: 100%; overflow-y: auto; transform: translate(-50%, -50%); }
type: Answer
answers question: http://stackoverflow.com/q/28282538
has comment: http://stackoverflow.com/comment/44919581
type: AcceptedAnswer

http://stackoverflow.com/a/28315856
type: Answer
answers question: http://stackoverflow.com/q/28310943
score: 2
downvote count: 0
upvote count: 2
has body: This is a tricky one... I can think of some problems this can have: The server doesn't know what ~ refers to (are you running windows?) The user running the server is not the same as the one you are logged in as. (~ stands for home directory, and when server evaluates it'll lead to user running the server home directory). The server is configured to ignore every request which is above it's www / html / localweb folder. (Altough in this case it would be weird to reply with a 404, a 403 would make more sense) By the way, this is only possible if the server and the client are on the same machine. I don't know why you want it, but if you pretend to upload a website and have its background set to some field on the client machine, then simply forget about it.

http://stackoverflow.com/q/28416581
favorite count: 0
accepted answer: http://stackoverflow.com/a/28416628
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
upvote count: 1
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28416628
tagged with: javascript
has comment: http://stackoverflow.com/comment/45166289
score: 0
has title: how to get the values inside the li using jquery
answer count: 1
has body: How can i get the values of the index 1,2,3 that is inside the using jquery ? American Black Bear Brown Bear Giant Panda
tagged with: jquery

http://stackoverflow.com/comment/45180570
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28423796
has text: See https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest for all the properties of XMLHttpRequest.
score: 0

http://stackoverflow.com/q/28356657
type: Question
answer count: 2
has body: Hopefully, a bit of a newbie JS question. (I searched &amp; found some sort-of similar ones, but not quite this situation...) Ok, I have a simple form like this: &lt;form method="POST" action="foo.php"&gt; &lt;textarea name="inputBox123"&gt;&lt;/textarea&gt; &lt;input type="submit" value="Go" name="B1" /&gt; &lt;/form&gt; Of course, the form has a normal submit button. But, in addition to that, I would like to have a code word like "okaygo" (or anything such string) such that, if the textarea contains this word (either if it is typed, pasted, etc.), then the form would auto-submit, just as though the button were pressed. So, I figure I need some way to continually monitor the content of the text-area, and evaluate it against whether that string is present -- and if so submit. Can anyone show me how to do that, or at least point me in the right direction? (Just for anyone wanting to know why... I work w/ some people who use scanners to enter form data. Usually they scan data into the form and click the submit button. But, they also said they could save time if they didn't always have to put the scanner down and click the submit button. So, I told them maybe I could come up w/ a barcode on the screen coded for some specific string like 12345678 or okaygonow, or whatever. So, the idea is, they scan their stuff, scan the barcode, the string appears in the form, it's detected by Javascript, and then the form submits &amp; they don't have to even touch the keyboard / mouse. Anyway, that's the idea.)
tagged with: textarea
downvote count: 0
has answer: http://stackoverflow.com/a/28356795
tagged with: javascript
tagged with: submit
has answer: http://stackoverflow.com/a/28357700
favorite count: 0
score: 2
upvote count: 2
type: UnansweredQuestion
has title: Javascript autosubmit form when specific string detected in textarea
tagged with: forms

http://stackoverflow.com/q/28382065
has comment: http://stackoverflow.com/comment/45103658
tagged with: session
has comment: http://stackoverflow.com/comment/45108978
has comment: http://stackoverflow.com/comment/45105312
type: Question
has comment: http://stackoverflow.com/comment/45108217
answer count: 1
tagged with: upload
tagged with: javascript
has comment: http://stackoverflow.com/comment/45107299
score: 0
has body: The session upload progress work fine but when i change the from post url from pros.php to server_ip/pros.php and change XMLHttpRequest JavaScript get url from t.open("GET","progress.php",false); to t.open("GET","server_ip/progress.php",false); it is not work so i add in progress.php header("Access-Control-Allow-Origin: *"); and it still not working progress.php: <?php error_reporting(0); header("Access-Control-Allow-Origin: *"); session_start(); $key = ini_get("session.upload_progress.prefix") . 'progressperc'; if(isset($_SESSION[$key]['bytes_processed']) AND $_SESSION[$key]['bytes_processed'] != 0) { $file_uploaded = true; echo round($_SESSION[$key]['bytes_processed'] / $_SESSION[$key]['content_length'] * 100); } elseif ($file_uploaded === true AND $_SESSION[$key]['bytes_processed'] == 0) { echo 100; } ?> and this is js code in index.php to get progress
has answer: http://stackoverflow.com/a/28386040
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/45107713
has title: php session upload progress stack with cross domain
has comment: http://stackoverflow.com/comment/45105321

http://stackoverflow.com/a/28386983
has comment: http://stackoverflow.com/comment/45115986
has body: UPDATE: The problem is that the new CSRF-protection does not work with ajax-requests. Here is what you could do: In your master template add a new meta tag with the current token like this &lt;meta name="csrf-token" content="{{ Session::token() }}"&gt; Then when sending your ajax call you add the token like this: $.post('http://localhost:8000/ajax', { '_token': $('meta[name=csrf-token]').attr('content'), task: 'comment_insert', userID: _userID, comment: _comment, name: _name, userName: _userName }) .error( ... ) .success( ... ); }
upvote count: 15
accepted answer of: http://stackoverflow.com/q/28386534
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28386534
type: Answer
has comment: http://stackoverflow.com/comment/45111665
downvote count: 2
score: 13

http://stackoverflow.com/a/28298636
has comment: http://stackoverflow.com/comment/44969975
has comment: http://stackoverflow.com/comment/44992394
has comment: http://stackoverflow.com/comment/44993126
score: 0
answers question: http://stackoverflow.com/q/28297090
has comment: http://stackoverflow.com/comment/44980939
has body: Can you be more specific about what you want to filter? Anyhow, I think you should check this module - https://www.drupal.org/project/webform_conditional You can also cancel ajax on the advance settings in the Drupal view
has comment: http://stackoverflow.com/comment/44951110
has comment: http://stackoverflow.com/comment/44986658
has comment: http://stackoverflow.com/comment/44994905
has comment: http://stackoverflow.com/comment/44992725
type: Answer
has comment: http://stackoverflow.com/comment/44992136
has comment: http://stackoverflow.com/comment/44949725
has comment: http://stackoverflow.com/comment/44972798
has comment: http://stackoverflow.com/comment/44992995
has comment: http://stackoverflow.com/comment/44949482
has comment: http://stackoverflow.com/comment/44951036

http://stackoverflow.com/a/28348314
answers question: http://stackoverflow.com/q/28348227
accepted answer of: http://stackoverflow.com/q/28348227
type: AcceptedAnswer
downvote count: 0
has body: cazares, you can try using the createFromFormat method from the DateTime class, take a look at this link: http://php.net/manual/en/datetime.createfromformat.php In your case you can use it like this: $dateObj = DateTime::createFromFormat("M j, Y", "Jan 1, 2015"); Hope it helps.
type: Answer
score: 3
has comment: http://stackoverflow.com/comment/45040790
upvote count: 3

http://stackoverflow.com/q/28340017
tagged with: .net
tagged with: javascript
has comment: http://stackoverflow.com/comment/45025315
tagged with: http-get
downvote count: 0
favorite count: 0
has title: Retrieving values from a HTML page via .NET
linked to: http://stackoverflow.com/q/516027
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45025264
tagged with: http://stackoverflow.com/tag/html
score: 2
answer count: 0
has body: I have a problem which I am sure has a simple solution, but I haven't encountered before. I have a HTML file, which calls a JavaScript API and retrieves values - this particular case calls a mapping API and retrieves co-ordinates when passed a postcode. However, for arguments sake, I will simplify to the following: &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function() { $("#myDiv").text("xValue,yValue"); }); &lt;/script&gt; &lt;div id="myDiv"&gt; &lt;/div&gt; However, as a .net HTTP GET request, this returns the page source, which has the empty div without the values injected: var httpWebRequest = (HttpWebRequest)WebRequest.Create("http://mywebsite.com/myfile.html"); httpWebRequest.ContentType = "text/html"; httpWebRequest.Method = "GET"; var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse(); using (var streamReader = new StreamReader(httpResponse.GetResponseStream())) { var result = streamReader.ReadToEnd(); } There must be a better solution to this problem - I am only able to retrieve the values through JavaScript.
has comment: http://stackoverflow.com/comment/45066031
type: Question
tagged with: c#

http://stackoverflow.com/q/28369613
favorite count: 0
has title: Replace container element when using Knockout component
upvote count: 5
has body: Is there a way to configure a Knockout component to replace the container element instead of nesting its content inside the container element? For example, if I have a custom component registered as my-custom-element with the following template: Hello world! Is it possible to use the component like this: And have the final product be this: Hello world! Instead of this: (the way Knockout renders components by default) Hello world! Based on the answer to this question, it seems that this functionality is built into the templating engine, which I'm assuming is also used when rendering component templates. Is there a way to specify that a component should be rendered with a renderMode of replaceNode? I'm aware of the "virtual element" syntax, which allows components to be defined inside an HTML comment: but I really dislike this syntax - writing real code inside a comment feels like a dirty, dirty hack.
has answer: http://stackoverflow.com/a/54402725
linked to: http://stackoverflow.com/q/13252505
has answer: http://stackoverflow.com/a/28877303
type: AnsweredQuestion
tagged with: knockout-components
tagged with: knockout.js
type: Question
has comment: http://stackoverflow.com/comment/45082329
score: 5
has answer: http://stackoverflow.com/a/28390636
accepted answer: http://stackoverflow.com/a/28390636
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28877303
answer count: 3
tagged with: web-component
tagged with: knockout-templating

http://stackoverflow.com/a/36588160
answers question: http://stackoverflow.com/q/28301393
has body: Just a small update for Season714's answer if you're using Windows 7: M$ did some magic things cause Windows 7 Updates take forever, so before you install those IE updates, you have to disable your network adapter first. By doing that, that update installation will start in few seconds and the error will be fixed. But if you don't, Windows Update will run first and it would take forever to complete.
score: 11
downvote count: 0
upvote count: 11
type: Answer

http://stackoverflow.com/q/28344430
has comment: http://stackoverflow.com/comment/45033352
has comment: http://stackoverflow.com/comment/45033343
has comment: http://stackoverflow.com/comment/45033232
type: UnansweredQuestion
downvote count: 2
has body: In the code below. When i put the return true in the .error or in the .success function. Then nothing happends. But when I put it outside my .error or .success function then it returns nicely and it closes my ngDialog when i return true. However I don't really understand why. angular.module('App') .controller('NewUserController',function($scope, User, $http){ $scope.user = {}; $scope.save = function() { User.create($scope.user) .success(function(data){ console.log('success'); return true; }) .error(function(data){ console.log('error') return false; }); return true; } });
type: Question
has comment: http://stackoverflow.com/comment/45033281
has title: Difference from returning in a promise and outside a promise
has comment: http://stackoverflow.com/comment/45033399
has answer: http://stackoverflow.com/a/28344546
has comment: http://stackoverflow.com/comment/45033312
upvote count: 0
score: -2
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45033496
tagged with: ng-dialog
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/q/28322661
tagged with: zend-framework
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: Using Zend Form 1.x is possible to construct a form with a datalist tag like this: &lt;input list="browsers"&gt; &lt;datalist id="browsers"&gt; &lt;option value="Internet Explorer"&gt; &lt;option value="Firefox"&gt; &lt;option value="Chrome"&gt; &lt;option value="Opera"&gt; &lt;option value="Safari"&gt; &lt;/datalist&gt; example here: http://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_datalist There is a Zend Form class that produce the above html?
type: UnansweredQuestion
tagged with: php
has answer: http://stackoverflow.com/a/28355114
type: Question
has title: Zend Form 1.x using html5 datalist tag

http://stackoverflow.com/q/28323799
answer count: 1
tagged with: jquery
tagged with: asp.net
favorite count: 0
has title: How to preserve JavaScript values after page reload in asp.net?
linked to: http://stackoverflow.com/q/6270085
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44996363
linked to: http://stackoverflow.com/q/1305954
has comment: http://stackoverflow.com/comment/44995689
has comment: http://stackoverflow.com/comment/44996375
has comment: http://stackoverflow.com/comment/44995370
has body: I have an html table in my asp.net application. When a td element is clicked, I store that value in a hidden field using JavaScript. function rebind() { $('.window td').on('click', function () { var idName = this.id; var selectedid = idName.substring(1); console.log(selectedid); $('#hidden').val(selectedid); }); } Now, I want to reload this aspx page after this click event because I need new data to be displayed as per the td value and I also want to preserve this hidden field value after reload or refresh and I want to use it on server side (aspx.cs). I've tried ajax like this, $.ajax({ url: "Default.aspx", data: selectedid, type: "POST", success: function (result) { alert('Yay! It worked!'); }, error: function (result) { alert('Error'); } }); But I am not able to access selectedid variable on c# side. I want to know if I am going in the right direction?
has comment: http://stackoverflow.com/comment/44995576
has comment: http://stackoverflow.com/comment/44997249
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/44995373
has answer: http://stackoverflow.com/a/28324885
tagged with: javascript
has comment: http://stackoverflow.com/comment/44996398
score: 0
upvote count: 1
downvote count: 1

http://stackoverflow.com/comment/44944652
type: AnswerComment
type: Comment
has text: Thank you Very much @craicerjak , so i should remove tag style ?
comment on: http://stackoverflow.com/a/28296119
score: 0

http://stackoverflow.com/comment/45076973
comment on: http://stackoverflow.com/q/28366664
type: QuestionComment
type: Comment
has text: Sorry Stefanz. Thanks phillip for updating.
score: 0

http://stackoverflow.com/a/28364262
has body: One possibility would be to use a computed value to group your data. self.EmployeeGroups = ko.pureComputed(function () { var employees = self.Employees(), index = {}, group = []; ko.utils.arrayForEach(employees, function(empl) { var id = ko.unwrap(empl.Id); if ( !index.hasOwnProperty(id) ) { index[id] = { grouping: { Id: empl.Id, Name: empl.Name }, items: [] }; group.push(index[id]); } index[id].items.push(empl); }); return group; }); would turn your data from a flat array to this: [{ grouping: { Id: /* ... */, Name: /* ... */ } items: [/* references to all employee objects in this group */] }, { /* same */ }] Expand the code snippet below to see it at work. $(function () { var data = { Employees: [{ Id: 1, Name: "Employee1", Day: new Date(), Price: 12.54 }, { Id: 2, Name: "Employee2", Day: new Date(), Price: 112.54 }, { Id: 1, Name: "Employee1", Day: new Date(), Price: 12.54 }, { Id: 3, Name: "Employee3", Day: new Date(), Price: 12.54 }] }; var jsonModel = JSON.stringify(data); function employeeModel(data) { var employeeMapping = { 'copy': ["Id", "Name", "Day", "Price"] }; ko.mapping.fromJS(data, employeeMapping, this); } function employeeViewModel(data) { var self = this; self.Employees = ko.observableArray(); self.EmployeeGroups = ko.pureComputed(function () { var employees = self.Employees(), index = {}, group = []; ko.utils.arrayForEach(employees, function(empl) { var id = ko.unwrap(empl.Id); if ( !index.hasOwnProperty(id) ) { index[id] = { grouping: { Id: empl.Id, Name: empl.Name }, items: [] }; group.push(index[id]); } index[id].items.push(empl); }); return group; }); // init var employeesMapping = { 'Employees': { create: function (options) { return new employeeModel(options.data); } } }; ko.mapping.fromJSON(data, employeesMapping, self); } var productsModel = new employeeViewModel(jsonModel); ko.applyBindings(productsModel); }); table { border-collapse: collapse; } table, th, td { border: 1px solid black; } tr:nth-child(even) { background-color: #efefef; } …
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45072775
has comment: http://stackoverflow.com/comment/45082361
type: Answer
has comment: http://stackoverflow.com/comment/45072517
accepted answer of: http://stackoverflow.com/q/28363596
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45072885
answers question: http://stackoverflow.com/q/28363596
has comment: http://stackoverflow.com/comment/45153808
has comment: http://stackoverflow.com/comment/45194072
has comment: http://stackoverflow.com/comment/45072406

http://stackoverflow.com/a/28428821
score: 12
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28428763
type: Answer
has comment: http://stackoverflow.com/comment/45189161
upvote count: 13
downvote count: 1
has comment: http://stackoverflow.com/comment/45189094
answers question: http://stackoverflow.com/q/28428763
has body: Your logic is a little off, try this: $('#check').change(function () { $('#btncheck').prop("disabled", !this.checked); }).change() Note that the UI of the button does not update when disabled, however the disabled property does change. You would probably want to add some CSS styling to make it obvious that the button is disabled. Also, I changed the code to use the change event instead of click to better cater for people who navigate using the keyboard. Here's a full working example including the above amendments: $('#check').change(function() { $('#btncheck').prop("disabled", !this.checked); }); .form input[type="checkbox"] label { background: #000; height: 30px; border: none; } .form .button { cursor: pointer; display: block; background: rgba(46, 204, 113, 1.0); width: 180px; margin: 0 auto; margin-bottom: 40px; padding: 16px 0; border: none; border-radius: 100px; color: #fff; font-family: 'Open Sans'; font-size: 16px; font-weight: 600; text-transform: uppercase; transition: 0.2s linear; } .form .button[disabled] { background-color: rgba(128, 128, 128); pointer-events: none; } .form .button:hover { background: rgba(46, 204, 113, 0.5); } Name E-Mail Adresse Handicap Gäste Ich bin einverstanden dass mich die Leute kontaktieren

http://stackoverflow.com/q/28415094
linked to: http://stackoverflow.com/q/19374345
tagged with: servlets
type: Question
has title: Return data to Servlet from JavaScript? Possible?
linked to: http://stackoverflow.com/q/857670
accepted answer: http://stackoverflow.com/a/28416202
has comment: http://stackoverflow.com/comment/45164971
tagged with: javascript
tagged with: drop-down-menu
answer count: 1
tagged with: jdbc
has comment: http://stackoverflow.com/comment/45165094
has body: I am trying to implement a Servlet with JDBC. My idea is that when user log in using the login form, he will be able to see the list off available databases in the MySQL. So I'm generating that dynamically on Servlet. That databases are displayed to the user using dropdown list. Now when user clicks on any of the available databases I am using JavaScript to check which database is selected by the user. Now I want to retrieve that value into my servlet from JavaScript. Based on the selected database i want to display the list of available tables in the database to the user. Is this possible? If not then is there any other way to do so?? Here is the sample code that generates drop down menu dynamically. ResultSet r = dbmetadata.getCatalogs(); ResultSetMetaData metadata = r.getMetaData(); int colCount = metadata.getColumnCount(); int i; out.println("&lt;select id='db' name='db'onChange= 'myFunction();'&gt;"); out.println("&lt;option value = -1&gt;--Select Database--&lt;/option&gt;"); int value = 1; while(r.next()) { for(i=1;i&lt;=colCount;i++) { out.println("&lt;option value = " + value + "&gt;" + r.getString(i) + "&lt;/option&gt;"); } k++; } out.println("&lt;/select&gt;"); JavaScript code looks something like this: function myFunction() { var select = document.getElementById("db"); var dbSelected = select.options[select.selectedIndex].text; var x = document.getElementById("dbs"); x.innerHTML = "You have selected " + dbSelected; }; Thank You :)
has answer: http://stackoverflow.com/a/28416202
type: AnsweredQuestion
score: 0
tagged with: mysql

http://stackoverflow.com/q/28419090
has title: How to select property from object in javascript using a variable containing the property name
has answer: http://stackoverflow.com/a/28419262
has body: In an AngularJS controller i have created a function which makes a JSONP request. This request returns a JSONP object which has the following format. [{ "Domain_1":{ "Notes":"This information can be usefull for generic information", "Contacts":[ { "ContactName":"P. rimary", "ContactPhone":"+31 612 273 88" } ] }, "Domain_2":{ "Notes":"This information can be usefull for generic information", "Contacts":[ { "ContactName":"S. secondary", "ContactPhone":"+31 612 273 88" } ] } }]; The object is returned successfully when making the JSONP request in the following function. ($scope.method and $scope.domainName are set at scope level) What i want is to achieve is to select a specific part of the JSON data matching the value in $scope.domainName and assign this to a scope variable $scope.domainData. $scope.fetch = function() { $scope.code = null; $scope.response = null; // Only make JSONP request if domain name is known if ($scope.domainName !== null) { $http({method: $scope.method, url: $scope.url, timeout: 5000}). success(function(data, status) { $scope.status = status; console.log("Data:") ; console.dir(data) ; console.log("Domain Name" + $scope.domainName) ; $scope.domainData = data[$scope.domainName] ; console.log("DomainData: ") ; console.dir($scope.domainData) ; }). error(function(data, status, headers, config) { $scope.domainData = null ; $scope.status = status; console.log("$scope.fetch failed" + $scope.status + " :: " + data) ; }); } else { console.log("Shame... nothing to do..... ") ; } }; When the code is executed the Domain Name is "Domain_1" and data contains (shown in console); 0: Object Domain_1: Object Contacts: Array[1] 0: Object ContactName:"P. rimary" ContactPhone:"+31 612 273 88" ... But $scope.domainData is undefined. How can make this selection work correctly?
tagged with: http://stackoverflow.com/tag/json
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/11922383
score: 0
has comment: http://stackoverflow.com/comment/45171871
has answer: http://stackoverflow.com/a/28419523
accepted answer: http://stackoverflow.com/a/28419523
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/28419262
type: AnsweredQuestion

http://stackoverflow.com/q/28361837
score: 0
has answer: http://stackoverflow.com/a/28361903
has title: js method chain tail
answer count: 1
type: UnansweredQuestion
has body: is there a way to detect if a method call in a chain (fluent interface) is in TAIL position in that chain ? var some = g.f(arg1).f(arg2).f(arg3); or do we absolutely need something like var some = g.f(arg1).f(arg2).f(arg3).end(); which I want avoid ? REturned value is not so important for me, but I need to compute something (an internal string-like key) at the end of the chain, with could have different lengths from one call to another.
type: Question
tagged with: method-chaining
tagged with: javascript
tagged with: fluent

http://stackoverflow.com/q/28298729
score: 0
answer count: 1
tagged with: opencart
type: UnansweredQuestion
tagged with: php
has answer: http://stackoverflow.com/a/28386176
type: Question
tagged with: counter
tagged with: javascript
has body: I'm trying to add a character count to my opencart product form. The problem is it's not working because of the opencart string which seems not to be accepted by java. How do I adapt that properly? &lt;?php $h2_input_name = "product_description[". $language['language_id']. "][prod_h2]" ;?&gt; Which echo's --> product_description[1][prod_h2] &lt;script language="javascript" type="text/javascript"&gt; function limitText(limitField, limitCount, limitNum) { if (limitField.value.length &gt; limitNum) { limitField.value = limitField.value.substring(0, limitNum); } else { limitCount.value = limitNum - limitField.value.length; } } &lt;/script&gt; &lt;form name="myform"&gt; &lt;input name="&lt;?php echo $h2_input_name ?&gt;" type="text" onKeyDown="limitText(this.form.&lt;?php echo $h2_input_name ?&gt;,this.form.countdown,15);" onKeyUp="limitText(this.form.&lt;?php echo $h2_input_name ?&gt;,this.form.countdown,15);" maxlength="15"&gt;&lt;br&gt; &lt;font size="1"&gt;(Maximum characters: 15)&lt;br&gt; You have &lt;input readonly type="text" name="countdown" size="3" value="15"&gt; characters left.&lt;/font&gt; &lt;/form&gt; For some reason product_description[1][prod_h2] won't work. If i use product_description it works fine. How should or can i rewrite product_description[1][prod_h2] so the counter works?
has title: Opencart string and charachter count script How rewrite that

http://stackoverflow.com/comment/45103742
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28382509
score: 0
has text: Could you please help me to implement Affix to my code? I am new to this sort of things and I am slightly confused...

http://stackoverflow.com/q/28402166
tagged with: javascript
tagged with: jquery
tagged with: slider
tagged with: http://stackoverflow.com/tag/html
has title: The Slide not auto but click next or prev
favorite count: 0
answer count: 0
type: UnansweredQuestion
has body: I downloaded a soure code of a slide jquery. In html code. When I set div width to a pixel (ex : 1300px;), slider will play normaly. But, when I set div width to % (ex : width: 100%;), slider will not autoplay before I next or prev slider. How can I fix it ? P/S : I wanna fix size slider to 100% (now, the slide just fit to 1366px), how can. Hope your help. Thank you and sorry for my English. Soure is : CSS : .captionOrange, .captionBlack { color: #fff; font-size: 20px; line-height: 30px; text-align: center; border-radius: 4px; } .captionOrange { background: #EB5100; background-color: rgba(235, 81, 0, 0.6); } .captionBlack { font-size:16px; background: #000; background-color: rgba(0, 0, 0, 0.4); } a.captionOrange, A.captionOrange:active, A.captionOrange:visited { color: #ffffff; text-decoration: none; } a.captionOrange:hover { color: #eb5100; text-decoration: underline; background-color: #eeeeee; background-color: rgba(238, 238, 238, 0.7); } .bricon { background: url(../img/browser-icons.png); } Scrip : &lt;script&gt; jQuery(document).ready(function ($) { var _SlideshowTransitions = [ {$Duration: 1000, $Delay: 80, $Cols: 10, $Rows: 4, $Clip: 15, $SlideOut: true, $Easing: $JssorEasing$.$EaseOutQuad } , { $Duration: 1200, y: 0.3, $Cols: 2, $During: { $Top: [0.3, 0.7] }, $ChessMode: { $Column: 12 }, $Easing: { $Top: $JssorEasing$.$EaseInCubic, $Opacity: $JssorEasing$.$EaseLinear }, $Opacity: 2, $Outside: true } , { $Duration: 1000, x: -1, y: 2, $Rows: 2, $Zoom: 11, $Rotate: 1, $SlideOut: true, $Assembly: 2049, $ChessMode: { $Row: 15 }, $Easing: { $Left: $JssorEasing$.$EaseInExpo, $Top: $JssorEasing$.$EaseInExpo, $Zoom: $JssorEasing$.$EaseInExpo, $Opacity: $JssorEasing$.$EaseLinear, $Rotate: $JssorEasing$.$EaseInExpo }, $Opacity: 2, $Round: { $Rotate: 0.85} } //, { $Duration: 1200, x: 0.2, y: -0.1, $Delay: 20, $Cols: 10, $Rows: 4, $Clip: 15, $During: { $Left: [0.3, 0.7], $Top: [0.3, 0.7] }, $Formation: $JssorSlideshowFormations$.$FormationStraightStairs, $Assembly: 260, …
upvote count: 1
tagged with: css
has comment: http://stackoverflow.com/comment/45141994
score: 1
type: Question
has comment: http://stackoverflow.com/comment/45139606
downvote count: 0

http://stackoverflow.com/q/28372845
favorite count: 0
has comment: http://stackoverflow.com/comment/61233228
upvote count: 11
type: AnsweredQuestion
score: 11
has comment: http://stackoverflow.com/comment/45090586
type: Question
has comment: http://stackoverflow.com/comment/45090651
has answer: http://stackoverflow.com/a/28375232
accepted answer: http://stackoverflow.com/a/28375232
tagged with: coffeescript
has title: Use glob matching, when passing files to browserify in gulp
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: gulp
has body: All the examples I have seen using browserify and gulp assume that you only want to browserify 1 file. This is usually not the case. I came across an example that used vinyl-transforms, but I am unable to get it to work correctly. Here is the (coffee-script) code: # Browserify JS gulp.task 'browserify', [], -&gt; # Create the transform br = transform (f) -&gt; return browserify(f).bundle() # Run browserify gulp.src(['./public/js/**/*.js']) .pipe(br) .pipe(gulp.dest('.')) But I get the following error: [10:50:55] Starting 'browserify'... events.js:72 throw er; // Unhandled 'error' event ^ Error: write after end
tagged with: browserify

http://stackoverflow.com/a/28292803
score: 0
accepted answer of: http://stackoverflow.com/q/28292434
answers question: http://stackoverflow.com/q/28292434
type: AcceptedAnswer
has body: You could either aggregate it as: collection.aggregate([ {$match:{"EmployeeId":1000}}, {$group:{"_id":"$EmployeeID", "speciality":{$push:"$Speciality"}, "Code":{$push:"$Code"}, "Age":{$push:"$Age"}}} ]) or, collection.aggregate([ {$match:{"EmployeeId":1000}}, {$group:{"_id":"$EmployeeID", "data":{$push:{"Speciality":"$Speciality", "Code":"$Code", "Age":"$Age"}}}} ])
type: Answer

http://stackoverflow.com/a/28337153
score: 1
upvote count: 1
has body: Use data attributes as follows: $(function() { $('tr:has(.free):first td').on('mouseenter',function() { var that = $(this); $(this).parent().next().next().find('td').filter(function() { return $(this).data('date') == that.data('date'); }) .addClass('highlight'); that.addClass('highlight'); }) .on('mouseleave', function() { $('.highlight').removeClass('highlight'); }); }); .highlight { background-color: #ffff00; } Thursday 5 Friday 6 900 900 930 930 1000 1000
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28336687
type: Answer
accepted answer of: http://stackoverflow.com/q/28336687

http://stackoverflow.com/comment/45071899
type: AnswerComment
score: 0
type: Comment
has text: Holly Molly , yes i will go ahead an read that , i know about IIFE's but this one really caught me on the wrong foot .
comment on: http://stackoverflow.com/a/28365346

http://stackoverflow.com/comment/44979552
comment on: http://stackoverflow.com/q/28314789
score: 0
has text: I really couldn't get ur probem..Do you want to attain the value u have selected in your text box.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44991891
has text: I have edited my answer, this should fix the "blink" issue on page load.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28320233

http://stackoverflow.com/comment/45116078
score: 0
type: Comment
has text: I've added the validation.js file to head of my html and tried to call a simple alert function but it doesn't seem to work, network tab in developer mode shows that js is being downloaded but the function wont work. Writing the function on the html does seem to work though, what could be the problem?
type: AnswerComment
comment on: http://stackoverflow.com/a/28388387

http://stackoverflow.com/q/28320438
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/52554216
answer count: 3
has answer: http://stackoverflow.com/a/28320488
favorite count: 0
tagged with: ajax
accepted answer: http://stackoverflow.com/a/28320488
upvote count: 38
has answer: http://stackoverflow.com/a/28327811
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28327811
downvote count: 1
type: Question
score: 37
has title: React.js create loop through Array
tagged with: reactjs
has body: I'm trying to display a Table of 10 Players. I get the data from via ajax and pass it as props to my Child. var CurrentGame = React.createClass({ // get game info loadGameData: function() { $.ajax({ url: '/example.json', dataType: 'json', success: function(data) { this.setState({data: data}); }.bind(this), error: function(xhr, status, err) { console.error('#GET Error', status, err.toString()); }.bind(this) }); }, getInitialState: function(){ return {data: []}; }, componentDidMount: function() { this.loadGameData(); }, render: function() { return ( Current Game Information <PlayerList data={this.state.data}/> ); } }); Now I need a List Component to Render the Players: var PlayerList = React.createClass({ render: function() { // This prints the correct data console.log(this.props.data); return ( // I'm the Player List {this.props.data} // <Player author="The Mini John" /> { this.props.data.participants.map(function(player) { return {player} }) } ) } }); Which gives me a Uncaught TypeError: Cannot read property 'map' of undefined. I'm kind of unsure what is happening, my console log displays the correct data but somehow I can't access it in the return. What am I missing ?

http://stackoverflow.com/comment/45070251
type: Comment
comment on: http://stackoverflow.com/a/28344004
score: 0
type: AnswerComment
has text: Yeah that's what I figured, works ok now. By the way, if you use page events, don't put the resize in 'pageinit', it won't work. I added it in 'pageshow' and it works fine.

http://stackoverflow.com/a/28391375
has body: As others have answered, there exist templating engines for Node. With the current trends in web development, most modern web frameworks encourage the separation of code from the view (or the HTML you deliver to the client). For instance, Ruby's ERB templates, Jinja2 in Python, Handlebars/Jade for Node, and now a lot of modern PHP frameworks support this as well (Zend/Slim). Another main difference is in how they work and how the languages are designed. PHP is an object oriented language supporting classes, inheritance, member visibility, interfaces, etc. Node.js is Javascript, so using prototypical inheritance. The communities and ecosystems are different as well. Modern PHP tends to embrace the use of the Composer package manager, and that came after PEAR. However, npm is the official node package manager and it is deeply integrated with the platform. It is trivial to search for new packages and then use them in your projects. The main architectural difference is that Node is also asynchronous by design, meaning it runs in a single thread and can potentially handle much more connections than PHP on systems with limited memory. When a request comes in to a PHP application, all the services/controllers and everything you defined have to be reinstatiated, you define PHP files and let Apache/Nginx process them. In Node you have a node process which you can proxy outside requests to.
score: 2
downvote count: 0
type: Answer
upvote count: 2
answers question: http://stackoverflow.com/q/28391227

http://stackoverflow.com/a/28289320
has body: Use $(this) to target the specific element that was clicked, rather than all elements matching the selector. $(".industrial-product").click(function() { $(this).find(".ip-features").toggle(); }); Also, you don't need to use .each() when using an event binding method. jQuery automatically applies it to all elements matching the selector (in general, jQuery does this whenever it makes sense).
answers question: http://stackoverflow.com/q/28289265
score: 0
type: Answer

http://stackoverflow.com/comment/45164372
comment on: http://stackoverflow.com/q/28415465
has text: It's here : echo " "; this line adds a checkbox to each table row
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28423931
upvote count: 2
has comment: http://stackoverflow.com/comment/45180710
type: Question
accepted answer: http://stackoverflow.com/a/28424186
has comment: http://stackoverflow.com/comment/45181224
tagged with: javascript
has title: Using .getElementsByTagName on HTMLCollection
has comment: http://stackoverflow.com/comment/45181341
has comment: http://stackoverflow.com/comment/45180851
downvote count: 0
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45181304
has answer: http://stackoverflow.com/a/28424186
score: 2
type: AnsweredQuestion
has body: I'm working on a project where I have to select multiple input tags by NAME from multiple forms. I selected the forms using getElementsByTagName('forms') (which returns a HTML Collection as far as I understand). When I try to apply the getElementsByName('example') i get the undefined TypeError. After doing some reading I've found out that HTML Collection does not have that method. My question is what method should I use to select the input fields by name in this case? (Note: I can't use jQuery on this project.) Please let me know if I need to clarify anything. Cheers! Edit: Here's a code i'm working on. One of the constraints in this project is that I don't know how many forms there will be on the website, or how many input boxes those forms will have. (FieldObj is an object that contains the names of input fields) var formsList = document.getElementsByTagName('form'); var form; for (form in formsList) { var currentForm = formsList[form]; for (field in fieldObj) { if (formsList.getElementsByName(field)) {...} } }

http://stackoverflow.com/comment/45213358
score: 0
type: AnswerComment
has text: It's working for already created fields but when you try to add a label it doesn't work :(. I'll try to take a closer look at the code later today to see if I can adjust that. But this already has gotten me further so thank you :). I can't believe there isn't already a solution out there, it seems like this would be a common problem.
type: Comment
comment on: http://stackoverflow.com/a/28439438

http://stackoverflow.com/q/28334029
has title: Javascript accessing other classes using functions
tagged with: class
score: 0
has comment: http://stackoverflow.com/comment/45015218
accepted answer: http://stackoverflow.com/a/28334343
has comment: http://stackoverflow.com/comment/45014835
tagged with: node.js
type: AnsweredQuestion
has body: I'm new to this stuff but i'm trying to create a new instance of a class in javascript that class I also want to initialise using input, like a function. So far I have: /Class1.js /folder/Class2.js Class2.js: function Class2(n) { this.number = n; } Class1.js: var instance = new Class2(1); That didn't work so I tried requiring the class: require('./folder/Class2.js'); or var newClass = new require('./folder/Class2.js'); var instance = new newClass(1); Neither worked and I get the error: Class2 is not defined No online examples such as this haven't gone into any detail why it doesn't work just the same non-working stuff.
has answer: http://stackoverflow.com/a/28334343
type: Question
answer count: 2
tagged with: function
possible better answer: http://stackoverflow.com/a/28334589
tagged with: javascript
has answer: http://stackoverflow.com/a/28334589

http://stackoverflow.com/comment/45005228
type: AnswerComment
comment on: http://stackoverflow.com/a/28327689
type: Comment
score: 0
has text: The code is a bit surprising: You're starting the drag on mousedown within one element, but then when the mouse moves, you're moving a *different* element. In that case (and perhaps just on general principal), you probably want to set the `mouseup` handler on `document` rather than the element you're not dragging.

http://stackoverflow.com/comment/45104809
type: AnswerComment
comment on: http://stackoverflow.com/a/28383312
type: Comment
has text: @Aviv: domain name or ips are set in the headers. It simply prepends your domain, (localhost, some ip or fully qualified domain name) whatever it is to all your requests. You don't have to worry about them. Browser will handle those things for you. It is the job of the server to resolve these paths. Don't worry that is automatically done.
score: 0

http://stackoverflow.com/comment/45129939
has text: Try putting a semi colon after the titles array instead of a comma. "];"
comment on: http://stackoverflow.com/q/28397027
type: Comment
type: QuestionComment
score: 0

html2canvas
tags question: http://stackoverflow.com/q/28433902
type: Tag
tags question: http://stackoverflow.com/q/28410221
tag name: html2canvas
tags question: http://stackoverflow.com/q/28315815

http://stackoverflow.com/comment/44962487
has text: i have a question on your code what if there are two selects and two textbox having id's sel1 and sel2 and tx1 and txt2 would it be possible to re-use your code for that? i have been doing some experiments and it seems that your code does not work if there are already two selects and two txtboxes involve; i change their id's (which i did to check functionality) but it does not work; i know your code will be helpful in the future so i'd be happy to know if you know a fix for that
type: Comment
comment on: http://stackoverflow.com/a/28305340
score: 0
type: AnswerComment

http://stackoverflow.com/a/28384038
type: Answer
accepted answer of: http://stackoverflow.com/q/28383102
has comment: http://stackoverflow.com/comment/45106198
has body: First thing first, your loop should be: for (var i = 0; i &lt; bbArray.length; i++) { (not content_text_bb.length) Secondly, the issue you have is with this size="(.*?). This says: match any content non-greedily till I find the first "thing-that-follow" (in this case the thing-that-follows is the first occurrence of " clickable="yes" If you look at your input text, the search for [img size="{ANYTHING}" clickable="yes"] means that {ANYTHING} is: small" clickable="no"]img1.jpg[/img][img size="large and you can see how that returns your results, and breaks everything. So, it should firstly be noted that regexps are not the best tool for language processing (plenty of posts on SO and the internet at large on the topic). In this particular case, you can fix your problem by being very specific about what you want matched. Do NOT match "anything". If you want to match a size attribute, look for digits only. If you want to match any property value, look for "{ANYTHING_NOT_DOUBLE_QUOTES}". So, with that said, if you change bbArray to the code below, it should work in the particular example you have given us: var bbArray = [/\n/g, /\[img size="([^"]*)" clickable="yes"\](.*?)\[\/img\]/g, /\[img size="([^"]*)" clickable="no"\](.*?)\[\/img\]/g]; Just to be clear: while this should work on your current input, it is by no mean robust bbcode processing. It will only match [img] bbcode tags that have exactly one size attribute and one clickable attribute, in that order!! Most free-to-type bbcode out-there will have much broader variations, and this code obviously won't work on them.
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28383102

http://stackoverflow.com/q/28369572
has comment: http://stackoverflow.com/comment/45084074
has comment: http://stackoverflow.com/comment/45080229
tagged with: html-table
has comment: http://stackoverflow.com/comment/45081091
score: 0
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/45167263
has comment: http://stackoverflow.com/comment/45084945
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45148621
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45146731
has title: How can I create an html table, with unknown number of columns per row, get the columns to be aligned, and have an id for each cell/row?
has comment: http://stackoverflow.com/comment/45080106
has comment: http://stackoverflow.com/comment/45086721
has comment: http://stackoverflow.com/comment/45154777
has comment: http://stackoverflow.com/comment/45084294
has comment: http://stackoverflow.com/comment/45084987
has body: I'm trying to build a table with divs, and being able to get an id associated with each cell of the table. For this, I'm using angularJS, and I'm trying to get ng-repeat to do what I want. When using an HTML table, we can use colspan to define the columns so even if the number of columns is different, the layout still show an aligned table. But what if you don't know if the next row will have 2 columns or 4 columns? how can you control that? That's why I'm using div's, so I can play with their width, according with the number of columns I need. Here's the fiddle I'm working on at the moment: http://jsfiddle.net/xEyJZ/239/ Any help would be appreciated, as my problem is how to set the divs, so that the table looks aligned. If you check the fiddle, you can see that none of the columns are aligned. Ideally the last row should be centered, the row with two columns should be evenly split across the row, etc. {{ person.col0 }} <div style="float:left;outline:black solid thin;" ng-hide="person.cols < 1" ng-click="test(person, 1)">{{ person.col1 }} <div style="float:left;outline:black solid thin;" ng-hide="person.cols < 2" ng-click="test(person, 2)">{{ person.col2 }} <div style="float:left;outline:black solid thin;" ng-hide="person.cols < 3" ng-click="test(person, 3)">{{ person.col3 }} Can anyone shed some light, please?
has answer: http://stackoverflow.com/a/28427603
has comment: http://stackoverflow.com/comment/45164899
has comment: http://stackoverflow.com/comment/45081310
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45103293
has comment: http://stackoverflow.com/comment/45154796
tagged with: javascript
has comment: http://stackoverflow.com/comment/45162902
has comment: http://stackoverflow.com/comment/45186831

http://stackoverflow.com/a/28303901
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/44965437
has body: $(document).ready(function(){ PopUpHide(); $("#popup1").click(function(e){ if( e.target !== this ) return; PopUpHide(); }); }); function PopUpShow() { $("#popup1").show(); } function PopUpHide() { $("#popup1").hide(); } *{ font-family: Areal; } .b-container{ width:200px; height:150px; background-color: #ccc; margin:0px auto; padding:10px; font-size:30px; color: #fff; } .b-popup{ width:auto; background-color: rgba(0,0,0,0.5); overflow:hidden; position:fixed; top:0px; bottom:0px; left:0; right:0; } .b-popup-content{ margin: 3em auto 0 auto; width: 100px; height: 40px; padding: 0.9em; background-color: #c5c5c5; border-radius:5px; box-shadow: 0.05cm 0.05cm 1em rgba(0,0,0,0.8); } Sample Text Show popup Text in Popup Hide popup
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/28303647

http://stackoverflow.com/comment/133739991
comment on: http://stackoverflow.com/a/66738128
has text: How does this solve the original issue? Where are you capturing the values from JS and passing them to razor view?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28416054
tagged with: constants
type: AnsweredQuestion
downvote count: 0
type: Question
has comment: http://stackoverflow.com/comment/45166879
has answer: http://stackoverflow.com/a/28416703
tagged with: dependency-injection
score: 37
answer count: 2
tagged with: javascript
favorite count: 0
has title: Inject constant to other modules config using Angular JS
upvote count: 37
possible better answer: http://stackoverflow.com/a/28416703
tagged with: angularjs
has answer: http://stackoverflow.com/a/28416656
accepted answer: http://stackoverflow.com/a/28416656
has body: I would like to share some variables like base paths throughout my application. These variables needs to be accessible during module configuration. My opinion was, that I can use a constant or provider for that. I've got several modules and each one has it's own routing configuration. In these routing configurations, I want to access some settings for example. This is working for the app-module-configuration but not for other module-configurations (for controllers on other modules it does), I always get "Unknown provider: info from myApp.orders". var myApp = angular.module('myApp', ['myApp.orders']); myApp.constant('info', { version : '1.0' }); myApp.config(function(info) { console.log('app config: ' + info.version); }); myApp.controller('MyController', function (info) { console.log('controller: ' + info.version); }); var orders = angular.module('myApp.orders', []); // Remove comments to see it fail. //orders.config(function(info) { // console.log('orders config: ' + info.version); //}); &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"&gt;&lt;/script&gt; &lt;div ng-app="myApp" class="container" ng-controller="MyController"&gt; &lt;/div&gt; I guess I have just missed out a little detail, do you have an idea?

http://stackoverflow.com/comment/45028103
comment on: http://stackoverflow.com/q/28318492
score: 0
type: Comment
type: QuestionComment
has text: Try this: https://github.com/alvarotrigo/fullPage.js/issues/176

http://stackoverflow.com/a/28333123
type: Answer
has body: Arrays are accessed by a numeric index into the array and arrays are optimized for sequences of data with indexes starting at zero. It doesn't sound like that's what you really want. If you want to be able to index via the Facebook ID, then you probably want to use an object (not an array) and set the Facebook ID as the key by which you can set and get items from the object. var users = {}; function addUser(facebookID, properties) { // save properties object for a given facebookID user users[facebookID] = properties; } function getUser(facebookID) { // return properties object for a given facebookID user return users[facebookID]; }
answers question: http://stackoverflow.com/q/28332967
score: 0

http://stackoverflow.com/q/28319344
has comment: http://stackoverflow.com/comment/44987830
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28319673
has body: i have Menu which have dynamic items collapsed By default i am trying make page height change with changing in items collapse status bu using &lt;script type="text/javascript"&gt; function fun() { var iFrameID = document.getElementById('wrapper'); if (iFrameID) { // here you can make the height, I delete it first, then I make it again iFrameID.height = ""; iFrameID.height = iFrameID.contentWindow.document.body.scrollHeight + "px"; } } and Using This Method In &lt;a href="javascript:;" data-toggle="collapse" onclick="fun()" data-target='#&lt;%# Eval("HeaderMenuId")%&gt; '&gt;&lt;i class="fa fa-fw fa-arrows-v"&gt;&lt;/i&gt; &lt;%# Eval("HeadItemText")%&gt; &lt;i class="fa fa-fw fa-caret-down"&gt;&lt;/i&gt;&lt;/a&gt; i get error Cannot read property 'document' of undefined
score: 0
has comment: http://stackoverflow.com/comment/44987737
answer count: 1
tagged with: asp.net
has title: dynamic page size depend on inner menu items height
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28319673
type: Question

http://stackoverflow.com/comment/45117293
comment on: http://stackoverflow.com/a/28389894
has text: controllerContext.store.createRecord gives no error; however, the strange part is that the record does not get stored. I'm assuming this is a Firebase issue.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28427903
has body: You can use the "beforeSend" ajax event where you can check you session and if it's expired you can do something else: $.ajax({ beforeSend: function(){ // Handle the beforeSend event }, complete: function(){ // Handle the complete event } // ...... }); Check this for more info: http://api.jquery.com/Ajax_Events/
type: Answer
answers question: http://stackoverflow.com/q/28427854
score: 3
has comment: http://stackoverflow.com/comment/45187491
upvote count: 3
downvote count: 0

http://stackoverflow.com/a/28432062
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28430733
downvote count: 0
score: 8
upvote count: 8
type: Answer
accepted answer of: http://stackoverflow.com/q/28430733
has body: Best would be to fully utilize MVVM architecture and define the store in viewmodel stores object. Then it is easy: onBeforeRender: function (toolbar, eOpts) { var store = this.getViewModel().getStore('yourstorekey'); } Note: This is possible only if the lifetime of the store is same as the lifetime of the view. If you need to access a global store with a longer lifetime then assign it a storeId and get it with: var store = Ext.getStore('theStoreId');
has comment: http://stackoverflow.com/comment/45195079

http://stackoverflow.com/comment/45198702
type: Comment
comment on: http://stackoverflow.com/q/28434311
type: QuestionComment
score: 2
has text: You cannot. This notification is a security feature of Chrome.

http://stackoverflow.com/comment/44967087
type: AnswerComment
type: Comment
has text: @Dr.Donnaloia It uses mutation observers if they're available and if they're not it uses IEs propertchange event. It's just an already built wheel made so you don't have to.
comment on: http://stackoverflow.com/a/28283707
score: 0

http://stackoverflow.com/comment/45628088
type: AnswerComment
has text: There's one last thing the numbers are not adding up properly on mine, I've made a JSFiddle so you can see: http://jsfiddle.net/ghkz4hzh/
type: Comment
comment on: http://stackoverflow.com/a/28355096
score: 0

http://stackoverflow.com/a/28375232
answers question: http://stackoverflow.com/q/28372845
type: AcceptedAnswer
score: 22
has body: The easiest way would be to use glob directly: var glob = require('glob'); gulp.task('browserify', function() { var files = glob.sync('./public/js/**/*.js'); return browserify({entries: files}) .bundle() .pipe(gulp.dest('.')); });
type: Answer
upvote count: 22
has comment: http://stackoverflow.com/comment/45091004
has comment: http://stackoverflow.com/comment/46803692
downvote count: 0
has comment: http://stackoverflow.com/comment/70141513
accepted answer of: http://stackoverflow.com/q/28372845

http://stackoverflow.com/comment/44966742
type: Comment
type: QuestionComment
has text: it´s definitely used in a wrong way. if you got a canvas app, why not use app notifications? it´s beta, but it works great and after all you want to send notifications, right?
comment on: http://stackoverflow.com/q/28306661
score: 0

http://stackoverflow.com/q/28392090
favorite count: 0
has answer: http://stackoverflow.com/a/28392155
has comment: http://stackoverflow.com/comment/45121149
upvote count: 4
type: AnsweredQuestion
has title: java script functionality only in mobile device
has body: I want java script functionality only in mobile device 767px. This is my code $('#my-btnn').click(function () { $('#mobile-login').hide(); $('#user-settings').slideToggle('fast'); });
type: Question
possible better answer: http://stackoverflow.com/a/28392155
tagged with: media-queries
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28392158
score: 4
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/28392158
has comment: http://stackoverflow.com/comment/45121173

http://stackoverflow.com/q/28410267
possible better answer: http://stackoverflow.com/a/28410470
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28410470
has answer: http://stackoverflow.com/a/28410281
upvote count: 2
answer count: 3
has body: I have a div that can have many child elements. This super div has a class of .clickable, and the child divs also have a .clickable class. I also have a .click event handler for anything with class .clickable. However, every time I click inside the super div, only the super div gets a click event triggered. The child divs are never being targeted. How do I get around this? html js $('.clickable').click(function() { $(this).css('border', '1px solid red'); });
has comment: http://stackoverflow.com/comment/45154081
has comment: http://stackoverflow.com/comment/45153973
has title: onclick select child element
accepted answer: http://stackoverflow.com/a/28410281
has answer: http://stackoverflow.com/a/28538617
score: 2
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
type: Question

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

http://stackoverflow.com/comment/44927663
has text: @casillas again, the nested `$.each()` code you posted here is nowhere to be found in the linked jsfiddle.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28286789
score: 1

http://stackoverflow.com/a/28419966
answers question: http://stackoverflow.com/q/28415677
type: Answer
accepted answer of: http://stackoverflow.com/q/28415677
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45202846
type: AcceptedAnswer
downvote count: 0
has body: Update: With the addition of the fiddle, it's pretty easy to see what is going on. When you do svg.selectAll(name) it's returning an empty selection. The reason for that is because there are no elements of circleN. circleN is not a valid DOM element, and none of them exist anyway, so the selection will fail. If you make the following changes to your cds function you will see that your code now works: function cds(el) { name = "circle" + el.id; if (el.checked) { svg.selectAll(name) .data(dataset[el.id]) .enter().append("circle") .attr('cx', function (a) { return xscale(a[0]); }) .attr('cy', function (a) { return yscale(a[1]); }) .attr('r', 3) .attr('class', name) .style("opacity", 1); } else { svg.selectAll("circle." + name).remove(); } } There are two changes of note in this function: .attr('class', name) being added to the code creating your new DOM elements. This will add a class to the circle, making the selection easier when it comes time to remove them. Updated the line that removes them to svg.selectAll("circle." + name).remove(); which will remove the circles when you uncheck the radio boxes.

http://stackoverflow.com/q/28331378
has answer: http://stackoverflow.com/a/28331576
has title: Moment JS Returning Incorrect Value
type: Question
has answer: http://stackoverflow.com/a/28331646
answer count: 2
accepted answer: http://stackoverflow.com/a/28331646
tagged with: javascript
score: 0
possible better answer: http://stackoverflow.com/a/28331576
tagged with: momentjs
has body: I am having some issues with the Moment JS NPM. I have a date in the past set to Jan 31st for testing. It is returning as 1 from today's date. Take a look at my code and screenshots below: var tz = -5, thisYear = moment().utc(tz).year(), // plus one because Moment starts month at 0 thisMonth = moment().utc(tz).month() + 1, today = moment().utc(tz).date(), thisHour = moment().utc(tz).hour(), start = moment([2015, 1, 31, 15]), now = moment([thisYear, thisMonth, today, thisHour]), daysPast = now.diff(start, 'days'); console.log(thisYear, thisMonth, today, thisHour); console.log(2015, 1, 31, 15); console.log(daysPast); This is what is getting returned in the console: When I change the date to the first of February, it returns correctly: Anyone have any ideas why Moment is returning incorrectly with the past month?
tagged with: node.js
type: AnsweredQuestion

http://stackoverflow.com/q/28281579
type: UnansweredQuestion
tagged with: relational
has comment: http://stackoverflow.com/comment/44947730
answer count: 0
has comment: http://stackoverflow.com/comment/44947718
type: Question
has body: Here is what I have: I have a class named "News" as you can see in the image and another class named "Gallery" I retrieve columns data like this : ATit = [] ADat = [] ACon = [] AIma = [] AGal = [] new Parse.Query(Parse.Object.extend("News")).find({ success: function(results) { $.each(results, function (Items, Objects) { ATit.push(Objects.attributes.Title) ADat.push(Objects.attributes.Date) ACon.push(Objects.attributes.Content) AIma.push(Objects.attributes.Image.url()) }) } }) but I can't retrieve data from Gallery column.. all I want is to put image.url() from Gallery into AGal array, as you can see in the image I have 4 images inside the Gallery which have Relation to Gallery column and I need to know how can I have access to it ?
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44938584
score: 0
has title: How can I have access to relational data in Parse using jquery?
tagged with: parse-platform

http://stackoverflow.com/comment/45090231
has text: There are no `width` or `height` properties in the [InfoWindowOptions](https://developers.google.com/maps/documentation/javascript/reference#InfoWindowOptions)
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28374758
type: AnswerComment

http://stackoverflow.com/q/28394867
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/58524468
has answer: http://stackoverflow.com/a/31104813
score: 6
has body: I'm porting some Google Maps code to Leaflet (well, Mapbox actually). I have quite a lot of shapes (like rectangles, polygons) and markers on the map and I need the ability to adjust their order manually at any time, not just when adding them for the first time. In google maps there was a setZIndex method which allowed to adjust order of elements inside a pane (shapes were always below the markers). How can I do it in Leaflet? If it's not available in the api, what's the best way to implement it?
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/79231235
tagged with: mapbox
accepted answer: http://stackoverflow.com/a/31104813
has title: Leaflet z-index
upvote count: 6
answer count: 4
type: AnsweredQuestion
tagged with: leaflet
has answer: http://stackoverflow.com/a/28405382
has answer: http://stackoverflow.com/a/58524468

http://stackoverflow.com/comment/45141980
type: QuestionComment
comment on: http://stackoverflow.com/q/28403454
has text: @elf maybe but its dynamic data from a django request being returned as a json list. I'm not really sure how to do that in a fiddle. sorry. I could try but it would take me like an hour.
score: 0
type: Comment

java
tags question: http://stackoverflow.com/q/28293450
tags question: http://stackoverflow.com/q/28429057
tags question: http://stackoverflow.com/q/28327792
tags question: http://stackoverflow.com/q/28331133
tags question: http://stackoverflow.com/q/28378979
tags question: http://stackoverflow.com/q/28289970
tags question: http://stackoverflow.com/q/28332768
tags question: http://stackoverflow.com/q/28305349
tags question: http://stackoverflow.com/q/28344305
tags question: http://stackoverflow.com/q/28324274
tags question: http://stackoverflow.com/q/28319291
tags question: http://stackoverflow.com/q/28326943
tags question: http://stackoverflow.com/q/28322902
tags question: http://stackoverflow.com/q/28293545
tags question: http://stackoverflow.com/q/28426050
tags question: http://stackoverflow.com/q/28362086
tags question: http://stackoverflow.com/q/28289963
tags question: http://stackoverflow.com/q/28305386
tags question: http://stackoverflow.com/q/28424342
tags question: http://stackoverflow.com/q/28346255
tags question: http://stackoverflow.com/q/28398515
tags question: http://stackoverflow.com/q/28369050
tags question: http://stackoverflow.com/q/28295721
tags question: http://stackoverflow.com/q/28372873
tags question: http://stackoverflow.com/q/28414198
tags question: http://stackoverflow.com/q/28384572
tags question: http://stackoverflow.com/q/28287833
tags question: http://stackoverflow.com/q/28283298
tags question: http://stackoverflow.com/q/28407258
tags question: http://stackoverflow.com/q/28326682
tags question: http://stackoverflow.com/q/28359998
tags question: http://stackoverflow.com/q/28363783
tags question: http://stackoverflow.com/q/28338381
tags question: http://stackoverflow.com/q/28286260
tag name: java
tags question: http://stackoverflow.com/q/28301807
tags question: http://stackoverflow.com/q/28410254
tags question: http://stackoverflow.com/q/28355161
tags question: http://stackoverflow.com/q/28350913
tags question: http://stackoverflow.com/q/28287425
tags question: http://stackoverflow.com/q/28294349
tags question: http://stackoverflow.com/q/28287466
tags question: http://stackoverflow.com/q/28324598
tags question: http://stackoverflow.com/q/28373516
tags question: http://stackoverflow.com/q/28420949
tags question: http://stackoverflow.com/q/28348538
tags question: http://stackoverflow.com/q/28396735
tags question: http://stackoverflow.com/q/28422290
tags question: http://stackoverflow.com/q/28362548
tags question: http://stackoverflow.com/q/28318142
tags question: http://stackoverflow.com/q/28345395
tags question: http://stackoverflow.com/q/28302770
tags question: http://stackoverflow.com/q/28319554
tags question: http://stackoverflow.com/q/28348885
tags question: http://stackoverflow.com/q/28293339
tags question: http://stackoverflow.com/q/28300165
tags question: http://stackoverflow.com/q/28337528
tags question: http://stackoverflow.com/q/28352264
type: Tag
tags question: http://stackoverflow.com/q/28340190
tags question: http://stackoverflow.com/q/28299277
tags question: http://stackoverflow.com/q/28295678
tags question: http://stackoverflow.com/q/28411402
tags question: http://stackoverflow.com/q/28313692
tags question: http://stackoverflow.com/q/28340466
tags question: http://stackoverflow.com/q/28293299
tags question: http://stackoverflow.com/q/28409130
tags question: http://stackoverflow.com/q/28336651

http://stackoverflow.com/comment/44943638
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28293863
has text: @ankur-singhal partial data. The article is not complete only part of it
type: Comment

http://stackoverflow.com/q/28385501
tagged with: events
favorite count: 0
upvote count: 2
type: AnsweredQuestion
score: 2
tagged with: components
has title: React - Updating state for each child component
has answer: http://stackoverflow.com/a/28386196
type: Question
tagged with: reactjs
tagged with: javascript
has body: Not sure if i'm understanding this correctly. If i'm making a child component, type button, that increments its own counter, is it possible to do so without having 2 separate functions? the following i've done seems like a hack? what if theres X amount of buttons, how would i refactor this code to be more dynamic? REF's seem to work in the way i can reference the html in the child, but what about the other way? Am i even thinking about this the right way, because component has its own state, should it have its own update method? /*** @jsx React.DOM */ var MyComponent = React.createClass({ getInitialState: function() { return { counter1: 1, counter2: 1 }; }, increment: function(i) { if (i === 1) { this.setState({ counter1: this.state.counter1 + 1 }); } else { this.setState({ counter2: this.state.counter2 + 1 }); } }, render: function() { return ( &lt; div &gt; &lt;ChildComponent item = {this.state.counter1} click={this.increment.bind(this, 1)}/&gt; &lt;ChildComponent item={this.state.counter2} click={this.increment.bind(this, 2)}/ &gt; &lt; /div&gt; ); } }); var ChildComponent = React.createClass({ render: function() { return ( &lt;div&gt; &lt;h1&gt; Counter {this.props.item} &lt;/h1 &gt; &lt;button onClick = {this.props.click} &gt; ++ &lt; /button&gt; &lt;/div &gt; ); } }); React.render( &lt; MyComponent / &gt; , document.body);
has comment: http://stackoverflow.com/comment/45108817
has comment: http://stackoverflow.com/comment/45108917
tagged with: state
answer count: 1
accepted answer: http://stackoverflow.com/a/28386196
downvote count: 0

http://stackoverflow.com/q/28330474
has answer: http://stackoverflow.com/a/28330547
type: AnsweredQuestion
score: 0
type: Question
has answer: http://stackoverflow.com/a/28330520
has title: Trouble working with Date object in Javascript
has comment: http://stackoverflow.com/comment/45008109
tagged with: javascript
has body: I've written this function to get the current time, like a custom time stamp, and I'm getting an unexpected result. When the current minute is anywhere from "00" to "09", the Javascript method getMinutes() returns from "0" to "9" respectively. I'm using a switch to get this cases and add another "0" in front, but it's not working as expected. This is my full code: function horaActual() { var d = new Date(); var dia = ''; var hora = ''; var minutos = ''; switch (d.getDay()) { case 0: dia = 'Dom'; break; case 1: dia = 'Lun'; break; case 2: dia = 'Mar'; break; case 3: dia = 'Mie'; break; case 4: dia = 'Jue'; break; case 5: dia = 'Vie'; break; case 6: dia = 'Sáb'; break; }; switch (d.getHours()) { case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9: hora = '0' + String(d.getHours()); break; default: hora = String(d.getHours()); break; }; switch (d.getMinutes()) { case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9: minutos = '0' + String(d.getMinutes()); break; default: minutos = String(d.getMinutes()); break; }; return String(dia + ' ' + hora + ':' + minutos); } For example, right now the function returns "Lun 17:5" when it should return "Lun 17:05". Any comments are welcome!
answer count: 2
accepted answer: http://stackoverflow.com/a/28330520
possible better answer: http://stackoverflow.com/a/28330547

http://stackoverflow.com/q/28426605
has title: i need to test an html page i made by a mobile connected through verizon
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
accepted answer: http://stackoverflow.com/a/36852144
has body: i have this page http://m.bsmitho.com/ and i need someone who's connected through a verizon mobile (mobile connection not wifi) to test my page and tell me if the verizon mobile logo appears ? the code i have used : &lt;script type="text/javascript"&gt; $(document).ready(function() { $.get("http://ipinfo.io", function (response) { if (response.org == "AS6541 Verizon Online LLC") { document.getElementById("verizon").style.display = "block"; } }, "jsonp"); }); &lt;/script&gt; please i need your help, soon. thank you
has comment: http://stackoverflow.com/comment/61277455
favorite count: 0
upvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/36852144
downvote count: 1
type: Question
tagged with: testing
tagged with: mobile
tagged with: javascript

http://stackoverflow.com/comment/45199983
type: QuestionComment
comment on: http://stackoverflow.com/q/28434778
has text: You can build the array in js then send via ajax, or send the pieces via ajax and build in php.
score: 0
type: Comment

http://stackoverflow.com/comment/45058988
comment on: http://stackoverflow.com/q/28357606
score: 0
has text: i dont see any variable in there
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45115597
has text: Sweet! This explanation makes sense. Gonna work on it and get back to you. Thanks for the link about the Channel. Looks really cool.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28388744

http://stackoverflow.com/comment/44988975
comment on: http://stackoverflow.com/a/28319880
has text: @Aoxi check new links in my edit, sorry, not much time, I hope it helps
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45037653
type: QuestionComment
has text: I think it's not allowed, according to security reasons. On web the only way to communicate between iframe and parent window is `window.parent.postMessage`, I think it should also work in nw.js. http://blog.teamtreehouse.com/cross-domain-messaging-with-postmessage May be in your case you pass js code what you want to run in a message.
score: 0
comment on: http://stackoverflow.com/q/28341591
type: Comment

http://stackoverflow.com/comment/45002856
has text: @RE350, yes you are right
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28327247

http://stackoverflow.com/q/28343801
has title: JQuery selection help needed
accepted answer: http://stackoverflow.com/a/28344015
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28344134
answer count: 6
has answer: http://stackoverflow.com/a/28344285
has answer: http://stackoverflow.com/a/28344015
has body: This should be a simple answer for those who feel at home with selecting stuff with jquery, so here I go. I have this piece of HTML: cooljobdom subitem label 1 city1 address1 subitem label 2 city2 address2 subitem label 3 city3 address3 I would like to have the following string as the result of the selection: city1,address1; city2,address2; city3,address3. sofar I have this selection: var value = $(".cooljobdom-subdomains .cooljob-subitem .block-middle").text(); value += $(".cooljobdom-subdomains .cooljob-subitem .block-middle").next().text(); alert(value); but this gives me city1city2city3address1address2address3. Keep in mind that there is a variable number of divs with "cooljob-subitem" class. Thank you!
has answer: http://stackoverflow.com/a/28343896
type: Question
has answer: http://stackoverflow.com/a/28344187
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28343896
has answer: http://stackoverflow.com/a/28344611

http://stackoverflow.com/q/28383607
downvote count: 1
type: Question
has body: I'm working with WebStorm. I used it's built-in feature to install jQuery. It now appears in the External Libraries section of the project. But I can't link my Html files to it (&lt;script src="???"&gt;&lt;/script&gt;). How can this be done?
tagged with: javascript
has answer: http://stackoverflow.com/a/28411898
tagged with: webstorm
answer count: 1
has title: WebStorm: How can I link the HTML to an installed JS library?
score: 1
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/28411898
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
upvote count: 2

http://stackoverflow.com/comment/45108798
comment on: http://stackoverflow.com/q/28384414
type: Comment
type: QuestionComment
score: 0
has text: http://stackoverflow.com/questions/19231678/how-can-i-change-the-sliding-animation-to-fade-in-out-with-transition-on-bootstr

http://stackoverflow.com/q/28332155
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45012937
answer count: 0
type: UnansweredQuestion
upvote count: 1
type: Question
score: 1
has body: I have the following code in a spreadsheet, part of the script, and I want to run my HTML file called "server" from my .gs file called "code.gs". //code.gs function start() { var ui = HtmlService.createHtmlOutputFromFile('ui'); } function getDriveFiles(continuationToken) { if(continuationToken) { var files = DriveApp.continueFileIterator(continuationToken); } else { var files = DriveApp.getFiles(); } var i = 0; while (files.hasNext() &amp;&amp; i &lt; 10) { var file = files.next(); SpreadsheetApp.getActiveSheet().appendRow([file.getName(), file.getUrl()]); i++; if(i == 10) { return files.getContinuationToken(); } } } the program starts in the function "start()" then I want to run the "HTML" file so I continued the program but not be as. //server.html start(); &lt;script&gt; function start() { google.script.run.withSuccessHandler(onSuccess).getDriveFiles(); } function onSuccess(continuationToken) { if(continuationToken) { google.script.run.withSuccessHandler(onSuccess).getDriveFiles(continuationToken); } } &lt;/script&gt; If you could help me I would appreciate them, previous mind was doing it with this function. function start() { var ui = HtmlService.createHtmlOutputFromFile('ui'); return SpreadsheetApp.getUi().showSidebar(ui); } and executing the program but with a sidebar, but at the moment of putting an activator, run at a certain time not is executed by that could not run the "getUi" function in that environment. then what I do is remove the part of the sidebar and do it direct. I hope you can understand me, i write from México
tagged with: google-apps-script
downvote count: 0
tagged with: javascript
has title: as running an HTML file from JavaScript
has comment: http://stackoverflow.com/comment/45037106
favorite count: 0

http://stackoverflow.com/a/28413042
downvote count: 0
has body: You can just call your init function inside your controller? angular.module('app').controller('blacklistTableController', function ($scope) { $scope.init = function () { } // Call on startup $scope.init(); }); plus there will only be a single route for the whole app at / which seems to defeat the point of using routeProvider. Yes and no, you could also use this to indicate that your application is loading. For instance if you use UI-Router, you could do something as this: angular.module('app').value('loading', { isLoading: false }); angular.module('app').run(function ($rootScope, loading) { $rootScope.$on('$stateChangeStart', function () { loading.isLoading = true; }); $rootScope.$on('$stateChangeSuccess', function () { loading.isLoading = false; }); }); angular.module('app').config(function ($stateProvider, $urlRouterProvider) { $urlRouterProvider.default('/start'); $stateProvider.state('start', { url: '/start', templateUrl: '/views/start.html', controller: 'blacklistTableController', resolve: { myObj: function () { // init logic return 'something'; } } }); }); When you now navigate to the /start route your page will only render when myObj is resolved. This can also be a promise. The resolved data is available inside your controller as the name you've used. In this case myObj: angular.module('app').controller('blacklistTableController', function ($scope, myObj) { $scope.data = myObj; // resolved via ui-router });
has comment: http://stackoverflow.com/comment/45160911
type: Answer
answers question: http://stackoverflow.com/q/28412765
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/28412765
type: AcceptedAnswer

http://stackoverflow.com/q/28288955
type: UnansweredQuestion
has title: Batching DOM updates from directive
answer count: 0
downvote count: 0
has body: I am wondering if there is a way to batch the actual dom writing when the contents of a directive is written to the DOM. The use case is a large DOM where I want to optimize by updating the DOM in large batches rather than many small updates. I am trying to compile a list of dynamic child directives, but I don't see a way to ensure that the directives are packaged and sent as a single DOM update. Consider the example bellow: angular.module('test').directive('parentDirective',function($compile){ return{ link:function(scope, elem){ var html = ''; for(var i = 0; i < 10; i++){ html += " "; } var e = angular.element(html); e.html(e); $compile(e)(scope); } }; }); //Using the parent-directive will dynamically add n child directives. .. Each child directive uses a template, and I am wondering, is there a way to "batch write" all the child directives in a single update? Rather than having each child directive issue a DOM update independently. The child directives use isolate scope and the template is referencing the scope object throughout the template. The template is a large block of html referenced via a templateUrl in the child directive. I can't skip the child directives by simply inlining the template since the structure needs to be repeated and data bound.
type: Question
tagged with: angularjs-directive
score: 1
tagged with: javascript
tagged with: angularjs-scope
upvote count: 1
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/comment/45085133
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28372327
has text: ok so start throwing some console.log() lines in there and find out what it is not doing

http://stackoverflow.com/q/28423557
answer count: 0
score: 1
tagged with: scroll
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45180245
tagged with: javascript
has title: Javascript lagging for touchpad when changing css on scroll event
downvote count: 0
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: css
has body: I wrote something like $element.on "scroll", (e) -&gt; top = $element[0].scrollTop left = $element[0].scrollLeft categoryLabelsInner.style.top = -top + 'px' monthLabelsInner.style.left = -left + 'px' It works fine if I scroll using my mouse, however there's a significant lagging effect if I'm using touchpad in my 13' macbook. What's more, if I add the following code: $element.on "mousewheel", (e) -&gt; return Then it works fine for touchpad. Any ideas?

http://stackoverflow.com/comment/45144229
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28404957
type: Comment
has text: This is range 0-6 and have non-even distribution.

http://stackoverflow.com/q/28309411
answer count: 1
has body: We have a third party widget on our site. This widget displays dynamically-created content. I would like to track clicks to their content via Google Analytics, but as their tech support said, due to the fact that the content is dynamically-generated, "it is difficult to add an event listener to these links." They suggest "waiting for this product content widget content to load, then using jQuery to get all the links..." Now, I believe I know how to gather the links once they load, but does anyone have any idea how I can "wait for the content to load?" Using info from @cmorrissey, I have come up with the following: $('p.link-track').ready(function(){ $('p.link-track').on('click', 'a', function(e) { ga('send', 'event', 'link-track', 'click'); }); }); But that did not work. Per How to get all the links of a list inside a div? I have also tried: $('p.link-track').ready(function(){ $('p.link-track').on('click', 'a', function(e) { e.preventDefault(); console.log($(this).attr('href')); ga('send', 'event', 'link-track', 'click'); }); }); I have also tried $(document).ready(function(){ in place of $('p.avantlink-track').ready(function(){
type: UnansweredQuestion
tagged with: google-analytics
type: Question
tagged with: javascript
has title: Wait for dynamic content to load before gathering links
tagged with: jquery
linked to: http://stackoverflow.com/q/18175442
score: 0
has answer: http://stackoverflow.com/a/28309459

http://stackoverflow.com/comment/45110904
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28386580
has text: If you opoen a tab in your broser and put this /Users/aweeeezy/Sites/proj1/htdocs/ajax.php what does it show? Well, append the server name before of course http://blablabla/Users....
type: Comment

http://stackoverflow.com/a/28321871
type: Answer
accepted answer of: http://stackoverflow.com/q/28321826
downvote count: 0
answers question: http://stackoverflow.com/q/28321826
score: 5
has body: The entire point of setInterval is to call something every n seconds. If you want to call a function once after some time has passed, use setTimeout instead of setInterval.
type: AcceptedAnswer
upvote count: 5

http://stackoverflow.com/comment/45148546
score: 1
comment on: http://stackoverflow.com/q/28406987
has text: You can't cancel `on(before)unload` event, hence all the code for canceling the event is useless in the posted snippet. Also, there's no way to detect the element or script/function which has triggered an unload event in its handler, so you've just handle this before the handler will be executed.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28329240
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28328823
has body: Use % for padding and adjust accordingly. See this revised Fiddle for an example. The revised Fiddle comments out: $('.intro section.white').css('width', circleWidth + 'px'); Fixing the width of the white circle means that it is not responsive any more. If you need to do that for some reason, you would have to make adjustments.
answers question: http://stackoverflow.com/q/28328823
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45010784
type: Answer

http://stackoverflow.com/a/28708320
answers question: http://stackoverflow.com/q/28287833
has body: Is it possible to somewhat declare a JavaScript File as "local" and thus gaining file-system permissions? Firefox extensions would have the necessary permissions to access the file system. Is it possible to use IEs (Or even Chromes/Firefoxes/Whatevers) renderer in Java? Yes, e.g. with the SWT Browser Widget or JavaFX WebView
upvote count: 1
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/69253282
comment on: http://stackoverflow.com/a/28359497
score: 0
type: AnswerComment
type: Comment
has text: @Prachit - Won't this solution fall apart if the first paragraph is smaller than 300 chars?

http://stackoverflow.com/q/28356091
type: Question
tagged with: javascript
tagged with: karma-jasmine
score: 0
has comment: http://stackoverflow.com/comment/45055879
answer count: 1
accepted answer: http://stackoverflow.com/a/28356211
tagged with: angularjs
has title: How to test my http request in my app
has body: I am trying to write units test for my app and I have the following issue In my controller, I have something like $scope.test1 = function() { productFactory.getName() .then(function(products){ $scope.result = products; }) } productFactory angular.module('myApp').factory('productFactory', function($http) { var factoryObj = {}; factoryObj.getName = function() { return http.get(url) } return factoryObj }) In my unit test file describe('test here', function () { var testCtrl, scope, httpBackend, mockFactory; beforeEach(module('myApp', function($provide){ $provide.value('productFactory', mockFactory); })); // Initialize the controller and a mock scope beforeEach(inject(function (_$controller_, _$rootScope_, _$httpBackend_, _productFactory_) { scope = _$rootScope_.$new(); httpBackend = _$httpBackend_; mockFactory = _productFactory_; testCtrl = _$controller_('testCtrl', { $scope: scope }); it('should get product name', function() { scope.test1(); //I am not sure how to test the results }); })); When I run karma test, it gives me TypeError: 'undefined' is not an object (evaluating 'productFactory.getName()') I am not sure how to test the http result and fix the error. Can anyone help me about it? Thanks a lot!
has answer: http://stackoverflow.com/a/28356211
type: AnsweredQuestion
tagged with: unit-testing

http://stackoverflow.com/comment/45143697
score: 0
type: Comment
has text: this is my fiddle where i pasted controller for your reference http://jsfiddle.net/anujay0402/st1yxbke/6/
type: QuestionComment
comment on: http://stackoverflow.com/q/28404151

http://stackoverflow.com/q/28431505
has answer: http://stackoverflow.com/a/45871870
tagged with: google-chrome-app
has answer: http://stackoverflow.com/a/28432087
has comment: http://stackoverflow.com/comment/45193833
has comment: http://stackoverflow.com/comment/131661858
has answer: http://stackoverflow.com/a/71831828
linked to: http://stackoverflow.com/q/26517988
possible better answer: http://stackoverflow.com/a/45871870
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/78167211
has comment: http://stackoverflow.com/comment/45194078
has answer: http://stackoverflow.com/a/78518405
has title: Unchecked runtime.lastError when using Chrome API
accepted answer: http://stackoverflow.com/a/28432087
type: Question
linked to: http://stackoverflow.com/q/59914490
has answer: http://stackoverflow.com/a/47818430
has comment: http://stackoverflow.com/comment/45194319
has body: I use chrome.fileSystem API in my app to open a file. When I click the Cancel button of the file chooser dialog, an error occurs: Unchecked runtime.lastError while running fileSystem.chooseEntry: User cancelled How to fix this error?
tagged with: javascript
answer count: 6
has answer: http://stackoverflow.com/a/70809112
has comment: http://stackoverflow.com/comment/45194236
upvote count: 47
tagged with: google-chrome-extension
downvote count: 0
favorite count: 0
score: 47

http://stackoverflow.com/q/28393367
tagged with: javascript
score: 0
has body: I understand it's some degree of JavaScript, but it's not something I know how to do despite knowing a reasonable amount of it. Firstly, the hover-flip animations, that can't be a CSS switch, because I've never seen a transition quite like it.
upvote count: 1
answer count: 1
downvote count: 1
tagged with: web
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45123695
type: AnsweredQuestion
has title: How are the tiles on Lynda made?
has comment: http://stackoverflow.com/comment/45123636
has answer: http://stackoverflow.com/a/28393484
accepted answer: http://stackoverflow.com/a/28393484
type: Question

http://stackoverflow.com/comment/44936362
type: Comment
comment on: http://stackoverflow.com/a/28291177
type: AnswerComment
has text: Look like there might not be a way to define `console` globally without using [globals](http://www.hacksparrow.com/global-variables-in-node-js.html). What I might do (which isn't really what I wanted to do): `require('./lib/main')(function(console){...worker code...})` and in main.js I'll just return console as an argument.
score: 0

http://stackoverflow.com/comment/44954820
score: 2
has text: You're shoving too much in `localStorage`.
comment on: http://stackoverflow.com/q/28301776
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44923176
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28284236
has text: @NickDugger We shipped updates to Internet Explorer that redesigned the developer tools; if you still have the developer tools vertical and on the left, you still have more updates to install. Please check Windows Update again. I'll look on our end for a bug in document modes that may have been resolved in one of these later updates.
type: Comment

http://stackoverflow.com/comment/45062818
has text: yeah buddy den you should do it with js
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28359954
type: AnswerComment

http://stackoverflow.com/comment/45041571
type: Comment
score: 1
has text: What have you tried? There's no jQuery code in your question showing what your approach is, and no `span` elements in your HTML.
type: QuestionComment
comment on: http://stackoverflow.com/q/28348726

http://stackoverflow.com/comment/45181556
type: Comment
comment on: http://stackoverflow.com/q/28403445
score: 0
type: QuestionComment
has text: change `"views/home.html"` to `"/views/home.html"`, add `/` before url

yahoo
type: Tag
tag name: yahoo
tags question: http://stackoverflow.com/q/28428245

http://stackoverflow.com/comment/45102286
has text: @manu Do not edit your question to reflect an answer given, it is VERY confusing for anyone reading this and reflects badly on the person who has tried to help you with a valid answer. Give details to the answer you have received about your compile error.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28381671
score: 1

http://stackoverflow.com/comment/45034782
type: Comment
has text: **Our example differ**. I listen mouseenter on '.item'. You listen mouseenter on 'img'. I use delegate in real code. It is simple example.**Our example differ**. I listen mouseenter on '.item'. You listen mouseenter on 'img'. I use delegate in real code. It is simple example.
type: AnswerComment
comment on: http://stackoverflow.com/a/28344735
score: 0

http://stackoverflow.com/a/28345952
has body: I'm not sure if you will satisfied on this but i found something that can help a little on my problem. jQuery(document).ready(function () { $(this).bind('mousewheel', function(e){ if(e.originalEvent.wheelDelta /120 &lt; 1) { $('html, body').delay(200).animate({ scrollTop: $('#content').offset().top }, 1000); } }); }); DEMO
answers question: http://stackoverflow.com/q/28344695
score: 0
type: Answer

http://stackoverflow.com/q/28354066
type: Question
tagged with: jquery-animate
answer count: 1
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45065642
tagged with: stopwatch
has title: Javascript Stopwatch in Raphael Library won't continuously tick
has body: I'm quite new to Java and am making a watch as part of my Uni course. Ive made a ticker on a small face that i want to tick round per second operated by clicking to buttons, however the hand only moves when i click it and won't carry on. Here is my code: sbutton1.click(function(){ stoshand.animate({transform: [ 'r',tick,250,345]}) tick=tick+6; }, 500); sbutton2.click(function(){ stoshand.stop(); }); Can anyone help as to why it won't continuously tick after one click, rather than me having to continuously tick. THANKS :)
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28354284
tagged with: ticker
tagged with: raphael

http://stackoverflow.com/comment/45046876
type: Comment
comment on: http://stackoverflow.com/a/28351550
has text: Given the question is 'round up' you may want to use `Math.ceil()` instead of `Math.floor()`? @ru-pearls, so long as that variable is, or holds, a number then yes.
type: AnswerComment
score: 4

http://stackoverflow.com/comment/44970762
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28309890
has text: If I remember correctly the Search and Page numbers are absolutely positioned based on the parent it is rendered in.
type: Comment

http://stackoverflow.com/q/28398772
favorite count: 0
accepted answer: http://stackoverflow.com/a/28399078
type: AnsweredQuestion
tagged with: onclick
downvote count: 7
has body: Here is the simple shopping cart I was looking for: http://code.google.com/p/jscart/wiki/Example. Thank you everyone for your help. All the notes led me to rethink and ponder ... hmm, I wonder if someone out there has already done something similar ...
has answer: http://stackoverflow.com/a/28399078
tagged with: cart
type: Question
has title: Google's Simple Shopping Cart
tagged with: function
upvote count: 0
answer count: 1
tagged with: javascript
score: -7
tagged with: jquery

http://stackoverflow.com/q/28404626
has comment: http://stackoverflow.com/comment/45157885
type: AnsweredQuestion
has body: I am trying number counter animation for displaying the value of an element and setTimeout() works as the specified time in firefox but for some reason in IE it is invoked quickly. Jsfiddle Code The below is my code.. $('document').ready(function() { var i=1,data=10; my_int=setInterval( function () { if(i&lt;=data) $('p').text(i++); else $('body').append("overflow"); } ,64); setTimeout(function() { $('body').append("done");clearInterval(my_int); },64*data); }); By quickly I mean in IE setInterval() is executed 8 times and then it is invoking the timeout function (while it should loop for 10 times). I have also gone through these question but none of them helped. one two is it a problem in IE or is it problem with my code itself ??
tagged with: settimeout
tagged with: internet-explorer
linked to: http://stackoverflow.com/q/11230097
has answer: http://stackoverflow.com/a/28405232
downvote count: 1
type: Question
upvote count: 0
tagged with: firefox
tagged with: javascript
score: -1
linked to: http://stackoverflow.com/q/24336913
answer count: 1
accepted answer: http://stackoverflow.com/a/28405232
tagged with: setinterval
favorite count: 0
has title: setTimeout is executing fast in IE
has comment: http://stackoverflow.com/comment/48314437

http://stackoverflow.com/comment/45089006
type: QuestionComment
comment on: http://stackoverflow.com/q/28374131
score: 0
has text: @FelixKling it doesn't make sense to me to not be able to prevent the DOM from updating itself to a `checked` state. This goes against the expected behavior of `preventDefault`.
type: Comment

http://stackoverflow.com/a/38010736
score: 1
upvote count: 1
has body: Create a variable called moves and give it a value of 0. moves++ when a "move" occures. add if(moves == 9) {draw} at the end of each move
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/28424575

http://stackoverflow.com/q/28392475
tagged with: math
upvote count: 5
tagged with: prototype
type: Question
has body: Trying to get the average of an array. Array.prototype.average = function() { var sum = 0; this.reduce(function(a, b) { sum = a + b; }); return sum / this.length; }; [2, 15, 7].average(); Why does the average function call return NaN?
accepted answer: http://stackoverflow.com/a/28392509
score: 5
has title: Why does my reduce based average function return NaN?
tagged with: arrays
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28392486
has answer: http://stackoverflow.com/a/28392509
has answer: http://stackoverflow.com/a/28392802
answer count: 4
favorite count: 0
has comment: http://stackoverflow.com/comment/45121899
has answer: http://stackoverflow.com/a/28392758
possible better answer: http://stackoverflow.com/a/28392486
type: AnsweredQuestion

http://stackoverflow.com/comment/44999882
comment on: http://stackoverflow.com/a/28326011
score: 0
type: AnswerComment
type: Comment
has text: Thanks for the reply. I've completed those steps but still don't see the alert window pop up.

http://stackoverflow.com/q/28353426
has answer: http://stackoverflow.com/a/28353679
has comment: http://stackoverflow.com/comment/45050544
has comment: http://stackoverflow.com/comment/45051569
upvote count: 1
has body: I have been scratching my head over this problem for a while now. I have made a textarea and created a model with ng-model. This works all fine. I also have a button that uses plain Javascript for resetting the textarea. The binding stops working at that moment I click this button and I still can see my text in the other field, but the textarea is emtpy. I have recreated the problem here Fiddle. window.onload = function () { document.getElementById('btn').onclick = function () { document.getElementById('textarea').value = ""; }; }; Am I missing something here or is this not how binding works in Angular. When I start retyping it starts 'listening' again and displays the correct text. Does somebody have a clue or encountered this problem before? Thanks in advance.
has comment: http://stackoverflow.com/comment/45051164
type: Question
has title: Ng-model not updating after resetting textarea in AngularJS
has comment: http://stackoverflow.com/comment/45051331
has comment: http://stackoverflow.com/comment/45053752
has comment: http://stackoverflow.com/comment/45051281
score: 1
has comment: http://stackoverflow.com/comment/45050806
has comment: http://stackoverflow.com/comment/45051705
has comment: http://stackoverflow.com/comment/45051457
has comment: http://stackoverflow.com/comment/45051520
has answer: http://stackoverflow.com/a/63530331
downvote count: 0
has comment: http://stackoverflow.com/comment/45051477
tagged with: javascript
linked to: http://stackoverflow.com/q/14994391
has comment: http://stackoverflow.com/comment/45051304
favorite count: 0
has comment: http://stackoverflow.com/comment/45051222
has comment: http://stackoverflow.com/comment/45051186
has comment: http://stackoverflow.com/comment/45051499
tagged with: angularjs
answer count: 3
has answer: http://stackoverflow.com/a/28353634
has comment: http://stackoverflow.com/comment/45051228
has comment: http://stackoverflow.com/comment/45051039
has comment: http://stackoverflow.com/comment/45051058
possible better answer: http://stackoverflow.com/a/28353679
has comment: http://stackoverflow.com/comment/45051496
has comment: http://stackoverflow.com/comment/45051542
has comment: http://stackoverflow.com/comment/45051073
accepted answer: http://stackoverflow.com/a/28353634
type: AnsweredQuestion

http://stackoverflow.com/comment/45154821
type: AnswerComment
type: Comment
has text: Or just `var number = +formattedNumber;`, this is a commonly accepted way of translating a well-formatted string to a number.
comment on: http://stackoverflow.com/a/28410369
score: 0

http://stackoverflow.com/comment/45024507
type: QuestionComment
comment on: http://stackoverflow.com/q/28339586
score: 0
type: Comment
has text: In other words, you expect `entity.fullCode` to equal the concatenation of the first two?

http://stackoverflow.com/q/28416113
tagged with: xsocket
has body: This is for Xsockets. I have a client connected to a socket, lets say the client looses internet connection, is there a xSocket function that will get called on the client that will let me know that the client (itself) is not connected to the socket anymore? Currently, im just getting a error: WebSocket is already in CLOSING or CLOSED state. I know that the socket itself knows that the client is disconnected, but how can the client know that its diconnected? The XSockets.Events.onError and XSockets.Events.close functions are not called. PS: Im running 3.0.3
score: 0
tagged with: xsockets.net
type: Question
has answer: http://stackoverflow.com/a/28429866
tagged with: javascript
answer count: 1
type: UnansweredQuestion
has title: Detecting xSocket connection loss in client

http://stackoverflow.com/comment/45159333
type: AnswerComment
type: Comment
has text: Cookies and localStorage are equivalent to sessions and also expire, you should not rely on it for application states. Application state should be preserved through the URL. User object isn't also for application state, user object is mostly for user preferences, settings, etc.
comment on: http://stackoverflow.com/a/28412872
score: 0

http://stackoverflow.com/comment/45075494
type: AnswerComment
comment on: http://stackoverflow.com/a/28365548
score: 0
has text: I think due to you last point I found the problem! They both have a parent controller. This is because of the ui-router. The parent controller is called projects. If I check the scope object of my create controller the new data is added. BUT if i check the scope object of the parent controller then the `$$childTail` the `$scope.variable` has not changed. Why does my view listen to the parent controller if i change and initiate the variable in the child (show, create) controllers?
type: Comment

input
tags question: http://stackoverflow.com/q/28409317
tags question: http://stackoverflow.com/q/28380382
tags question: http://stackoverflow.com/q/28376921
tags question: http://stackoverflow.com/q/28326102
tags question: http://stackoverflow.com/q/28379705
tags question: http://stackoverflow.com/q/28355726
tags question: http://stackoverflow.com/q/28360729
tags question: http://stackoverflow.com/q/28350164
tags question: http://stackoverflow.com/q/28339586
tags question: http://stackoverflow.com/q/28412927
tags question: http://stackoverflow.com/q/28356425
tags question: http://stackoverflow.com/q/28289000
tags question: http://stackoverflow.com/q/28424886
tags question: http://stackoverflow.com/q/28402398
tag name: input
tags question: http://stackoverflow.com/q/28312848
type: Tag
tags question: http://stackoverflow.com/q/28425675
tags question: http://stackoverflow.com/q/28415355

http://stackoverflow.com/a/28408174
upvote count: 1
has comment: http://stackoverflow.com/comment/45150570
score: 1
answers question: http://stackoverflow.com/q/28408096
downvote count: 0
has body: Just try with following regex: ^\d+((,\d+)*,\d{3})?\.\d{2,3}$ demo
type: Answer

http://stackoverflow.com/comment/45058834
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28357631
score: 3
has text: Why do you need to pass `$` at all? Can't you just have `var $ = require('cheerio');` at the top of your module?

http://stackoverflow.com/q/28357821
type: Question
tagged with: environment-variables
answer count: 1
downvote count: 0
tagged with: javascript
has title: How do you access environment variables on the front end when using Yeoman's angular-fullstack generator?
favorite count: 0
tagged with: yeoman
has comment: http://stackoverflow.com/comment/45059356
has comment: http://stackoverflow.com/comment/56603896
tagged with: angularjs
type: UnansweredQuestion
upvote count: 1
has body: I'm using Yeoman's angular-fullstack generator. I want to access some environment variables in a front end controller (main.controller.js). The only way I know how to set environment variables is the following: server/config/environment/local.env.js 'use strict'; // Use local.env.js for environment variables that grunt will set when the server starts locally. // Use for your api keys, secrets, etc. This file should not be tracked by git. // // You will need to set these on the server you deploy to. module.exports = { DOMAIN: 'hidden', SESSION_SECRET: "hidden", // Control debug level for modules using visionmedia/debug DEBUG: 'hidden', CALENDAR_ID: 'hidden', API_KEY: 'hidden' }; However, from what I understand, this only makes it accessible on the server, but I want it on the front end. The following don't work in my front end controller: ENV.API_KEY and process.env.API_KEY. What should I do?
has answer: http://stackoverflow.com/a/28357944
score: 1

http://stackoverflow.com/q/28319377
has body: is there anyway for example when i navigate to http://example.com/links/pages/index.html i have 4 .html files in /pages directory with names page1.html , page2.html , page3.html , page4.html then that index.html must show me a list of pages that is exist in this /pages directory? without i list them on index.html manually by myself. i only want them to be listed at index.html when ever i create a new page at /pages directory here's some example hope it helps : http://plnkr.co/edit/kIiod2DR6zgSpmuUNsUi?p=preview or this example page 1 page 2 page 3 page 4
has title: javascript auto files listing in the page
has comment: http://stackoverflow.com/comment/44987588
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28320183
has comment: http://stackoverflow.com/comment/44987468
type: Question
tagged with: http://stackoverflow.com/tag/html
score: 0
tagged with: php
answer count: 1

http://stackoverflow.com/q/28323972
has comment: http://stackoverflow.com/comment/44996869
favorite count: 0
has comment: http://stackoverflow.com/comment/44997279
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28323991
has answer: http://stackoverflow.com/a/29708669
answer count: 4
has answer: http://stackoverflow.com/a/28324024
score: 1
has comment: http://stackoverflow.com/comment/44996105
upvote count: 1
has title: AngularJS ng-click Directive Not Calling Function
type: Question
has answer: http://stackoverflow.com/a/28324890
downvote count: 0
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
has body: I'm trying to use ng-click to call a function in my controller, but I haven't been able to get that to work. I've stripped everything down to its simplest form, so that I now have this: Submit The first two statements (count = count + 1; count = count + 2;) execute just fine, but it won't call the alert function. When I take out the two count incrementing statements, the alert still won't work. Anytime I try to call a function, it fails, but plain old Javascript works. (Just an FYI, I have Javascript down the page that prevents the form from submitting and triggering a postback). Edit: I'll include my controller's code for this: myApp.controller('LawSearchController', ['$scope', function ($scope) { $scope.alert = function (text) { alert(text); }; }]);

http://stackoverflow.com/comment/45161948
type: Comment
comment on: http://stackoverflow.com/q/28414125
score: 0
has text: in node? in a browser?
type: QuestionComment

http://stackoverflow.com/q/28281216
tagged with: javascript
has answer: http://stackoverflow.com/a/28282165
answer count: 1
has body: I have a grid with a subgrid.During the grid initialization my height is set to 'auto' but i am also setting its max-height after initialization so i can have vertical scrollbars if the height is more than '500px'. I dont need horizontal scrollbars and i have defined css rule for it: overflow-x: hidden; overflow-y: auto; The scrollOffset is at its default i.e 18px. However when my grid is expanded to show subgrid the scollbar is visible in the last column instead of showing it in scrollbarOffset column. In this image below see the scrollbar is inside of last column: But below it honors the scrollOffset and its outside of last column: I want my scrollbar to be in the scrollbarOffset column if the max height has been reached. Please follow the test i created from somebody's test to recreate my problem. My actual grid is set to 'shrinkToFit' and overflow-x is hidden(which is needed for other purpose). Other than that the fiddle describes my scenario. Any suggestions or comments are welcomed. Thanks $("#grid").jqGrid({ datatype: "local", height: 'auto', colNames: ['Inv No', 'Thingy', 'Blank', 'Number', 'Status'], colModel: [{ name: 'id', index: 'id', width: 60, sorttype: "int"}, { name: 'thingy', index: 'thingy', width: 90, sorttype: "date"}, { name: 'blank', index: 'blank', width: 30}, { name: 'number', index: 'number', width: 80, sorttype: "float"}, { name: 'status', index: 'status', width: 80, sorttype: "float"} ], pager: 'pagerId', caption: "Stack Overflow Subgrid Example", subGrid: true, subGridOptions: { "plusicon" : "ui-icon-triangle-1-e", "minusicon" :"ui-icon-triangle-1-s", "openicon" : "ui-icon-arrowreturn-1-e", "reloadOnExpand" : false, "selectOnExpand" : true }, subGridRowExpanded: function(subgrid_id, row_id) { var subgrid_table_id, pager_id; subgrid_table_id = subgrid_id+"_t"; pager_id = "p_"+subgrid_table_id; $("#"+subgrid_id).html("&lt;table id='"+subgrid_table_id+"' class='scroll'&gt;&lt;/table&gt;&lt;div id='"+pager_id+"' class='scroll'&gt;&lt;/div&gt;…
tagged with: jquery
type: UnansweredQuestion
tagged with: css
score: 0
has title: Jqgrid vertical scrollbar shown internal to the last column in grid and not in scrollbarOffset column
type: Question
tagged with: jqgrid

http://stackoverflow.com/q/28380287
upvote count: 0
has title: Trouble with replace() and § JavaScript
has body: I am trying to figure a problem which leaves me scratching my head when I try to replace § with its ul code it seems the replace() function does not pick it. here's code: var replaced = str.replace(/%s/g, "&lt;span style='width:15px;height:10px;'&gt;&amp;#160;&lt;/span&gt;").replace(/§/g, "u/00a7") the %s works fine so I think its the double s itself not functioning properly. Thanks Solution I used: in the end I couldn't get the double s to replace so in the end I went with this : &amp;#92;u00a7 and it worked like a charm
type: Question
accepted answer: http://stackoverflow.com/a/28380301
tagged with: javascript
score: -1
tagged with: replace
has answer: http://stackoverflow.com/a/28380301
answer count: 1
downvote count: 1
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion

http://stackoverflow.com/q/28377733
tagged with: javascript
score: 15
favorite count: 0
has body: blob has null prepended at the start eg : blob:null/72438-4637-23673-34721. But when I use the same as a src to the , it shows up the correct image. I am using URL.createObjectURL call. I also tried using webkitURL. Both return a blob with null appended at the start. Also the blob value returned by URL and webkitURL are not the same. Here is the code snippet var dataUrl = canvas.toDataURL(); // The last piece of the data URL after the comma var byteString = atob(dataUrl.split(',')[1]); // Populate an array buffer var arrayBuffer = new ArrayBuffer(byteString.length); var uint8Array = new Uint8Array(arrayBuffer); for (var i = 0; i &lt; byteString.length; i++) { uint8Array[i] = byteString.charCodeAt(i); } var blob = new Blob([uint8Array], { type: "image/png" }); var blobVal = URL.createObjectURL(blob); Here the blobVal has "blob:null/1234-5678-9012- ..."
accepted answer: http://stackoverflow.com/a/28378004
type: AnsweredQuestion
tagged with: blob
has answer: http://stackoverflow.com/a/28378004
has title: URL.createObjectURL returns a blob with null prepended. Eg : Blob:null/12415-63
type: Question
upvote count: 15
tagged with: null
answer count: 1
downvote count: 0
tagged with: url

http://stackoverflow.com/comment/45018092
has text: bleh, you're looping over your rows by counting your columns
score: 0
comment on: http://stackoverflow.com/a/28335955
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/45045646
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28350495
type: QuestionComment
has text: There's no maths and if/then statements in PHP?

http://stackoverflow.com/a/28414703
upvote count: 3
downvote count: 0
has body: Even tho Pointy's answer may fit better here (talking about LESS), I want to remind that you can access stylesheet data directly via ECMAscript. You might be able to identify a specific rule and just grab the value. Might look like [].forEach.call(document.styleSheets, function( set ) { if( set.href &amp;&amp; set.href.indexOf( 'dialog.css' ) &gt; -1 ) { [].forEach.call( set.cssRules, function( rule ) { if( rule.selectorText === 'div#dialog-container-left' ) { // to whatever here, grab the value and store it for global application usage console.log( rule.style.backgroundColor ); } }); } });
type: Answer
answers question: http://stackoverflow.com/q/28414459
score: 3

http://stackoverflow.com/comment/45203963
type: QuestionComment
has text: Perhaps you are depending on some php code .... because when you select the url and press enter $_POST and $_GET variables are destructed so you can't use them
comment on: http://stackoverflow.com/q/28434937
score: 0
type: Comment

http://stackoverflow.com/a/28292844
has comment: http://stackoverflow.com/comment/44963537
has body: Off the top of my head, there are three possible approaches here. Tables Layout helpers (like Bootstrap or Pure) Inline blocks Inline, is the quickest fix. In your .team-skill class, set a max-width of your choosing (180px would do for now), then add: display: inline-block; float: left; Now depending on your window size, most of the team-skill divs ought to be snugging up to one another, column-style. However this approach isn't robust, and it doesn't take much to break it. Let's try tables... ///- Stick a team-skill div in here -/// ///- Put another team-skill div in here -/// ///- And so on... -/// Tables are nice 1) because they're native and require no plugins or frameworks, and 2) Well... umm... yes. They're nice and easy. They're certainly more robust than the inline solution, but they're not considered a responsive solution. If you want these columns to look nice across a wide variety of devices, get yourself acquainted with a layout framework. Here's a few: Skeleton Bootstrap Foundation Pure These frameworks will give you powerful tools with which to build any layout you want, including your 4 columns.
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28292480
accepted answer of: http://stackoverflow.com/q/28292480
type: Answer
has comment: http://stackoverflow.com/comment/44963447
has comment: http://stackoverflow.com/comment/44965276
has comment: http://stackoverflow.com/comment/44964745

http://stackoverflow.com/a/28309444
score: 1
has comment: http://stackoverflow.com/comment/44969889
downvote count: 0
type: Answer
has body: You can find shorter variable names faster, but only if you have atomic clock to measure it :) If your web application is slow, try to find bottleneck somewhere else.
answers question: http://stackoverflow.com/q/28309310
upvote count: 1
has comment: http://stackoverflow.com/comment/44970096

http://stackoverflow.com/comment/45044496
type: QuestionComment
type: Comment
has text: This is a link to the screenshot: https://dl.dropboxusercontent.com/u/76885657/stackoverflow/navigated.jpg
score: 0
comment on: http://stackoverflow.com/q/28349285

http://stackoverflow.com/comment/45531784
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28373347
has text: @BrettCaswell - I know how to access and read the JSON file, what I dont know is how to store the changes.

http://stackoverflow.com/q/28305485
has comment: http://stackoverflow.com/comment/44962250
has comment: http://stackoverflow.com/comment/44962142
has title: PHP, AJAX, and server-client frustrations
tagged with: php
has body: I have a table that's generated from php. The way I've done this is probably not the most efficient way to do it since I wrote it all myself and I'm not an expert. Everything starts when the user pastes part numbers into a search box on a previous page, which is then sent here to return.php under the variable lines. return.php $c = $_POST['c']; if (!$_SESSION['lines']) { $_SESSION['lines'] = $_POST['lines']; } $partNumber = array(); //define $partNumber as array $x = -1; $supplierQuery = "SELECT distinct supplier, quotePartNumber FROM allparts WHERE quotePartNumber = '$q'" ; $supplierResult = mysqli_query($con, $supplierQuery); foreach ($_SESSION['lines'] as $q) { $x = $x + 1; // each time we loop through this, x++ while ($row = mysqli_fetch_array($supplierResult)) { $partNumber[] = $row['quotePartNumber']; $customerQuery = "SELECT DISTINCT quoteCustomer FROM $supplier where quotePartNumber = '$q'"; if (!$c) { // $c becomes set once a user types in an end customer - without that, we want ALL generic info to be returned. $costQuery = "SELECT * FROM $supplier where quotePartNumber = '$partNumber[$x]' ORDER BY quoteCost ASC LIMIT 1" ; } else { $costQuery = "SELECT * FROM $supplier where quotePartNumber = '$partNumber[$x]' and quoteCustomer = '$c' ORDER BY quoteCost ASC LIMIT 1" ; } $getCustomer = mysqli_query($con, $customerQuery); } later on in my table, I have this: <?= $partNumber[$x] ?> <?= $cost ?> <?php if($c) { print $c; } else { print "Select Purchasing Customer";} ?> <?php while ($row = mysqli_fetch_array($getCustomer)) { $customerName = $row['quoteCustomer']; ?> <?= $customerName ?> <?php } ?> Any change to the dropdown will launch this script: What I'm trying to do Let's say my generated table has 3 rows, with part numbers There is a drop-down to allow the user to select a specific customer. When the user clicks on this, the script takes that value and uses AJAX to send it back to the same page (return.php), which then grabs it using the $c = $_POST['c']; co…
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44964107
has comment: http://stackoverflow.com/comment/44964290
score: 0
has comment: http://stackoverflow.com/comment/44963132
has comment: http://stackoverflow.com/comment/44962236
has comment: http://stackoverflow.com/comment/44963465
has answer: http://stackoverflow.com/a/28306862
has comment: http://stackoverflow.com/comment/44962665
type: Question
has comment: http://stackoverflow.com/comment/44963202
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28306862
has comment: http://stackoverflow.com/comment/44962594
has comment: http://stackoverflow.com/comment/44962581
has comment: http://stackoverflow.com/comment/44963316
has comment: http://stackoverflow.com/comment/44964441
answer count: 1
has comment: http://stackoverflow.com/comment/44962330
tagged with: jquery
has comment: http://stackoverflow.com/comment/44963007
tagged with: ajax
has comment: http://stackoverflow.com/comment/44962534

http://stackoverflow.com/q/28343457
accepted answer: http://stackoverflow.com/a/28343618
has title: array.splice deletes wrong value and keeps wrong value
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28343524
has comment: http://stackoverflow.com/comment/45038183
has body: I want to have an array with guests who do NOT have "decline" as a response. So, Tooth Fairy is deleted (shouldn't, she "accepted" the invitation) from the array and Jack Frost stays (shouldn't, he "declined" the invitation). function getAttendees(peopleInvited, responses){ var coming=peopleInvited; responses.map(function(cell){ if (cell.response=='declined') { coming.splice(0,1); } }); return coming; } var people = ['Easter Bunny', 'Tooth Fairy', 'Frosty the Snowman', 'Jack Frost', 'Cupid', 'Father Time']; var responses = [ {name: 'Easter Bunny', response: 'declined'}, {name: 'Jack Frost', response: 'declined'}, {name: 'Tooth Fairy', response: 'accepted'} ]; getAttendees(people, responses);
possible better answer: http://stackoverflow.com/a/28343808
has comment: http://stackoverflow.com/comment/45038064
has answer: http://stackoverflow.com/a/28343808
has answer: http://stackoverflow.com/a/28343618
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45031611
type: Question
tagged with: splice
tagged with: arrays
tagged with: javascript

http://stackoverflow.com/q/28307023
has comment: http://stackoverflow.com/comment/44965721
tagged with: jquery
has comment: http://stackoverflow.com/comment/44965086
favorite count: 0
has answer: http://stackoverflow.com/a/28307232
has comment: http://stackoverflow.com/comment/44965237
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28307203
tagged with: css
has comment: http://stackoverflow.com/comment/44965470
answer count: 4
has body: I made circle divs fall randomly. When I click on a circle, I want it to disappear and I want the score to be incremented by one. Here is my code: function CreateDiv() { var ranLeft1 = Math.floor((Math.random() * 700) + 1); var ranInterval = 1000 + Math.floor((Math.random() * 5000) + 1); jQuery('&lt;div class="droper1" id="droper1" onclick="myFunction()" /&gt;').css({top: 20, left: ranLeft1 }).animate({top: "+=573px"}, 9000 ).appendTo('#container' ); window.setTimeout( CreateDiv, ranInterval ); } var score = 0; document.getElementById("myBtn").addEventListener("click", myFunction); function myFunction() { score++; //make the div dissapear after one click on it .. how ??!! document.getElementById("score").innerHTML = score; }
upvote count: 2
downvote count: 2
has answer: http://stackoverflow.com/a/28307273
type: Question
tagged with: javascript
has title: Make a div disappear after clicking on it
score: 0
has answer: http://stackoverflow.com/a/28307320

http://stackoverflow.com/comment/45075545
type: AnswerComment
score: 0
type: Comment
has text: still it just printing the no, of rows on console , but the browser doesn't get any output. Yes ,but the error is resolved and now y am i not getting the output on browser
comment on: http://stackoverflow.com/a/28367060

http://stackoverflow.com/comment/45087503
score: 0
has text: Are you sure you're loading jQuery correctly? What happens in the console if you just type console.log($('#delete'))? Are you dynamically generating the table from JavaScript? If that's the case, you'll need to use the "on" method from jQuery to attach the event to a dynamic object.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28373360

http://stackoverflow.com/a/28311263
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28302374
has body: Okay, so I partly figured out the problem: I forgot I was writing the script inside the head section of the HTML. I think that explained why the button worked flawlessly. So I moved only the code inside the function (coz I wanted it not to be a function) and placed it inside the script tag in the body section and hit refresh. At first nothing happened, until I added these: &lt;div id='table-div'&gt; &lt;!--table here--&gt; &lt;/div&gt; script: //display table document.getElementById('table-div').appendChild(tbl); And there it was! All that for a single row and two columns! Out of curiosity, I wondered if it would work having the code back in the head section and applying my new found solutions. So with the code back in the head section, I made this slight change to display the table: //display table document.body.getElementById('table-div').appendChild(tbl); No cigars here. Perhaps bad JavaScript lingo. Nevertheless, it was still good to find out that div was the magic table(t) my code needed.

http://stackoverflow.com/q/28295883
has answer: http://stackoverflow.com/a/28296058
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28296125
score: 0
has body: I want to change an image's src when hovering on a using jQuery, like the News section in the home page of http://mdpoison.com/. (Try hovering on the topics of "Did you know?") I see in this page code that there the html is like: Families can help prevent poison-related injuries this winter by following the MPC’s winter poison safety tips. and when you hover on it, it adds a class called dky-active. I don't know how to add this class and to switch a new src with jQuery. I see codes like this: $('ul.small img').hover(function () { $('.inner img').attr('src' ,$(this).attr('src')); }); but that's of no use in my case because I want to toggle images.
answer count: 3
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28295999
tagged with: css
has title: How to change an image's src when hovering on a paragraph?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44944312
linked to: http://stackoverflow.com/q/23494169
accepted answer: http://stackoverflow.com/a/28296125
linked to: http://stackoverflow.com/q/3556856
type: Question
has answer: http://stackoverflow.com/a/28295999

http://stackoverflow.com/comment/45118917
type: Comment
comment on: http://stackoverflow.com/a/28382772
has text: @DaleWoods What are you wanting to do differently from existing functionality (what are you trying to change?)
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44964441
type: Comment
type: QuestionComment
has text: yes - that makes perfect sense. I had thought about submitting `this` instead of `this.value`, but I don't know how to modify the ` ` code to include `data-x`. How and where would I physically put that code?
comment on: http://stackoverflow.com/q/28305485
score: 0

http://stackoverflow.com/comment/45172974
comment on: http://stackoverflow.com/a/28396950
has text: I was able to accomplish this using `document.getElementById['formName'].submit()`, almost the same thing that you recommended. Full solution will be put in the original question. Thanks!
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/a/28380140
accepted answer of: http://stackoverflow.com/q/28373389
has comment: http://stackoverflow.com/comment/59410182
has comment: http://stackoverflow.com/comment/59535894
answers question: http://stackoverflow.com/q/28373389
has comment: http://stackoverflow.com/comment/59568705
upvote count: 4
type: AcceptedAnswer
downvote count: 0
score: 4
has comment: http://stackoverflow.com/comment/59564205
has body: This actually works a bit differently. You will have to define the callback function jsonFlickrFeed. Check the code below. You will notice two things here:- We're requesting the data with parameter ?format=json. Check the response here. You'd notice that the response coming out is looking for a callback function jsonFlickrFeed. Just define the handler for data into this function and there we go. var app = angular.module('imageViewer', ['ng', 'ngResource']); app.controller('AppGallery',[ '$scope','$http', function AppGallery($scope, $http) { $http.jsonp('https://api.flickr.com/services/feeds/photos_public.gne?format=json').success(function (data) { }); jsonFlickrFeed = function(data){ $scope.data = data; console.log(data); } }]); Photo Viewer {{data}} Check here and for more information. If you're using jQuery you can use jQuery.getJSON instead. More details regarding jQuery.getJSON . Hope this helps! Please mark as answer if it does! Thanks!
type: Answer
has comment: http://stackoverflow.com/comment/45101363

http://stackoverflow.com/comment/45010409
comment on: http://stackoverflow.com/q/28331252
type: Comment
has text: And what does it do in this context? This will redirect the ajax request to the jsp file?
score: 0
type: QuestionComment

http://stackoverflow.com/a/28417780
score: 0
answers question: http://stackoverflow.com/q/28417716
has body: Myfunc is a function. When you call it, call like myfunc()
type: Answer

http://stackoverflow.com/comment/45077073
has text: Instead of pseudocode, post actual code (having 3 or 4 Select Options) and then write what is your expected output...
comment on: http://stackoverflow.com/q/28368039
type: Comment
type: QuestionComment
score: 0

angularjs
tags question: http://stackoverflow.com/q/28386376
tags question: http://stackoverflow.com/q/28370745
tags question: http://stackoverflow.com/q/28413340
tags question: http://stackoverflow.com/q/28298201
tags question: http://stackoverflow.com/q/28285890
tags question: http://stackoverflow.com/q/28299264
tags question: http://stackoverflow.com/q/28404639
tags question: http://stackoverflow.com/q/28315310
tags question: http://stackoverflow.com/q/28407591
tags question: http://stackoverflow.com/q/28339583
tags question: http://stackoverflow.com/q/28295772
tags question: http://stackoverflow.com/q/28394552
tags question: http://stackoverflow.com/q/28337387
tags question: http://stackoverflow.com/q/28423493
tags question: http://stackoverflow.com/q/28291828
tags question: http://stackoverflow.com/q/28342608
tags question: http://stackoverflow.com/q/28429803
tags question: http://stackoverflow.com/q/28288292
tags question: http://stackoverflow.com/q/28344430
tags question: http://stackoverflow.com/q/28359458
tags question: http://stackoverflow.com/q/28380938
tags question: http://stackoverflow.com/q/28342391
tags question: http://stackoverflow.com/q/28359028
tags question: http://stackoverflow.com/q/28412126
tags question: http://stackoverflow.com/q/28392960
tags question: http://stackoverflow.com/q/28339530
tags question: http://stackoverflow.com/q/28295681
tags question: http://stackoverflow.com/q/28356663
tags question: http://stackoverflow.com/q/28331016
tags question: http://stackoverflow.com/q/28400223
tags question: http://stackoverflow.com/q/28303438
tags question: http://stackoverflow.com/q/28410706
tags question: http://stackoverflow.com/q/28323559
tags question: http://stackoverflow.com/q/28362317
tags question: http://stackoverflow.com/q/28429073
tags question: http://stackoverflow.com/q/28293629
tags question: http://stackoverflow.com/q/28307395
tags question: http://stackoverflow.com/q/28392840
tags question: http://stackoverflow.com/q/28326108
tags question: http://stackoverflow.com/q/28285100
tags question: http://stackoverflow.com/q/28416895
tags question: http://stackoverflow.com/q/28415188
tags question: http://stackoverflow.com/q/28333818
tags question: http://stackoverflow.com/q/28423952
tags question: http://stackoverflow.com/q/28301481
tags question: http://stackoverflow.com/q/28411653
tags question: http://stackoverflow.com/q/28305795
tags question: http://stackoverflow.com/q/28313443
tags question: http://stackoverflow.com/q/28382472
tags question: http://stackoverflow.com/q/28390370
tags question: http://stackoverflow.com/q/28397612
tags question: http://stackoverflow.com/q/28338282
tags question: http://stackoverflow.com/q/28357693
tags question: http://stackoverflow.com/q/28312512
tags question: http://stackoverflow.com/q/28378619
tags question: http://stackoverflow.com/q/28384127
tags question: http://stackoverflow.com/q/28371732
tags question: http://stackoverflow.com/q/28365375
tags question: http://stackoverflow.com/q/28338132
tags question: http://stackoverflow.com/q/28337851
tags question: http://stackoverflow.com/q/28357504
tags question: http://stackoverflow.com/q/28400602
tags question: http://stackoverflow.com/q/28367540
tags question: http://stackoverflow.com/q/28436824
tags question: http://stackoverflow.com/q/28308548
tags question: http://stackoverflow.com/q/28381671
tags question: http://stackoverflow.com/q/28323972
tags question: http://stackoverflow.com/q/28356858
tags question: http://stackoverflow.com/q/28428383
tags question: http://stackoverflow.com/q/28410743
tags question: http://stackoverflow.com/q/28316230
tags question: http://stackoverflow.com/q/28301959
tags question: http://stackoverflow.com/q/28323956
tags question: http://stackoverflow.com/q/28290659
tags question: http://stackoverflow.com/q/28405639
tags question: http://stackoverflow.com/q/28285499
tags question: http://stackoverflow.com/q/28399939
tags question: http://stackoverflow.com/q/28398887
tags question: http://stackoverflow.com/q/28382927
tags question: http://stackoverflow.com/q/28345547

http://stackoverflow.com/a/28292545
answers question: http://stackoverflow.com/q/28292486
type: Answer
has body: Try this instead. jQuery(function($){ var frm = $('#loginform'); frm.submit(function (ev) { ev.preventDefault(); $.ajax({ type: form.attr('method'), url: form.attr('action'), data: form.serialize(), success: function (data) { alert('ok'); } }); return false; }); });
score: 0

http://stackoverflow.com/a/28312945
answers question: http://stackoverflow.com/q/28312921
has comment: http://stackoverflow.com/comment/44976357
type: Answer
has comment: http://stackoverflow.com/comment/44976748
has comment: http://stackoverflow.com/comment/44976278
has body: function aud_play_pause() is defined in your code twice. You need to give the second function a different name or just use one function to do both things. I would do something like this: function aud_play_pause(channel) { var Radio21 = document.getElementById("Radio21"); var RadioZU = document.getElementById("RadioZU"); if(channel == 'radio21'){ RadioZU.pause(); if (Radio21.paused) { Radio21.play(); } else { Radio21.pause(); } } if(channel == 'radioZU'){ Radio21.pause(); if (RadioZU.paused) { RadioZU.play(); } else { RadioZU.pause(); } } } Someone more knowledgeable than I could probably provide a more elegant solution but this should work. Also, I couldn't get your JSFiddle to work in my browser and I couldn't get my JSFiddle to work so I haven't been able to test the function. Firefox didn't like the ContentTypes you are using: "HTTP "Content-Type" of "audio/x-mpegurl" is not supported. Load of media resource http://www.radio21.ro/Radio21Live.m3u failed." EDIT: I thought about this a little more and basically you need a toggle. I can't get your example to work in Firefox so I'm going to create a toggle example that doesn't solve your problem but should illustrate how to fix it. function example(string) { var first_div = document.getElementById("one"); var second_div = document.getElementById("two"); if(string == 'one'){ second_div.innerHTML = "OFF"; if (first_div.innerHTML == "OFF") { first_div.innerHTML = "ON"; } else { first_div.innerHTML = "OFF"; } } if(string == 'two'){ first_div.innerHTML = "OFF"; if (second_div.innerHTML == "OFF") { second_div.innerHTML = "ON"; } else { second_div.innerHTML = "OFF"; } } } OFF OFF
has comment: http://stackoverflow.com/comment/44976570
has comment: http://stackoverflow.com/comment/44976886
score: 0

http://stackoverflow.com/comment/44992291
has text: @AnilGoud `abort` is plain js method of `xhr` object
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28319910
type: Comment

http://stackoverflow.com/q/28433069
has comment: http://stackoverflow.com/comment/45198178
linked to: http://stackoverflow.com/q/26686883
favorite count: 0
upvote count: 2
answer count: 1
tagged with: unit-testing
has comment: http://stackoverflow.com/comment/45197549
has body: I want to write unit tests for methods in a react component. I want to do this without render the component. This because I do not want to set up all the data needed for a full render. I want to do something like this: describe('MyList', function () { describe('fooSort', function () { it('sort strings', function () { var list = &lt;MyList /&gt;; var result = list.fooSort(['a', 'c', 'b']) expect(result).to.be.equal(['a', 'b', 'c']) }); }); }); This can be achieved by adding fooSort as a static method, but that will make it impossible for the method to access this. And it also does not feel right. Is there a way to access the methods or is it an other way to do this kind of testing? I know this post is similar to: How do I access methods in React for unit testing but not really the same.
tagged with: reactjs
tagged with: testing
score: 2
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/36074011
type: Question
has comment: http://stackoverflow.com/comment/45197393
has title: Unit test non static methods in React
has comment: http://stackoverflow.com/comment/45196430

http://stackoverflow.com/a/28432166
score: 1
downvote count: 0
has body: put them in seperate divs but in the same SVG element Presuming vis is your svgElement: var firstChart = vis.append(div). // then put your first chart here var secondChart = vis.append(div). // then put your second chart here
answers question: http://stackoverflow.com/q/28419888
has comment: http://stackoverflow.com/comment/45206532
has comment: http://stackoverflow.com/comment/45229085
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/45229394

http://stackoverflow.com/comment/45061346
has text: Agreed, while it probably won't have any noticeable impact (see [MDN docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger) and linked ECMAScript standards from there), it is bad practice to have so many `debugger` statements go into production. It is fairly simple to remove them via mass find/replace. I've only really found them useful when setting a breakpoint via dev tools is difficult (e.g. proxy debugging a mobile device).
type: QuestionComment
score: 2
type: Comment
comment on: http://stackoverflow.com/q/28359159

http://stackoverflow.com/q/28376831
has comment: http://stackoverflow.com/comment/45094404
has comment: http://stackoverflow.com/comment/45094336
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45093873
type: Question
has body: If have a straight ahead controller: controller: function($scope, $http){ $http.get(templateSource+'/object.customer') .then(function(result){ $scope = result.data; }); } My object.customer file looks like: [{"customer":{"name":"Bert","email":"bert@gmail.com"}}] Now I wanted to access the email, so I did (in HTML) {{customer.email}} But this is incorrect, so my question is, how to access email? UPDATE Setting: controller: function($scope, $http){ $http.get(templateSource+'/object.customer') .then(function(result){ $scope.customer = {}; angular.extend($scope.customer,result.data[0]); console.log($scope.customer.email); }); } Gives me in the console.log unidentified. However, if I set it to console.log($scope.customer); I get: Object 0: Object customer: Object email: "bert@gmail.com" name: "Bert" The console.log(result.data) is [Object] 0: Object customer: Object email: "bert@gmail.com" name: "Bert"
has title: Angular data from JSON directly in HTML
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28376857
has comment: http://stackoverflow.com/comment/45094192
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28376857
tagged with: angularjs

http://stackoverflow.com/q/28331338
has title: ExtJs 5.1.0 - Unrecognized class name / alias: widget.cartesian
type: Question
tagged with: charts
has answer: http://stackoverflow.com/a/30196667
tagged with: javascript
has answer: http://stackoverflow.com/a/28334209
has body: I want to show a stacked area chart in a new window. The enviroment is the ExtJs Webdesktop. When I create the window through: Ext.create('Desktop.displayPresences.view.displayPresencesChart').show() I always get these error messages: mypath/desktop/widget/cartesian.js?_dc=1423082524533 404 (Not Found) Error: [Ext.create] Unrecognized class name / alias: widget.cartesian I researched a lot but couldn't solve the problem yet. What I've done: Added this to app.json "requires": [ "ext-charts" ], Through sencha cmd I tried these commands sencha app build sencha app refresh sencha app watch In the google develeopers tools in the sources tab I can see that the necessary file 'Ext.chart.series.Cartesian' is loaded. It is in the packages/ext-charts/src/chart/series folder. This is my code Ext.define('Desktop.displayPresences.view.displayPresencesChart', { extend: 'Ext.Window', requires: [ 'Ext.chart.*', 'Ext.data.JsonStore' ], xtype: 'area-stacked', width: 650, initComponent: function() { var me = this; this.myDataStore = Ext.create('Ext.data.JsonStore', { fields: ['month', 'data1', 'data2', 'data3', 'data4' ], data: [ { month: 'Jan', data1: 20, data2: 37, data3: 35, data4: 4 }, { month: 'Feb', data1: 20, data2: 37, data3: 36, data4: 5 }, { month: 'Mar', data1: 19, data2: 36, data3: 37, data4: 4 }, { month: 'Apr', data1: 18, data2: 36, data3: 38, data4: 5 }, { month: 'May', data1: 18, data2: 35, data3: 39, data4: 4 }, { month: 'Jun', data1: 17, data2: 34, data3: 42, data4: 4 }, { month: 'Jul', data1: 16, data2: 34, data3: 43, data4: 4 }, { month: 'Aug', data1: 16, data2: 33, data3: 44, data4: 4 }, { month: 'Sep', data1: 16, data2: 32, data3: 44, data4: 4 }, { month: 'Oct', data1: 16, data2: 32, data3: 45, data4: 4 }, { month: 'Nov', data1: 15, data2: 31, data3: 46, data4: 4 }, { month: 'Dec', data1: 15, data2: 31, data3: 47, data4: 4 } ] }); me.items = [{ xtype: 'cartesian', width: '100%', height: 500, legend: { docked: 'bottom' }, store: this.myDataStore, insetPadding: 40,…
answer count: 2
downvote count: 0
favorite count: 0
tagged with: extjs5
upvote count: 6
possible better answer: http://stackoverflow.com/a/28334209
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/30196667
score: 6

http://stackoverflow.com/q/28321308
has comment: http://stackoverflow.com/comment/44990745
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44990706
accepted answer: http://stackoverflow.com/a/28321573
downvote count: 0
has comment: http://stackoverflow.com/comment/44990677
favorite count: 0
has title: Manipulate object to make different format
has answer: http://stackoverflow.com/a/28321498
upvote count: 1
possible better answer: http://stackoverflow.com/a/28321498
has comment: http://stackoverflow.com/comment/44990788
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28321573
type: Question
answer count: 2
has body: sorry for the stupid question but I am also looking for a nice solution for this problem: I have this object var obj = { "brand[]" : [1,2,3], "model[]" : [1,2,3], "varqnt[]" : [1,2,3] } Now what I want is to make a new object/array ( i don't think it matters for now ) from it which should be var newObj = { 'row-1': { brand[] : 1, model[] : 1, varqnt[] : 1 }, 'row-2': { brand[] : 2, model[] : 2, varqnt[] : 2 }, 'row-3': { brand[] : 3, model[] : 3, varqnt[] : 3 } } The tricky part is that 'brand[]', 'model[]', 'varqnt[]' might not all be there. I will try to explain a bit more... basically the first object is comming from url params, of 2 select boxes and 1 input, but since I use the same form in different "places" this varqnt[] ( the input ) might not be presented. I am not sure if anyone will understand me.. but english is not mother's language as an excuse :P Thanks, and if I wrote something totaly unclear sorry :(

http://stackoverflow.com/comment/45316543
comment on: http://stackoverflow.com/q/28423190
has text: now if i render a partial view inside the modal no auto complete results will be displayed , although the auto complete action method will be called and the returned json will be received by the browser. while if i render the same view as regular view everything will work well... so seems there is something (maybe css issue) that is preventing the returned json which reaches the browser from being displayed as autocomplete list .....
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45176234
comment on: http://stackoverflow.com/q/28421313
score: 0
type: Comment
type: QuestionComment
has text: Shows the real JSON and not what you saw in Fiddler

http://stackoverflow.com/q/28311457
upvote count: 2
accepted answer: http://stackoverflow.com/a/28311624
downvote count: 1
type: AnsweredQuestion
score: 1
type: Question
has comment: http://stackoverflow.com/comment/44973794
has comment: http://stackoverflow.com/comment/44973768
answer count: 1
has title: Regex to evaluate, but ignore certain characters?
tagged with: javascript
has answer: http://stackoverflow.com/a/28311624
has body: I apologize for my regex noobiness, but I can't figure out how to create a regex that would ignore certain characters. var foo = "123", bar = "1 (234) a12-34a1", result = bar.replace(new RegExp(foo,"ig"),"bcd"); If the regex ignored [\s()-], the result should be "b (cd4) abc-d4a1" Is there a way to do this? UPDATE: Here's the context of the problem: I have to accept string of numbers, find it in a telephone number (displayed in a variety of ways), and then highlight it in the telephone number. Normally, I'd just do a simple replace, such as: var foo = "foo", str = "foobar", newStr = str.replace(new RegExp(foo,"ig"),"&lt;span class='highlighted'&gt;" + foo + "&lt;/span&gt;"); But the the formatting gets in the way of that. Examples: searchStr -> expected output 123 -> 1 (234) 567-8901 345 -> 123-4567 56789 -> 123 (45) 678-9012
tagged with: regex
has comment: http://stackoverflow.com/comment/44973611
favorite count: 0
has comment: http://stackoverflow.com/comment/44973904

http://stackoverflow.com/a/28432132
answers question: http://stackoverflow.com/q/28431933
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28431933
has comment: http://stackoverflow.com/comment/45195825
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45194627
has comment: http://stackoverflow.com/comment/45197581
has body: Make sure the boolean is set. You store a string but need a boolean JSFIDDLE $(document).ready(function(){ var sel = $.cookie("selected"); // get the cookie sel = sel=="true"; // convert to boolean - null is false, "false" is false $(".steps").toggleClass("selected",sel); // initial $(".steps").on("click",function() { var $this = $(this); sel = !sel; // toggle $this.toggleClass("selected",sel); // toggles $.cookie("selected", sel,{ expires: 7, path: '/' }); }); });
type: Answer
score: 1

http://stackoverflow.com/q/28338968
type: Question
linked to: http://stackoverflow.com/q/374644
upvote count: 0
score: -2
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28339070
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has title: Handle complete event after submitting form javascript
type: UnansweredQuestion
downvote count: 2
has body: I am trying to handle the complete event of submitting form. I prepare the form like this: var _url="../ex/tem?sessionId="+sessId; var form = document.createElement("form"); form.setAttribute("id", "myForm"); form.setAttribute("method", "post"); form.setAttribute("action", _url); form.setAttribute("enctype", "multipart/form-data"); form._submit_function_ = form.submit; var textName=document.createElement("input"); textName.setAttribute("type", "hidden"); textName.setAttribute("name", "textName"); textName.setAttribute("value", textName); form.appendChild(textName); document.body.appendChild(form); and I submit it like this: form._submit_function_(); How I can catch the complete event?
tagged with: forms

http://stackoverflow.com/comment/45194354
type: Comment
has text: I don't, I have tried placing $.cookie("selected"); straight after but it still doesn't save. Am I reading the cookie in the right place?
type: QuestionComment
comment on: http://stackoverflow.com/q/28431933
score: 0

http://stackoverflow.com/a/28370941
has body: A hyperlink in HTML is an tag. Stack Overflow To incorporate the URL into the document, you'll need to use a JavaScript text formula. You can concatenate text with the plus sign. "Stack Overflow" You need to somehow get the URL of the new Doc, and put that URL into a variable. var fileNewDoc = DriveApp.getFileById(copyId); var urlToDoc = fileNewDoc.getUrl(); Google Documentation - File Class - getUrl() Method So the code would be something like this: var fileNewDoc = DriveApp.getFileById(copyId); var urlToDoc = fileNewDoc.getUrl(); var pdf = fileNewDoc.getAs("application/pdf"); var body = "Attached is the Auto-Generated PDF. "; body = body + "Your Link to the Copy";
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28368864

http://stackoverflow.com/comment/45126174
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28393187
has text: Still not working in my app http://jsfiddle.net/1urcz8r3/ Moreover where do I set which form will be shown when success login and that the login form will stay in failure? Thanks

http://stackoverflow.com/comment/44991974
comment on: http://stackoverflow.com/a/28322010
type: Comment
has text: What do you mean? you have two arrays. You can go though these arrays in the $.each loop and take "date" attribute from each object in these arrays
score: 0
type: AnswerComment

http://stackoverflow.com/q/28369782
has comment: http://stackoverflow.com/comment/45080632
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28369839
accepted answer: http://stackoverflow.com/a/28369883
possible better answer: http://stackoverflow.com/a/28369928
has answer: http://stackoverflow.com/a/28369928
tagged with: typescript
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45080850
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45080741
has body: I'm going through a porting exercise going from JavaScript to TypeScript and have hit the following issue. In the original JavaScript code I've got: var children = someJQueryElement.children('div'); var sortedChildren = children.sort(someSortFunction); In TypeScript (1.4) all the jQuery methods return JQuery which isn't an array and therefore can't have sort called on it. How should I go about solving this?
has answer: http://stackoverflow.com/a/28369883
tagged with: javascript
has comment: http://stackoverflow.com/comment/45081457
tagged with: jquery
has title: TypeScript: Accessing JQuery children as array
has comment: http://stackoverflow.com/comment/45081122
answer count: 3

http://stackoverflow.com/comment/45010207
has text: Out of curiosity, how is server-side JavaScript involved with ASP Classic?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28331519

http://stackoverflow.com/q/28350584
has comment: http://stackoverflow.com/comment/45045830
has comment: http://stackoverflow.com/comment/45044947
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/57120853
has answer: http://stackoverflow.com/a/28351263
tagged with: android
downvote count: 1
favorite count: 0
tagged with: cordova
type: UnansweredQuestion
tagged with: local-storage
has body: i have an automatic login system for my app compiled with phonegap build, when the app opens for the first time and you enter the correct username and password and it logs you in, it does auto login the subsequent times. I save the username and password onsubmit of a button in the localstorage and the form action posts the data to the remote server for authentication. Now the problem is once there's data in the localstorage the auto login action is fired which means if one should enter a wrong username and password for the first time, the user cannot re-type the right again since when the app opens and there is data in the localstorage the form action is fired and now you are on the remote server using the app. meaning there is no way of clearing the localstorage saved in the index of the app. Is there a way i can clear locally saved localstorage data from a remote server? here's my script that saves into the localstorage and auto login if (localEmail != null &amp;&amp; localPwd != null) { $('#form1').submit(); } // SAVE VARIABLES TO LOCAL STORAGE $('#form1').on('submit', function() { localStorage.setItem("eaddress", $email.val()); localStorage.setItem("pwd", $password.val());
score: 1
has title: Clear localstorage data from a remote server
type: Question
upvote count: 2
answer count: 2

http://stackoverflow.com/comment/45039060
has text: Chrome seems to parse it fine, see the JSFiddle I posted.
score: 0
comment on: http://stackoverflow.com/q/28347315
type: Comment
type: QuestionComment

http://stackoverflow.com/a/45573305
type: Answer
answers question: http://stackoverflow.com/q/28408021
has body: You should try var $grid = $('#myDiv'); $grid.empty() var new_div = $grid.append("&lt;div id='newDiv'&gt;...") console.log($(new_div).position()) As "new_div" variable has the appended element returned by the append function.
score: 0

http://stackoverflow.com/comment/45179758
comment on: http://stackoverflow.com/q/28423357
type: Comment
type: QuestionComment
has text: this is a PHP solution
score: 1

http://stackoverflow.com/q/28374086
upvote count: 1
tagged with: knockout.js
type: Question
tagged with: asp.net-mvc
tagged with: javascript
has body: I am new to knockout.js and am trying to create a simple notification message component. What's happening is that the binding appears to occur, but there are no updates happening to the UI. Below is the code, and I would appreciate any help in locating where this is falling down. Please note: I am using ASP.NET MVC 5, Knockout.js 3.2.0, Require.js 2.1.14 with AMD for accessing scripts and views. View - Hub Push Me! @section scripts { } Hub Script require(["ko", "jquery", "ViewModels/notificationMessage", "Components/Notifications/hub", "Plugins/jquery.timeago"], function (ko, jquery, notificationMessage, notificationHub) { try { // Register the component. ko.components.register("notification-hub", { viewModel: notificationHub, template: { require: "text!/Components/Notifications/HubItemView" } }); // Create an instance of the hub and add an inital message. var hub = new notificationHub(); hub.addMessage(new notificationMessage("Test", "This is a test message.", "2015-02-06 11:00 AM")); // Bind things up. ko.applyBindings(hub, $("notification-hub")[0]); // Create a handler for the button click. $("button").on("click", function () { hub.addMessage(new notificationMessage("New Message", "This is a new message", new Date().toLocaleDateString())); }); } catch (e) { $("#displayValues").html("Something went wrong..."); Debug.writeln("Script error: " + e.message); } }); ViewModel - Hub define(["ko", "jquery"], function (ko, jquery) { // Create the hub's main ViewModel. function notificationHub() { var self = this; // Define the Properties. self.messages = ko.observableArray(); self.count = ko.computed(function () { return self.messages().length; }); } // Define the addMessage method. notificationHub.prototype.addMessage = function (msg) { var self = this; // Pop message to the top of the stack. self.messages().push(msg); Debug.writeln("Count of message array: " + self.messages().length); } return notificationHub; }); View - Message Model Unfortunately we didn't find any rec…
downvote count: 0
has comment: http://stackoverflow.com/comment/47553682
favorite count: 0
type: UnansweredQuestion
has title: Component fails to display the contents of the array
answer count: 0
score: 1

http://stackoverflow.com/a/28346636
has body: Ignore onBeforeUnload/onUnload, you don't need that. You can do it with a simple click handler like this: $('a').on('click', function(e) { e.preventDefault(); var destinationLink = $(this).attr('href'); $.post('/your/analytics/url', {link:destinationLink}, function() { // Success window.location.href = destinationLink; }); }); This will stop any link from working until it's been submitted to your analytics so it's not ideal - you need to make sure what ever is receiving the data does so as quickly as possible.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28345683

http://stackoverflow.com/a/28335782
type: Answer
has body: Put all your test values in an object whose property names are the same as in data. Then loop over all the properties to see if they're all the same: var search = { carmake: $("#car_make").val(), carmodel: $("#car_model").val(), partname: $("#part_name").val(), partcategory: $("#part_category").val() }; var match = true; $.each(search, function(prop, value) { if (value !== "" &amp;&amp; value != data[prop]) { // only compare if the dropdown was selected match = false; return false; // break out of the loop } }); if (match) { // do something }
has comment: http://stackoverflow.com/comment/45020185
has comment: http://stackoverflow.com/comment/45020223
has comment: http://stackoverflow.com/comment/45020214
has comment: http://stackoverflow.com/comment/45020392
accepted answer of: http://stackoverflow.com/q/28335714
score: 3
answers question: http://stackoverflow.com/q/28335714
upvote count: 3
has comment: http://stackoverflow.com/comment/45020056
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45020123

http://stackoverflow.com/comment/45121149
comment on: http://stackoverflow.com/q/28392090
score: 0
type: Comment
type: QuestionComment
has text: You want to hide `#my-btnn` or you want click on it to do nothing?

http://stackoverflow.com/a/28313186
answers question: http://stackoverflow.com/q/28312986
has body: jQuery uses document.querySelector when it's available. Take a try if you love pure Javascript. document.querySelector('.lm_content').appendChild(iframeDoc);
type: Answer
score: 0

http://stackoverflow.com/q/28330071
has title: Aggregate jquery.cookie.js is not working
type: Question
tagged with: cookies
has comment: http://stackoverflow.com/comment/45007780
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45011203
has comment: http://stackoverflow.com/comment/45007519
score: 0
has comment: http://stackoverflow.com/comment/45035275
has comment: http://stackoverflow.com/comment/45009069
has body: This is my code: $(function() { if ($.cookie('is_legal') == "yes") { //legal! } else { document.location = "http://www.alcoholinformate.org.mx/"; } }); $("#yes").click(function(){ $.cookie('is_legal', 'yes', { expires: 1}); $('#agegate').hide(); }); $("#no").click(function(){ document.location = "http://www.alcoholinformate.org.mx/"; }); There are two buttons obviously yes and no, when I load my page the console shows Uncaught TypeError: undefined is not a function on this line if ($.cookie('is_legal') == "yes") { Why is this happening?
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/28319459
has body: I have the following JSON: { "boxes" : { "box-1" : { "what": "lose", "opened": false }, "box-2" : { "what": "lose", "opened": false }, "box-3" : { "what": "lose", "opened": true }, "box-4" : { "what": "win", "opened": false }, "box-5" : { "what": "lose", "opened": true }, "box-6" : { "what": "unknown", "opened": false }, "box-7" : { "what": "lose", "opened": true }, "box-8" : { "what": "lose", "opened": false } } } And when I load it in to my application (I'm using NodeJS): var save = __dirname + '/save.json'; var saveData = fs.readFileSync(save, 'utf8'); if(saveData) reloadGame(saveData); else askBoxes(); function reloadGame(saveData) { saveData = JSON.parse(saveData); boxes = Object.keys(saveData.boxes).length; for(var i=0;i&lt;=boxes;i++) { console.log(saveData.boxes[i]); } } See I'm having to use Object.keys to get the length. And my console.log returns undefined inside my for loop. I don't normally have to use the Object.keys to get the length of something inside a JSON file... And why doesn't my console.log work? Feels like the JSON is incorrectly formatted. Perhaps I don't need the boxes key at all and can just have the boxes as an array instead?
has answer: http://stackoverflow.com/a/28320633
tagged with: node.js
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28319594
has title: Struggling to get JSON out in desired format with NodeJS
has answer: http://stackoverflow.com/a/28319904
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/28320332
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28319594
has answer: http://stackoverflow.com/a/28319595
accepted answer: http://stackoverflow.com/a/28319595
downvote count: 0
favorite count: 0
upvote count: 2
answer count: 5

http://stackoverflow.com/a/28308778
score: 0
has comment: http://stackoverflow.com/comment/44970249
accepted answer of: http://stackoverflow.com/q/28308580
has body: For the click events, you need to use class selector like .next instead of id selector #next. I updated your code to following: $(document).ready(function () { $('.next').on('click', getNext); $('.previous').on('click', getPrev); }); You were also using wrong selector for 'previous' and i updated it from #prev to .previous. and your updated fiddle: http://jsfiddle.net/rCd26/633/
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44999220
has comment: http://stackoverflow.com/comment/44970296
type: Answer
has comment: http://stackoverflow.com/comment/45000007
answers question: http://stackoverflow.com/q/28308580

http://stackoverflow.com/comment/45040996
has text: yep thats about it starting from the very start
comment on: http://stackoverflow.com/q/28347479
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28380387
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
has body: i am using normal ajax to search from data base when form submit but the code is not working . There are two date field i want to search data between two dates if i use separate page the code is working but in ajax it is not working .any help will be appreciate Thank you Untitled Document Start Date: End Date: and here is the below test2.php for search <?php include '../dbconn.php'; $strt_dt=$_REQUEST['strt_dt']; $end_dt = $_REQUEST['end_dt']; ?> Name Contact Action <?php $qry=mysql_query("SELECT * FROM std_register WHERE reg_dt BETWEEN '".$strt_dt."' AND '".$end_dt."'"); while($row=mysql_fetch_array($qry)) { ?> <?php echo $row['std_name1']." ".$row['std_name2'];?> <?php echo $row['std_phno'];?> <?php } ?>
tagged with: ajax
score: 0
has title: Ajax code not working to search data
has answer: http://stackoverflow.com/a/28380466
favorite count: 0
type: UnansweredQuestion
tagged with: php
downvote count: 1
type: Question

http://stackoverflow.com/q/28384572
has answer: http://stackoverflow.com/a/30894521
favorite count: 0
score: 2
has answer: http://stackoverflow.com/a/28384824
downvote count: 0
has answer: http://stackoverflow.com/a/29848390
tagged with: twitter-bootstrap
type: UnansweredQuestion
tagged with: web-applications
has answer: http://stackoverflow.com/a/30214710
linked to: http://stackoverflow.com/q/18369036
tagged with: java
has title: Bootstrap glyphicons not working in java webapp
has answer: http://stackoverflow.com/a/31182806
type: Question
upvote count: 2
has body: I am completely new to java web applications and now I am trying to make one. I use tomcat 7 and after building the project with maven, I deploy it into tomcat. My page (welcome.jsp) uses bootstrap glyphicons: ... ... ... ... And the problem is rather weird: when I open welcome.jsp in Google Chrome directly (Ctrl+O), then everything works fine. BUT when I deploy it into tomcat and open the page, I see strange unicode characters instead of glyphicons. The rest of the page (including other components using bootstrap) shows up perfectly, but bootstrap glyphicons and fonts do not work! Any help will be appreciated.
has answer: http://stackoverflow.com/a/28384641
tagged with: javascript
answer count: 6
tagged with: tomcat

http://stackoverflow.com/q/28410421
has comment: http://stackoverflow.com/comment/45154535
has comment: http://stackoverflow.com/comment/45154238
has title: How do I POST my form results to another URL after it's been submitted?
linked to: http://stackoverflow.com/q/5647461
type: Question
answer count: 2
has body: I have form which will contain customer related information, Following three tasks I am trying to this form. 1. Validated the information like correct email_id, Mobile Number 2. Posting the form data in Josn format. 3. After successful submission I have redirect to other page like conformation page. First and second is working but I don't know how to redirect to other page after successful submission. Form.html All in One Home Services - The Next Generation of Services Provider Name:* Email:* Mobile:* bookService.php if(isset($_POST['type'])) { if($_POST['type']=="booking"){ $name = $_POST ['Name']; $mobile = $_POST ['Mob_Num']; $mail = $_POST ['Email']; $query1 = "insert into customer(cust_name, cust_mobile, cust_email) values('$name','$mobile','$mail')"; $result1=mysql_query($query1); } } else{ echo "Invalid format"; } ?>
has comment: http://stackoverflow.com/comment/45154773
tagged with: javascript
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/45154209
possible better answer: http://stackoverflow.com/a/28411415
score: 0
has answer: http://stackoverflow.com/a/28410688
has answer: http://stackoverflow.com/a/28411415
has comment: http://stackoverflow.com/comment/45154328
has comment: http://stackoverflow.com/comment/45154738
favorite count: 0
upvote count: 1
tagged with: php
downvote count: 1
accepted answer: http://stackoverflow.com/a/28410688
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/comment/45120557
type: Comment
comment on: http://stackoverflow.com/a/28391749
type: AnswerComment
score: 0
has text: Just change ORDER BY file name to ORDER BY title_name and if u want to show in Descending Order then after ORDER BY title_name put DESC. Follow above instructions then I am sure you will get it work..

http://stackoverflow.com/a/28384135
answers question: http://stackoverflow.com/q/28291911
has comment: http://stackoverflow.com/comment/45140415
has comment: http://stackoverflow.com/comment/45141651
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45144121
has body: Get rid of the period in three.js, i.e. "dependencies": { "threejs": "r70" } This points to the official ThreeJS repository. If you wish to only have the minified library file (much smaller download), use: "dependencies": { "threejs": "https://raw.githubusercontent.com/mrdoob/three.js/master/build/three.min.js" }
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/45140511
downvote count: 0
has comment: http://stackoverflow.com/comment/57215210
has comment: http://stackoverflow.com/comment/57215238
accepted answer of: http://stackoverflow.com/q/28291911
has comment: http://stackoverflow.com/comment/57215538
score: 4

http://stackoverflow.com/a/30390332
answers question: http://stackoverflow.com/q/28331492
upvote count: 11
score: 11
downvote count: 0
has comment: http://stackoverflow.com/comment/50749180
type: Answer
has body: Yii2 has this nice little thingy called a DynamicModel. This basically allows you to create a model on the fly so that you can still use all the ActiveForm and validation goodies, but without having to commit to writing an entire model class for it. Might be interesting. Example from the documentation: public function actionSearch($name, $email) { $model = DynamicModel::validateData(compact('name', 'email'), [ [['name', 'email'], 'string', 'max' =&gt; 128], ['email', 'email'], ]); if ($model-&gt;hasErrors()) { // validation fails } else { // validation succeeds } } Obviously these instance can also be used for the ActiveForm-widget. You can then run proper validation in your actions first and then pass on your data to MailChimp. Might be handy if you want to run HTML Purifier as part of that validation for the content

calendar
tags question: http://stackoverflow.com/q/28427762
tag name: calendar
tags question: http://stackoverflow.com/q/28283439
type: Tag

http://stackoverflow.com/comment/44920552
has text: You may want to take a look at http://requirejs.org/docs/api.html
score: 3
comment on: http://stackoverflow.com/q/28283170
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44949100
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28298449
score: 0
has text: Provide your complete code in the question. A Marker is not a map option. Why don't you start by looking at a **[simple example](https://developers.google.com/maps/documentation/javascript/examples/marker-simple)** and add your own logic later?

http://stackoverflow.com/q/28401922
favorite count: 0
tagged with: data-binding
type: AnsweredQuestion
score: 1
upvote count: 1
tagged with: knockout.js
type: Question
has answer: http://stackoverflow.com/a/28406884
has comment: http://stackoverflow.com/comment/45144067
downvote count: 0
has comment: http://stackoverflow.com/comment/45149261
tagged with: javascript
has title: Knockout matrix
answer count: 1
has body: I am trying to make a matrix matching table using knockout, but I'm stuck regarding the compare between the current data-bind and the parent data-bind. Here is the jsfiddle.net/wup9rxeu/4/ What I want to accomplished is that when the table is populated with x and - for each td, based on the modelcubdim data. I need some pointer on comparing the ID against the parent ID and if it's a match, then X or else - Thanks
tagged with: nested
accepted answer: http://stackoverflow.com/a/28406884

http://stackoverflow.com/a/28602373
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28386802
type: AcceptedAnswer
has body: I would highly suggest that you elect to use one of the libraries, rather than both. I was in the same boat as you, but I ended up choosing AngularStrap because of some rather large issues that come up when both are used. The unexpected issues, even when selectively picking components, took way too much time and effort to solve to make it worth keeping. Each framework can do exactly what the other does in 'modals' but it might take a little bit of a different approach. I suggest you pick one framework, and ask whatever question you need to make it work when you get stuck. IMHO, of course.
type: Answer
accepted answer of: http://stackoverflow.com/q/28386802
score: 1

http://stackoverflow.com/comment/44947341
type: QuestionComment
has text: Better if you show us the code.
comment on: http://stackoverflow.com/q/28297342
score: 0
type: Comment

http://stackoverflow.com/q/28425575
score: 1
type: Question
tagged with: javascript
tagged with: jquery
tagged with: crop
tagged with: image
has answer: http://stackoverflow.com/a/28432026
answer count: 1
has body: I am doing sticker website for my client. They need image crop within given SVG image. That SVG image is unshaped like Halloween face (see below). When i upload an image, it will display within the given image. The rest of the image will hide. How can i achieve this?
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
upvote count: 2
has title: SVG view box crop using jquery
downvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28432026

http://stackoverflow.com/q/28289634
has answer: http://stackoverflow.com/a/30483338
tagged with: javascript
tagged with: resize
has comment: http://stackoverflow.com/comment/44933587
has comment: http://stackoverflow.com/comment/44933409
tagged with: optimization
has comment: http://stackoverflow.com/comment/44932980
score: 0
has comment: http://stackoverflow.com/comment/44933098
has comment: http://stackoverflow.com/comment/44933386
answer count: 1
tagged with: jquery
accepted answer: http://stackoverflow.com/a/30483338
tagged with: css
has comment: http://stackoverflow.com/comment/44933010
has title: When Using Critical CSS, Jquery function does is not running on load
type: AnsweredQuestion
has body: I'm trying to optimise my website (http://www.mazion.co.uk). As such, I tried to create critical CSS for the site using penthouse. (See Critical CSS used here - this was generated by the main developer of penthouse for me). However, when using critical CSS, one of the subpages on my website does not load properly. BUT, when I fully inline the CSS (or don't do anything to optimise CSS), this sub-page loads correctly. On this sub-page - http://www.mazion.co.uk/courses, there are a number of boxes that are resized using a JS function (see below) that is run on.ready and on.resize (i.e. when resizing the screen) which ensures that all boxes are of the same size. When using critical CSS, the resizing function works on.resize but not on.ready. On the other hand, with inline CSS, the resizing function works as expected on.resize and on on.ready... Thus, I was wondering if someone could help me in identifying the problem. I have tried to inline the styles for the boxes directly into the HTML, but I was unsuccessful... You can see this problem by going to http://www.mazion.co.uk/courses/ and having a look at the boxes. If you then resize your browser, all the boxes will resize themselves so that they are all the same height... This resizing that make all the boxes the same height should actually happen automatically when the page loads.... Js Function (Not Extremely important to question, but helps in setting the scene) jQuery(document).ready(function($){ $(window).resize(function() { resizeCourseBoxes() resizeTopBespokeCoursesBoxes() resizeMidBespokeCoursesBoxes() }).resize(); // Trigger resize handlers. }); // Ensure that all the courses boxes are the same height (this ensures that the rows are of the same size...) function resizeCourseBoxes() { jQuery(function($) { courseHeader = $('.course_header') maxTextHeight = Math.max.apply( Math, courseHeader.map(function() { return $(this).height() }).get()) for (var i = 0; i &lt; courseHeader.length; i++) { currentHeight = course…
has comment: http://stackoverflow.com/comment/44933035
type: Question

http://stackoverflow.com/comment/45130308
comment on: http://stackoverflow.com/a/28387175
has text: Also, the Code has a syntax error on line 20. Ideas?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28424805
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28425592
tagged with: angular-material
tagged with: material-design
has comment: http://stackoverflow.com/comment/45182142
type: Question
accepted answer: http://stackoverflow.com/a/28425592
answer count: 2
possible better answer: http://stackoverflow.com/a/28425502
downvote count: 0
has answer: http://stackoverflow.com/a/28425502
tagged with: javascript
favorite count: 0
has title: Angular material with angularJS application
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45182214
tagged with: angularjs
upvote count: 2
has body: I am planing to implement angular material design with my application. i have included the material.js and material.css and the app definition goes as follows, here is the code, Index.html: &lt;script src="js/ripples.js"&gt;&lt;/script&gt; &lt;script src="js/material.js"&gt;&lt;/script&gt; app.js ar routerApp = angular.module('DiginRt', ['ui.bootstrap','SimpleCouch','ngMaterial']); When i start to run the application, it says Uncaught Error: [$injector:modulerr] Failed to instantiate module DiginRt due to: Error: [$injector:modulerr] Failed to instantiate module ngMaterial due to: Error: [$injector:nomod] Module 'ngMaterial' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
score: 2

http://stackoverflow.com/comment/45146345
has text: Yes, gem 'jquery-tablesorter'
type: Comment
comment on: http://stackoverflow.com/a/28404653
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45194031
type: Comment
has text: Although both are supported, the `jqXHR.success()` method has been deprecated — checking for the `.done()` promise would be the better way.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28431504

http://stackoverflow.com/q/28404669
score: 0
has title: Very basic dice game in Javascript - trying to log 'wins' variable
has comment: http://stackoverflow.com/comment/45144012
has answer: http://stackoverflow.com/a/28405003
has comment: http://stackoverflow.com/comment/45143957
answer count: 5
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28404888
has comment: http://stackoverflow.com/comment/45144576
has answer: http://stackoverflow.com/a/28404957
has body: I'm trying to make a very basic dice game (new to Javascript). On the page load, the 'dice' is 'rolled' three times and the results are displayed, with a message to say whether you managed to roll a 6 or not. I'm trying to put in a permanant message about how many games have been won - problem is, if you look at my code below, the variable I'm using for this 'wins' is incremented each time there is a win, but it only actually displays two values: 0 if the user just lost, and 1 if it was a win. It never gets to a higher number no matter how many times the dice is rolled. Wondering if anyone has a solution/explanation? Code: console.log("Dice game. You have 3 tries to roll a 6 - go"); var rolls = 0; var wins = 0; function rollDice() { var dice = Math.random(); if (dice &lt;= .17) { dice = 1; } else if (dice &lt;= .33) { dice = 2; } else if (dice &lt;= .50) { dice = 3; } else if (dice &lt;= .67) { dice = 4; } else if (dice &lt;= .84) { dice = 5; } else if (dice &lt;= 1) { dice = 6; } return dice; } function diceGame() { do { var dice = rollDice(); console.log(dice); rolls++; if (dice === 6) { console.log("You won!"); wins++; if (rolls === 1) { console.log("It took " + rolls + " try"); } else { console.log("It took " + rolls + " tries"); } break; } } while (rolls &lt;= 2); if (dice !== 6) { console.log("You lost"); } } diceGame(); console.log("Times won: " + wins);
type: Question
has answer: http://stackoverflow.com/a/28404944
has answer: http://stackoverflow.com/a/28404921
linked to: http://stackoverflow.com/q/1527803
tagged with: javascript

http://stackoverflow.com/comment/45164781
has text: escape the double quotes inside your php function to fix your problem
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28415705
score: 2

http://stackoverflow.com/q/28334588
type: Question
has answer: http://stackoverflow.com/a/28334640
accepted answer: http://stackoverflow.com/a/28334640
possible better answer: http://stackoverflow.com/a/28334676
tagged with: javascript
has comment: http://stackoverflow.com/comment/45015848
score: 0
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45019252
has comment: http://stackoverflow.com/comment/45015937
has body: I am trying to make a "slideshow" using html and JavaScript. I want the image to change every time i press on a button that i set up(see code below). I've checked my code several times and i could not find the problem as to how the image wont change when i click the input button. Here's what i have so far: test Computer Parts Processor <input type="button" value="<" onclick="prevImage();"> " onclick="nextImage();"> Thanks in advance.
has answer: http://stackoverflow.com/a/28334676
has comment: http://stackoverflow.com/comment/45015754
type: AnsweredQuestion
has title: Javascript Image Gallery

http://stackoverflow.com/comment/44925309
type: Comment
type: QuestionComment
has text: You can not return from an asynchronous method!
score: 1
comment on: http://stackoverflow.com/q/28285655

http://stackoverflow.com/a/28412613
upvote count: 1
answers question: http://stackoverflow.com/q/28412218
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
accepted answer of: http://stackoverflow.com/q/28412218
has body: I would recommend using Youtube API YouTube Data API - Working with Channel IDs This will not only give you all the video IDs but you will have more control over how you display the video data on your website. If you want more control over the Youtube video player. YouTube JavaScript Player API Reference Get Latest video from channel You must use the channel ID for example https://www.youtube.com/channel/UC5yi93rwcQxIjr0s6Ak8mdw Channel ID: UC5yi93rwcQxIjr0s6Ak8mdw Check Console My latest youtube video

http://stackoverflow.com/q/28415316
has title: Web method works only if marked as static, otherwise doesn't
has body: Code-behind: [ScriptMethod] [WebMethod] public string SavePassword(string password, string username, string resellerId, string isPasswordReset) { return null; // For example } javaScript: $.ajax({ type: 'POST', url: 'login.aspx/SavePassword', data: '{"password":"' + passwordInput + '","username":"' + hidusrname + '","resellerId":"' + hidResellerId + '","IsPasswordReset":"' + hidIsPasswordReset + '"}', contentType: 'application/json; charset=utf-8', dataType: 'json', success: function (result) { }, error: function () { alert('error'); } }); public static string SavePassword() works, public string SavePassword() does not work. If i change webmethod as static it works if i don't it does not work. How can i webmethod without static method in my page ?
type: Question
tagged with: c#
answer count: 1
tagged with: javascript
tagged with: asmx
score: 0
has answer: http://stackoverflow.com/a/28415494
tagged with: asp.net
linked to: http://stackoverflow.com/q/1360253
accepted answer: http://stackoverflow.com/a/28415494
duplicate of: http://stackoverflow.com/q/1360253
type: AnsweredQuestion

http://stackoverflow.com/comment/45052512
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28353551
has text: Hi Xotic, I had not succeeded, I did not expect to have to show my musty code. I have well understood your heavy message.

http://stackoverflow.com/comment/45195801
has text: @Spokey the HTML code needed for the function that i first posted is within my php code sir
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28431860

http://stackoverflow.com/comment/45204840
comment on: http://stackoverflow.com/q/28437009
score: 0
type: Comment
type: QuestionComment
has text: Angular doesn't have any elements, so this is probably just an issue with the way you are doing css and/or html. Nothing with angular will cause this to happen.

http://stackoverflow.com/q/28321982
type: Question
tagged with: javascript
has body: I'm trying to decrease page loading time of a project I'm working on. At first the team I'm working with tried to optimize Apache/Symfony2/Postge but finaly in Networking panel of Chrome's Dev Tools I've found a large "gap" after loading all css and js files. The "gap" disappears when script files are removed. If I leave only jquery.min.js (no other libraries or scripts loaded) page still loads for aprox. 1.5s. Developer tools doesn't say what happens during this period. I think this might be when browser parses and interprets CSS and JS but I need decreasing of DOMContentLoaded time. Any suggestions? This is my first post and I need 10 reputation to post images, so I've uploaded screenshot of what I'm talking about here: http://tinypic.com/m/imqw0n/1 P.S.: Screenshot is taken on "average" PC. The same test on my personal laptop (AsusG750JZ, 8-core CPU, 16Gb RAM, nVIDA 880m) shows very different results - load time is about 1.5s instead of 5.2s. Unfortunately I can't make everyone use the web app on hi-end ;) P.S.2: Async loading of JS is not an option. I've tried RequireJS but I didn't like the results. It was clumsy because of all scripts dependencies.
tagged with: browser
score: 0
has comment: http://stackoverflow.com/comment/44992337
answer count: 1
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44993820
has title: Large browser parsing time after loading CSS's and JS's
tagged with: performance
tagged with: web-frontend
has answer: http://stackoverflow.com/a/28329795

http://stackoverflow.com/a/28285612
has comment: http://stackoverflow.com/comment/44927015
has comment: http://stackoverflow.com/comment/44926605
has comment: http://stackoverflow.com/comment/44926004
type: Answer
has comment: http://stackoverflow.com/comment/44927286
has comment: http://stackoverflow.com/comment/44927208
has comment: http://stackoverflow.com/comment/44927122
answers question: http://stackoverflow.com/q/28285324
has comment: http://stackoverflow.com/comment/44925561
accepted answer of: http://stackoverflow.com/q/28285324
has body: did you try using a timeout to see if it's a race condition?
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44926913
has comment: http://stackoverflow.com/comment/44925406

http://stackoverflow.com/q/28427135
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28427273
tagged with: angularjs
type: AnsweredQuestion
has body: Consider I have a form , by ng-form and a controller - var myAppModule = angular.module('myApp', []); myAppModule.controller('myCtrl',function ($scope) { }); Name : How could I get access within the controller - myCtrl to the form - myForm ?
tagged with: angularjs-ng-form
type: Question
has answer: http://stackoverflow.com/a/28427273
score: 0
has title: How to get access to from from the controller?
answer count: 1

http://stackoverflow.com/comment/45125505
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28394133
has text: oops! i can't believe it was a typo. my editor (dw) gave me no syntax warnings. thanks Nathan
type: AnswerComment

http://stackoverflow.com/a/48964692
has comment: http://stackoverflow.com/comment/86427377
has comment: http://stackoverflow.com/comment/120684706
downvote count: 2
has comment: http://stackoverflow.com/comment/119005945
upvote count: 24
has body: I got it working after finding answer by @sideshowbarker here: No 'Access-Control-Allow-Origin' header is present on the requested resource—when trying to get data from a REST API And then used this approach to get it working: const proxyurl = "https://cors-anywhere.herokuapp.com/"; const url = "https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=${latitude},${longitude}&radius=500&key=[API KEY]"; // site that doesn’t send Access-Control-* fetch(proxyurl + url) // https://cors-anywhere.herokuapp.com/https://example.com .then(response => response.json()) .then(contents => console.log(contents)) .catch(() => console.log("Can’t access " + url + " response. Blocked by browser?")) More info can be found in the answer in link above.
answers question: http://stackoverflow.com/q/28359730
score: 22
has comment: http://stackoverflow.com/comment/108448488
type: Answer

http://stackoverflow.com/q/28413749
tagged with: angularjs
type: UnansweredQuestion
has body: I'm using a directive with the controllerAs syntax. I want to use 2 instances of that directive, which both need to have non shared data. My problem, it seems that there is only controller instance. There seems to be the option to add to the directive declaration a scope : {}. But then I would be forced to use the scope based access? Or is there any other way to still using the controllerAs/this syntax and enforcing angular to create 2 distinct controller object? app.directive('createA', function() { return { restrict : 'E', templateUrl : '/template/createActivity', // using this to create 2 distinct scopes // but then I can't use the this/caCtrl.data syntax? scope : {}, controller : function($scope, $rootScope) { // using this syntax to access data // in tempate like {{ caCtrl.data }} this.data = '123'; }, controllerAs : 'caCtrl' }; });
score: 2
has title: multiple angularjs directive instances with controller as syntax
upvote count: 2
tagged with: directive
type: Question
has answer: http://stackoverflow.com/a/32948800
has answer: http://stackoverflow.com/a/28417967
tagged with: javascript
tagged with: controller
answer count: 2
downvote count: 0
favorite count: 0

http://stackoverflow.com/a/37325800
type: Answer
has body: Expanding on what Sprazer wrote, here's a mixin version you can use and add it to the top-level of your SCSS sheet: @mixin carousel-fade() { .carousel { .carousel-inner { &gt;.item { opacity: 0; -webkit-transition-property: opacity; transition-property: opacity; @media all and (transform-3d), (-webkit-transform-3d) { &amp;.next, &amp;.active.right, &amp;.prev, &amp;.active.left, &amp;.next.left, &amp;.prev.right, &amp;.active { -webkit-transform: translate3d( 0, 0, 0); transform: translate3d( 0, 0, 0); } } } .active { opacity: 1; } .active.left, .active.right { left: 0; opacity: 0; z-index: 1; } .next.left, .prev.right { opacity: 1; } } .carousel-control { z-index: 2; } } }
score: 0
answers question: http://stackoverflow.com/q/28384414

http://stackoverflow.com/a/28350795
downvote count: 0
has comment: http://stackoverflow.com/comment/45046682
type: Answer
has body: From what I understood you want to show form in a modal onclick of Forward link.So here is the code html &lt;a data-toggle="modal" href="http://fiddle.jshell.net/bHmRB/51/show/" data-target="#myModal" id="getModal"&gt;Forward&lt;/a&gt; &lt;div class="modal fade" id="modalForwardMail" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close" &gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt; &lt;h4 class="modal-title" id="myModalLabel"&gt;Forward this Mail&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt;&lt;center&gt; &lt;form name="contactform" method="post" action="forwardForm.php" class="form-horizontal" role="form"&gt; &lt;input type="email" class="form-control" placeholder="Receiver Email Address" name="forwardEmail"&gt; &lt;input class="form-control" placeholder="Full Name" type="text" value={{currentUser.get('fullName')}} name="fullName"&gt; &lt;input class="form-control" placeholder="Subject" type="text" name="subject"&gt; &lt;input class="form-control" placeholder="Sender Email Address" value={{currentUser.get('username')}} type="text" name="email"&gt; &lt;br&gt;&lt;textarea class="form-control" rows="5" placeholder="Notes" name="message" cols="30"&gt;&lt;/textarea&gt; &lt;div id="url"&gt;&lt;/div&gt; &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Cancel&lt;/button&gt; &lt;input type="submit" class="btn btn-default" name="submit" value="Submit"&gt; &lt;/form&gt;&lt;/center&gt; &lt;h3&gt;&lt;/h3&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; jquery $(document).ready(function(){ $('#getModal').click(function() { var pageURL = $(location).attr("href"); $("#url").text(pageURL); $("#modalForwardMail").modal("toggle"); // alert(pageURL); }); }); DEMO1 with document.Url as you specified in comments bel…
upvote count: 1
has comment: http://stackoverflow.com/comment/45045863
score: 1
answers question: http://stackoverflow.com/q/28349522

http://stackoverflow.com/a/28560611
has body: You're on the right track to creating a performant NoSQL schema design, and I think you're asking the right questions as to how to properly lay things out. Here's my understanding of your application: It looks like Groups can both have many Followers (mapping users to groups) and many Items, but Items may not necessarily be in many Groups (although it is possible). And from your given use-case example, it sounds like retrieving all the Groups an Item is in and all the Items in a Group will be some common read operations. In your current schema design, you've implemented a model between mapping users to groups as followers and items to groups as item_groups. This works alright until you mention the problem with more complex queries: I think with the following design a real performance issue could be when I want to get all of the groups that a user is following for a specific item (based off of the user_id and item_id) I think a few things could help you out in this situation: Take advantage of MongoDB's powerful indexing capabilities. In particular, I think you should consider creating compound indexes on your Follower objects covering your Group and User, and your Item_Groups on Item and Group, respectively. You'll also want to make sure this kind of relationship is unique, in that a user can only follow a group once and an item can only be added to a group once. This would best be achieved in some pre-save hooks defined in your schema, or using a plugin to check for validity. FollowerSchema.index({ group: 1, user: 1 }, { unique: true }); Item_GroupsSchema.index({ group: 1, item: 1 }, { unique: true }); Using an index on these fields will create some overhead when writing to the collection, but it sounds like reading from the collection will be a more common interaction so it'll be worth it (I'd suggest reading more up on index performance). Since a User probably won't be following thousands of groups, I think it'd be worthwhile to include in the user model an array…
answers question: http://stackoverflow.com/q/28421505
score: 3
upvote count: 3
downvote count: 0
type: Answer

http://stackoverflow.com/q/28414792
favorite count: 0
accepted answer: http://stackoverflow.com/a/28414857
has comment: http://stackoverflow.com/comment/45162967
upvote count: 1
has title: Why won't my javascript return the values i want?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28414857
score: 1
possible better answer: http://stackoverflow.com/a/28414881
has answer: http://stackoverflow.com/a/28414881
type: Question
answer count: 2
tagged with: canvas
has body: I am trying to use a function to draw a rectangle on a canvas. The first step of this would be to find the points that the mouse is clicked. Here is the code i am using: wbtCanvas = document.getElementById("wbtCanvas"); function relMouseCoords(event){ var totalOffsetX = 0; //coordinates of corner of canvas var totalOffsetY = 0; var canvasX = 0; var canvasY = 0; var wbtCanvas = this; //what called the event do{ totalOffsetX += wbtCanvas.offsetLeft - wbtCanvas.scrollLeft; //relative coordinates totalOffsetY += wbtCanvas.offsetTop - wbtCanvas.scrollTop; } while(wbtCanvas = wbtCanvas.offsetParent) canvasX = event.pageX - totalOffsetX; canvasY = event.pageY - totalOffsetY; point = {x:canvasX, y:canvasY}; console.log("{" + point.x + ", " + point.y + "}"); return point; //object returned } function drawRectangle(){ x = relMouseCoords.x; y = relMouseCoords.y; console.log(x + " " + y); } When i call the function drawRectangle() in the console, making sure my mouse pointer is over the canvas, it gives me the following response: "undefined undefined"
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/45201379
has text: You could also go $('.main-img img').eq(-1);
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28435439

http://stackoverflow.com/comment/45108723
comment on: http://stackoverflow.com/a/28385480
score: 0
type: AnswerComment
has text: Added two other options to the answer.
type: Comment

http://stackoverflow.com/comment/126726382
score: 0
type: Comment
has text: Ahh, well done, this was my issue as well. Thank you!
comment on: http://stackoverflow.com/a/60176969
type: AnswerComment

http://stackoverflow.com/q/28387810
tagged with: css
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28388033
upvote count: 0
type: Question
has answer: http://stackoverflow.com/a/28388033
tagged with: javascript
tagged with: jquery
score: -1
has title: Jquery toggle close and disappears
answer count: 1
downvote count: 1
has body: I am using jquery to toggle multiple targets. I created a piece of code to close the div once it is open. I then close the open div by pressing an x. When I reopen the same toggle the x is not there anymore. HTML show 1 show 2 Lorum Ipsum1 x Lorum Ipsum2 CSS .targetDiv { display: none } .bio { background: #f6f6f6; margin-top: 15px; padding: 20px; display: none; border: 1px solid grey; position: relative; } .close { position: absolute; top: 15px; right: 15px; } The jquery being used jQuery(function () { jQuery('.showSingle').click(function () { var index = $(this).index(), newTarget = jQuery('.targetDiv').eq(index).slideDown(); jQuery('.targetDiv').not(newTarget).slideUp(); }); $(".close").click(function(){ $(".targetDiv").hide("fast"); $(this).toggle("fast"); }); }); How can I either toggle close by clicking on the bio class or toggle close with the x and have it still re-appear. http://jsfiddle.net/eLy4b00n/
favorite count: 0
has comment: http://stackoverflow.com/comment/95233970

http://stackoverflow.com/comment/45085392
has text: IIRC I've tried that too without much success. Can give it another try, but I am not very hopeful.
comment on: http://stackoverflow.com/q/28364248
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28432223
type: Answer
answers question: http://stackoverflow.com/q/28430497
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28430497
score: 1
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45195765
has body: Just compare this with your's ng-show: ng-show="submitClicked &amp;&amp; myOrderForm.dishQuantity.$error.required &amp;&amp; ($parent.checkboxSelection == $index)" I've added one more condition, ensuring, that error will show only for selected item.

http://stackoverflow.com/q/28342146
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/86074256
has answer: http://stackoverflow.com/a/28342879
has title: Class with common callback in javascript
upvote count: 1
has answer: http://stackoverflow.com/a/28342762
downvote count: 1
type: Question
has body: i want to build a javascript class to register several different functions to execute a single common callback, all registered functions should execute asynchronously and then once all of them are finished, it should execute the defined callback function. We should also be able to define a maximum time before the callback function executes. For example if we define that as 3000 and it takes more than 3000 ms for all registered functions to return, it should proceed to execute callback function even though the ajax functions have not finished retuning. To be clear, this code needs to be flexible, standalone and reusable To assume that any function that we register will implement a call to a function that we define at some point within it mark its completion. for eg. at the end of my function i'll enter myClass.markDone() to let the class know the function has completed executing Is it possible using javascript or with angular.js and without jquery?
tagged with: javascript
tagged with: callback
tagged with: ajax
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/49534399

http://stackoverflow.com/a/28401687
downvote count: 0
answers question: http://stackoverflow.com/q/28401660
upvote count: 2
has body: Remove the quotes on the username variable view.open({ 'post' : '//domain.com/url/person/' + username });
type: Answer
score: 2

http://stackoverflow.com/a/28325231
type: AcceptedAnswer
has body: Remove it from slide and add it to stop stop: function(event,ui) { tooltip.fadeOut('fast'); /* Ajax call here */ }
type: Answer
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/28324905
accepted answer of: http://stackoverflow.com/q/28324905
upvote count: 3

http://stackoverflow.com/comment/45549666
comment on: http://stackoverflow.com/q/28394409
score: 0
has text: your jsfiddle unfortunately doesn't seem to load, jsfiddle gets stuck
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28282638
tagged with: javascript
has title: Returning an $http request into another one after an action
has body: I cannot seem to get this to work and really starting to get to me. It's very simple. click show more {{ x.Name + ', ' + x.Country }} I just want to return a new $http request into the first array (at a certain point). but I don't know how to simply read the data from the second request in anyway shape or form.. I must have the syntax wrong or something.
has answer: http://stackoverflow.com/a/28282933
has comment: http://stackoverflow.com/comment/44919795
tagged with: angularjs
type: UnansweredQuestion
score: 0
type: Question
answer count: 1

http://stackoverflow.com/comment/44943613
type: QuestionComment
has text: I've edited my question to remove the recommendation. All I'm looking for is if there's any way to perform RSA encryption and decryption that produces the same results from JS and C#. I'm looking guidance here.
score: 0
comment on: http://stackoverflow.com/q/28293008
type: Comment

http://stackoverflow.com/q/28283543
has answer: http://stackoverflow.com/a/28283664
accepted answer: http://stackoverflow.com/a/28283664
has comment: http://stackoverflow.com/comment/44921334
type: Question
has title: How can I make my jquery if/then statement update live?
type: AnsweredQuestion
has body: I am trying to write a simple conditional that says if div1 is displayed, then change div2's display to none. However, I want this to be updated live. So anytime div1 display is 'grid', div2 disappears from sight. &lt;script&gt; if($('.div1').css("display") == "grid") { $('div2').css({"display":"none"}); } &lt;/script&gt; What am I doing wrong here?
upvote count: 2
downvote count: 2
answer count: 2
tagged with: javascript
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/8671001
score: 0
possible better answer: http://stackoverflow.com/a/28283707
has answer: http://stackoverflow.com/a/28283707
has comment: http://stackoverflow.com/comment/44921260

http://stackoverflow.com/comment/45017306
type: AnswerComment
comment on: http://stackoverflow.com/a/28334948
type: Comment
has text: Thanks for the answer! This looks really promising, will test it out tomorrow!
score: 0

http://stackoverflow.com/comment/45011794
score: 0
type: Comment
has text: and yeah i think ill have to change the method and leave the html
type: QuestionComment
comment on: http://stackoverflow.com/q/28329833

http://stackoverflow.com/comment/44981383
type: QuestionComment
type: Comment
has text: I'd suggest you add a `console.log(data)` to see what your `data` variable is. My guess is that it's `undefined` or something that doesn't stringify properly
comment on: http://stackoverflow.com/q/28316115
score: 0

http://stackoverflow.com/comment/45043140
type: Comment
type: QuestionComment
has text: check your console (F12 in the browser) and post which errors you receive, if any.
comment on: http://stackoverflow.com/q/28349534
score: 0

http://stackoverflow.com/comment/45046503
type: Comment
has text: what's the problem with using socket.io ?
comment on: http://stackoverflow.com/q/28350959
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45371343
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28383091
has text: @AhosanKarimAsik, The output is: "Abc's test s c++ c Dirty's. and beautiful"

iframe
tags question: http://stackoverflow.com/q/28323676
tags question: http://stackoverflow.com/q/28295870
tags question: http://stackoverflow.com/q/28361795
tags question: http://stackoverflow.com/q/28420080
tags question: http://stackoverflow.com/q/28365572
tags question: http://stackoverflow.com/q/28353988
tags question: http://stackoverflow.com/q/28369355
tags question: http://stackoverflow.com/q/28332829
tags question: http://stackoverflow.com/q/28300820
tags question: http://stackoverflow.com/q/28434355
tags question: http://stackoverflow.com/q/28364248
tags question: http://stackoverflow.com/q/28343653
tags question: http://stackoverflow.com/q/28364158
tags question: http://stackoverflow.com/q/28295721
tags question: http://stackoverflow.com/q/28387383
tag name: iframe
tags question: http://stackoverflow.com/q/28402026
tags question: http://stackoverflow.com/q/28310005
tags question: http://stackoverflow.com/q/28379010
tags question: http://stackoverflow.com/q/28289402
tags question: http://stackoverflow.com/q/28362958
tags question: http://stackoverflow.com/q/28359880
tags question: http://stackoverflow.com/q/28353893
tags question: http://stackoverflow.com/q/28331689
tags question: http://stackoverflow.com/q/28419990
tags question: http://stackoverflow.com/q/28334453
tags question: http://stackoverflow.com/q/28300192
tags question: http://stackoverflow.com/q/28414580
tags question: http://stackoverflow.com/q/28315968
tags question: http://stackoverflow.com/q/28331464
tags question: http://stackoverflow.com/q/28410087
tags question: http://stackoverflow.com/q/28379670
tags question: http://stackoverflow.com/q/28360672
tags question: http://stackoverflow.com/q/28407576
tags question: http://stackoverflow.com/q/28316374
tags question: http://stackoverflow.com/q/28341591
tags question: http://stackoverflow.com/q/28295772
tags question: http://stackoverflow.com/q/28394552
tags question: http://stackoverflow.com/q/28406760
tags question: http://stackoverflow.com/q/28369423
tags question: http://stackoverflow.com/q/28397401
tags question: http://stackoverflow.com/q/28340003
tags question: http://stackoverflow.com/q/28313251
tags question: http://stackoverflow.com/q/28415110
type: Tag
tags question: http://stackoverflow.com/q/28395377
tags question: http://stackoverflow.com/q/28408688
tags question: http://stackoverflow.com/q/28361415
tags question: http://stackoverflow.com/q/28434443
tags question: http://stackoverflow.com/q/28396391
tags question: http://stackoverflow.com/q/28333491
tags question: http://stackoverflow.com/q/28419646
tags question: http://stackoverflow.com/q/28309576
tags question: http://stackoverflow.com/q/28284765
tags question: http://stackoverflow.com/q/28310470
tags question: http://stackoverflow.com/q/28389783
tags question: http://stackoverflow.com/q/28315566
tags question: http://stackoverflow.com/q/28428338
tags question: http://stackoverflow.com/q/28415256
tags question: http://stackoverflow.com/q/28303136
tags question: http://stackoverflow.com/q/28318633

http://stackoverflow.com/comment/45167077
type: Comment
type: QuestionComment
has text: @Bergi: you're right (mostly). It is critically important that the array be able to contain some non-promise values, and that those values simply be passed along to the callback (transparently wrapping them in already-fulfilled promises if necessary).
comment on: http://stackoverflow.com/q/28386411
score: 0

http://stackoverflow.com/a/28424860
type: Answer
has comment: http://stackoverflow.com/comment/45209791
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28405046
downvote count: 0
has body: Please try refreshing the kendo grid after deleting the record. Following is the code. $('#GridName').data('kendoGrid').refresh();

http://stackoverflow.com/q/28415101
favorite count: 0
answer count: 0
type: UnansweredQuestion
upvote count: 1
has title: Google maps open infowindow on load
type: Question
tagged with: google-maps
downvote count: 0
tagged with: javascript
tagged with: google-maps-api-3
has comment: http://stackoverflow.com/comment/45163829
has comment: http://stackoverflow.com/comment/45176384
score: 1
has comment: http://stackoverflow.com/comment/45164230
has body: Hi I am trying to have my google mapps infowidnow open on load of the page. I have been trying to work out how to do this, to no avail. I was wondering if anyone could have a look and push me in the right direction? Thanks Here is my code: function initialize() { var latlng = new google.maps.LatLng(53.855475, -1.605927); var settings = { zoom: 16, scrollwheel: false, center: latlng, mapTypeControl: true, mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.DROPDOWN_MENU }, navigationControl: true, navigationControlOptions: { style: google.maps.NavigationControlStyle.SMALL }, mapTypeId: google.maps.MapTypeId.ROADMAP }; var contentString = ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' '; var infowindow = new google.maps.InfoWindow({ content: contentString }); var map = new google.maps.Map(document.getElementById("map_canvas"), settings); var companyPos = new google.maps.LatLng(53.855475, -1.605927); var companyMarker = new google.maps.Marker({ position: companyPos, map: map, title: "Some title" }); google.maps.event.addListener(companyMarker, 'click', function() { infowindow.open(map, companyMarker); }); }

http://stackoverflow.com/q/28436360
has title: d3 - drag behaviour triggered when clicking
type: AnsweredQuestion
score: 2
downvote count: 0
type: Question
has comment: http://stackoverflow.com/comment/45203060
upvote count: 2
tagged with: javascript
has body: In my svg container, I have a &lt;g&gt; with a rectangle and text. When dragging this group, I want to make the group disappear and just drag a small rectangle across the screen to represent the object. In order to do that, I use a &lt;div&gt; which I make visible when dragging starts. I make my svg group being dragged disappear. You can see the fiddle here. And code here: function dragDiv2End(d) { console.log('ending'); var a = d3.select(this); a.attr('x', initial.x).attr('y', initial.y).attr('width', initial.width).attr('height', initial.height); a.transition().style("opacity",1); d3.select('#dragid').style('visibility', 'hidden'); } function dragDiv2Start(d) { d3.event.sourceEvent.stopPropagation(); console.log('starting'); var a = d3.select(this); initial = {x: a.attr('x'), y: a.attr('y'), width: a.attr('width'), height: a.attr('height')}; a.attr('x', d3.mouse(this)[0]) .attr('y', d3.mouse(this)[1]) .attr('width', 20) .attr('height', 20).style("opacity",0); var b = d3.select('#dragid'); b.style({ left: (parseInt(d3.mouse(this)[0])) + "px", top: d3.mouse(this)[1] + "px", border: "1px solid black", visibility: 'visible' }); } function dragDiv2Move(d) { var b = d3.select(this); var a = d3.select('#dragid'); a.transition().delay(50).style('opacity', 1); //console.log(d3.event.x, d3.event.y, a.style("right")); console.log(d3.mouse(this)); a.style({ left: (parseInt(d3.mouse(this)[0])) + "px", top: d3.mouse(this)[1] + "px" }); } function doClick(d) { if (d3.event.defaultPrevented) return; console.log('clicked'); } var initial = {}; var svg = d3.select('#div2').append('svg').attr('height', 300).attr('width', 300).style('border', 'solid 1px blue'); var g = svg.append('g').on('click', doClick); g.append('rect').attr('x', 10).attr('y', 10).attr('width', 200).attr('height', 200).style('stroke', 'red').style('fill', 'white'); var text = g.append('text') text.text('my test').attr('x', 50).attr('y', 50); var dragDiv = d3.behavior.drag() .origin(Object) .on("drag", dragDivMove)…
accepted answer: http://stackoverflow.com/a/28439599
tagged with: drag-and-drop
has comment: http://stackoverflow.com/comment/45218495
answer count: 1
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
has answer: http://stackoverflow.com/a/28439599
tagged with: d3.js

http://stackoverflow.com/comment/45041430
type: AnswerComment
comment on: http://stackoverflow.com/a/28330958
score: 0
type: Comment
has text: @Mike, I totally agree. critical thinking lessons and assignments - like this one - can be quite beneficial. you can get more out of giving a 'rationalized' incorrect answer then simply providing the correct answer. It's about reflecting on the false logic in your rationality that lead to the wrong answer, and addressing that. @SamGarcia, read and gain familiarity with the API.. in particular, review `$().live` and `$().delegate`. see whether they are applicable..

http://stackoverflow.com/q/28371559
tagged with: jquery-animate
tagged with: javascript
score: 0
answer count: 1
has body: I implemented a function which is able to show/hide the content of a table row or column with a sliding animation. What the code does: Retrieve all cells of the column (th, td) Wrap the content of each cell in a &lt;div class="wrapper" /&gt; Animate the width of the wrapper div with jQuery.animate(); After finishing, unwrap the cell contents (remove the div) The reason why I need the wrapping div is because jQuery can't perform a slide animation on table cells directly - see How to Use slideDown (or show) function on a table row? See this codepen for the code and demonstration. I removed as much JS code as possible to demonstrate my problem. (You can ignore the html and css, they don't contain relevant information) Everything works perfectly for rows and columns, in except of one (two?) problems: When a column is shrinked, the content eventually starts wrapping when there's not enough space left. When this happens, the cell height suddenly increases, resulting in an ugly jump. When a cell content doesn't need the whole space of it's cell, the show-animation for this content is faster, resulting in ugly output. What I want to achive is a constantly changing width without affecting the layout. The other columns must not be affected. Any ideas how I can achieve that?
tagged with: jquery
type: UnansweredQuestion
tagged with: css
linked to: http://stackoverflow.com/q/467336
has title: jQuery slide animation for tables
type: Question
has answer: http://stackoverflow.com/a/28371854

http://stackoverflow.com/a/28436815
has comment: http://stackoverflow.com/comment/45204002
has body: $("#country-selector").change(function(){ var x = document.getElementById("country-selector").value; $.post('page2.php', {'selectedCountry': x}).done(function(response) { alert(response); }); });
has comment: http://stackoverflow.com/comment/45204122
answers question: http://stackoverflow.com/q/28436577
type: AcceptedAnswer
score: 0
accepted answer of: http://stackoverflow.com/q/28436577
type: Answer

http://stackoverflow.com/comment/45162858
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28414737
has text: @MilindAnantwar I will try. Give me a sec
score: 0

http://stackoverflow.com/comment/44942546
type: Comment
comment on: http://stackoverflow.com/a/28294422
type: AnswerComment
has text: @user3311392 no, to get interesting feedback or to help you.
score: 0

http://stackoverflow.com/q/28327032
has body: I have a function that runs my code given that I pass through a JSON file. I did this so I can change the file via a button not via code. tryOutChange(JSONFILE) // this holds the main bulk of code. changeJSON() // this is a button that runs the function above. This function first deletes the old 'g' elements that hold the nodes and edges (my force directed graph) and then runs the main code with a different JSON file. This way I can click the same button and swap which JSON file i read. var networkJSONfile = true; function changeJSON() { var oldForce = document.getElementById("forceLayout"); oldForce.parentNode.removeChild(oldForce); if(networkJSONfile == true){ tryOutChange(engine); networkJSONfile = false; } else if(networkJSONfile == false){ tryOutChange(network); networkJSONfile = true; } } This works. But only once. When I go to create one of the graphs i recently deleted it wont create the graph again ? Have I deleted the JSON file too by anychance or ? Network and Engine are JSON files Here is what happens. I run the tryOutChange() and pass the 'network' JSON file to it straight away so it comes up with a network viewer. I then click a button which runs the changeJSON() function. This function deletes everything I created previously when I called tryOutChange(). and then calls that function again with Engines JSON. When I click the button again it does the same this. Deletes what I have created, then called that tryOutChange() function using the Network JSON. And so on. So in theory, it should toggle JSON files from network to engine on click. When i first click it, its fine, it deletes the network and shows the engine, but when i want to go back and recreate the network uising network JSON it doesnt work ?
has comment: http://stackoverflow.com/comment/45035472
has comment: http://stackoverflow.com/comment/45035791
has comment: http://stackoverflow.com/comment/45035364
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45034925
has comment: http://stackoverflow.com/comment/45034664
has comment: http://stackoverflow.com/comment/45035761
has comment: http://stackoverflow.com/comment/45034863
type: Question
score: 0
tagged with: javascript
has title: Toggle JSON file i read in
has comment: http://stackoverflow.com/comment/45035190
answer count: 0
tagged with: d3.js
type: UnansweredQuestion

http://stackoverflow.com/comment/44930697
comment on: http://stackoverflow.com/q/28288220
has text: I tried to use a really simple example so it was clear what I was asking. I would be doing quite a bit more than just copying an array. The array I would be iterating over would be on the 'this' object of the spider instance.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/61277455
score: 1
comment on: http://stackoverflow.com/q/28426605
has text: I'm voting to close this question as off-topic because Stack Overflow is not a user testing website.
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45044901
comment on: http://stackoverflow.com/q/28350495
type: Comment
type: QuestionComment
has text: http://www.create-a-website-with-html.com
score: 0

http://stackoverflow.com/comment/44959843
has text: Can you please post the answer you found as an answer?
comment on: http://stackoverflow.com/q/28302147
score: 0
type: Comment
type: QuestionComment

d3.js
tags question: http://stackoverflow.com/q/28351347
tags question: http://stackoverflow.com/q/28286181
tags question: http://stackoverflow.com/q/28358480
tags question: http://stackoverflow.com/q/28327032
tags question: http://stackoverflow.com/q/28433997
tags question: http://stackoverflow.com/q/28406793
tags question: http://stackoverflow.com/q/28287713
tags question: http://stackoverflow.com/q/28395510
tags question: http://stackoverflow.com/q/28388029
tags question: http://stackoverflow.com/q/28375662
tags question: http://stackoverflow.com/q/28398997
tags question: http://stackoverflow.com/q/28318004
tags question: http://stackoverflow.com/q/28385858
tags question: http://stackoverflow.com/q/28374365
tags question: http://stackoverflow.com/q/28375045
tags question: http://stackoverflow.com/q/28419888
tags question: http://stackoverflow.com/q/28314069
tags question: http://stackoverflow.com/q/28408956
tags question: http://stackoverflow.com/q/28329323
tags question: http://stackoverflow.com/q/28284646
tags question: http://stackoverflow.com/q/28292532
tags question: http://stackoverflow.com/q/28426905
tags question: http://stackoverflow.com/q/28387189
tags question: http://stackoverflow.com/q/28401180
tags question: http://stackoverflow.com/q/28326757
tags question: http://stackoverflow.com/q/28297679
type: Tag
tags question: http://stackoverflow.com/q/28282906
tags question: http://stackoverflow.com/q/28348347
tags question: http://stackoverflow.com/q/28347374
tags question: http://stackoverflow.com/q/28332777
tags question: http://stackoverflow.com/q/28298196
tags question: http://stackoverflow.com/q/28331804
tags question: http://stackoverflow.com/q/28319776
tags question: http://stackoverflow.com/q/28370165
tags question: http://stackoverflow.com/q/28291656
tags question: http://stackoverflow.com/q/28366221
tags question: http://stackoverflow.com/q/28415206
tags question: http://stackoverflow.com/q/28402965
tags question: http://stackoverflow.com/q/28334576
tags question: http://stackoverflow.com/q/28412136
tags question: http://stackoverflow.com/q/28288050
tags question: http://stackoverflow.com/q/28399715
tags question: http://stackoverflow.com/q/28436360
tags question: http://stackoverflow.com/q/28310470
tags question: http://stackoverflow.com/q/28314056
tags question: http://stackoverflow.com/q/28346874
tags question: http://stackoverflow.com/q/28323977
tags question: http://stackoverflow.com/q/28373718
tags question: http://stackoverflow.com/q/28417520
tags question: http://stackoverflow.com/q/28302943
tags question: http://stackoverflow.com/q/28288706
tags question: http://stackoverflow.com/q/28380746
tags question: http://stackoverflow.com/q/28410941
tags question: http://stackoverflow.com/q/28410707
tags question: http://stackoverflow.com/q/28376166
tags question: http://stackoverflow.com/q/28412536
tags question: http://stackoverflow.com/q/28356156
tags question: http://stackoverflow.com/q/28399855
tags question: http://stackoverflow.com/q/28331192
tags question: http://stackoverflow.com/q/28415677
tag name: d3.js
tags question: http://stackoverflow.com/q/28283158
tags question: http://stackoverflow.com/q/28305833
tags question: http://stackoverflow.com/q/28287378
tags question: http://stackoverflow.com/q/28364228
tags question: http://stackoverflow.com/q/28365667
tags question: http://stackoverflow.com/q/28287929
tags question: http://stackoverflow.com/q/28424004
tags question: http://stackoverflow.com/q/28371079
tags question: http://stackoverflow.com/q/28387686
tags question: http://stackoverflow.com/q/28352417
tags question: http://stackoverflow.com/q/28328077
tags question: http://stackoverflow.com/q/28305205
tags question: http://stackoverflow.com/q/28411736
tags question: http://stackoverflow.com/q/28358108
tags question: http://stackoverflow.com/q/28398274
tags question: http://stackoverflow.com/q/28358669
tags question: http://stackoverflow.com/q/28402084
tags question: http://stackoverflow.com/q/28288682

http://stackoverflow.com/comment/45008629
type: AnswerComment
score: 0
has text: added extra info again nif it helps.
type: Comment
comment on: http://stackoverflow.com/a/28329550

http://stackoverflow.com/a/28352693
type: Answer
answers question: http://stackoverflow.com/q/28351401
has body: Solution found I searched on which is the best site to include jquery from and found the link to the google api site. The link contained version 1.4.3 instead of the newer version (1.11.2), with which it works just fine.
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28351401

http://stackoverflow.com/comment/44990932
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28318244
has text: No need for a plugin, just use object.addEventListener('scroll', function);
score: 0

http://stackoverflow.com/comment/58099437
type: Comment
comment on: http://stackoverflow.com/a/35191057
has text: "this looks like it's coming in ES7" it definitely does not, the feature set is finalised and consists only of the 2 stage-4 proposals.
score: 0
type: AnswerComment

http://stackoverflow.com/a/28412776
has comment: http://stackoverflow.com/comment/45159142
type: AcceptedAnswer
downvote count: 0
score: 1
has body: Congrats on having a popular app. The row count is a low cost operation, just do (new Parse.Query("MyTable")).count(). The way to do summary stats is to keep a running max and average in a single row in their own table. You can compute an incremental average with a count, see here. The gist is: newAve = oldAve + (newScore-oldAverage)/count The max is even simpler: newMax = (newScore&gt;oldMax)? newScore : oldMax; Not sure I understand what the points refers to in your question, but hopefully you can extend the ideas here. EDIT I think I understand the points data to be a distribution of scores. It sounds like you bin the score into 40 categories (probably by rounding), and then count the number of scores achieved in each bin. If I'm right, this, too, can be handled with an additional summary representation: Add a table with a column that represents the bin (say an int, 0..40), and an int column that represents the number of scores achieved in that bin. That whole table 40*2ints can be easily read into memory and manipulated.
accepted answer of: http://stackoverflow.com/q/28412091
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/45191950
answers question: http://stackoverflow.com/q/28412091

http://stackoverflow.com/q/28377303
has title: Gulp tasks appear to be running twice, instead of once
has comment: http://stackoverflow.com/comment/60445807
type: Question
has body: Problem My gulp tasks seem to be running twice instead of once, trying to fix thatI think some have suggested that the culprit might lie in the default task in Gulpfile.js Gulpfile.js // Include Gulp var gulp = require('gulp'); // All of your plugins var autoprefixer = require('gulp-autoprefixer'); var imagemin = require('gulp-imagemin'); var jshint = require('gulp-jshint'); var livereload = require('gulp-livereload'); var minify = require('gulp-minify-css'); var notify = require('gulp-notify'); var rename = require('gulp-rename'); var sass = require('gulp-sass'); var uglify = require('gulp-uglify'); var watch = require('gulp-watch'); // Compile CSS, Autoprefix gulp.task('styles', function() { return gulp.src('assets/css/style.scss') .pipe(sass({ style: 'expanded' })) .pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4')) .pipe(gulp.dest('assets/css')) // .pipe(rename({suffix: '.min'})) // .pipe(minify()) .pipe(gulp.dest('assets/css')) .pipe(notify({ message: "Watson: I've organized your files for you." })); }); // Lint, Concatenate and Minify JavaScript gulp.task('scripts', function() { return gulp.src('assets/js/scripts.js') .pipe(jshint()) .pipe(jshint.reporter('default')) // .pipe(concat('scripts.js')) .pipe(gulp.dest('assets/js')) // .pipe(rename({suffix: '.min'})) // .pipe(uglify()) .pipe(gulp.dest('assets/js')) .pipe(notify({ message: "Watson: I've done your dirty laundry." })); }); // Watch files for changes gulp.task('watch', function() { gulp.watch('assets/js/*.js', ['scripts', 'styles']); gulp.watch('assets/css/**/*.scss', ['styles']); }); // Default Task gulp.task('default', function() { gulp.start('styles', 'scripts', 'watch'); }); Terminal [18:53:57] Using gulpfile ~/Desktop/Projects/legislature/Gulpfile.js [18:53:57] Starting 'default'... [18:53:57] Starting 'styles'... [18:53:57] Starting 'scripts'... [18:53:58] Starting 'watch'... [18:53:58] Finished 'watch' after 26 ms [18:53:58] Finished 'default' aft…
has answer: http://stackoverflow.com/a/36415216
tagged with: javascript
answer count: 2
downvote count: 0
tagged with: gulp
favorite count: 0
tagged with: terminal
has answer: http://stackoverflow.com/a/28381051
type: UnansweredQuestion
score: 1
upvote count: 1

http://stackoverflow.com/q/28295055
has answer: http://stackoverflow.com/a/28296622
has body: I'm trying to get a Javascript/jQuery code snippet to run from an external .js file. It ran fine when within script tags at the bottom of my asp.net html page but now it's in an external JS file it doesn't run. I have successfully inserted (dynamically) a link to the external file (Viewable in page source) and been able to fire a popup alert from inside it, so I know the external file is being accessed correctly. I've also got my reference to JQuery before the external file, but the following script will not fire / run? any ideas would be great, thanks. $("#&lt;%=sDatepicker.ClientID%&gt;").focus(function () { //$(this).blur(); alert("Handler for .Datepicker called."); }); As you can see I'm trying to access a Textbox with ID=sDatepicker, but asp.net adds a ClientID before it so I need to get that to find the actual TextBox. I have considered the page may not have loaded and the TextBox control may not exist as the external JS file is in the Head of my document, but I have also tried adding $('document').ready(function () { }); around the script in the JS file, but this doesn't seem to help. Like I said, it worked fine when in the HTML page, but I need to only reference the external file under certain circumstances, so need to add it from my C# code behind dynamically when required. cheers. update from feedback below in regards possible solution 1. I now have in my external JS file the following: $(document).ready(function () { keypadSuppress(); }); and in my .aspx HTML file I have the following: &lt;script type="text/javascript"&gt; function keypadSuppress() { $("#&lt;%=sDatepicker.ClientID%&gt;").focus(function () { $(this).blur(); alert("Handler for sDatepicker called."); }); $("#&lt;%=eDatepicker.ClientID%&gt;").focus(function () { $(this).blur(); alert("Handler for eDatepicker called."); }); } &lt;/script&gt; Update 2 Tried the above code in the Update above and its working fine today (the gremlins must be asleep still). The only change I made was to add an ale…
type: Question
tagged with: c#
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/44942575
tagged with: asp.net
has title: Why won't my code run when in external.js file but does if in HTML
type: UnansweredQuestion

http://stackoverflow.com/a/28348159
has comment: http://stackoverflow.com/comment/45040383
has body: You'll want to use the language feature Array.prototype.forEach. Check out some great documentation from MDN here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach Here's a version of your code: var nums = [0, 0, 0, 0]; nums.forEach(function(nums){ x = Math.floor((Math.random() * 9) + 1); })
has comment: http://stackoverflow.com/comment/45041012
downvote count: 0
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28348082
type: Answer

http://stackoverflow.com/q/28405397
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28405498
linked to: http://stackoverflow.com/q/4376987
favorite count: 0
duplicate of: http://stackoverflow.com/q/4376987
tagged with: datepicker
has body: function () { // initialize date picker with correct date format Calendar.setup({ inputField: 'delivery_date', ifFormat: '%Y-%m-%d', align: 'Bl', button: 'delivery_date', singleClick: true, disableFunc : function(date) { var today = new Date(); today.setDate(today.getDate() + 4); date = date &lt; today; return (date); } }); } The above code for disable dates of after five days of current data. I want to disable all Sundays also How can i do that.
accepted answer: http://stackoverflow.com/a/28405498
upvote count: 1
tagged with: magento-1.9.1
type: AnsweredQuestion
has title: I want to disable all Sunday
score: 1
possible better answer: http://stackoverflow.com/a/28405519
has answer: http://stackoverflow.com/a/28405519

http://stackoverflow.com/comment/45155124
type: Comment
type: QuestionComment
has text: I tired to make a funny =). my example did contain item without prices. I made an edit to put a comment near it. It also looks like a bug to me, may be I'll post it on the repo...
comment on: http://stackoverflow.com/q/28365503
score: 0

http://stackoverflow.com/comment/45142132
comment on: http://stackoverflow.com/a/28401933
has text: Yeppers. This seems like the only solution. The other thought I had was overriding the return promise's abort function and overriding it with one that aborts whichever the active ajax is, but I think that would be more confusing. I was just hoping there was a way to abort no matter what part of the chain of promises was active, but I don't think there is! :)
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/a/28388962
answers question: http://stackoverflow.com/q/28388731
has body: There is no right answer. If you already have a live webSocket connection and you know you will have that, then is is perfectly acceptable to have the client send messages over that webSocket to request data. Whether you use the webSocket for that or use an HTTP Ajax request is really more a matter of which seems easier to you in both client and server. A webSocket request "should" be slightly more efficient because the socket is already open and connected (so you avoid the socket setup overhead of an HTTP call). And, if you're running over https, then it has even more setup overhead. But, there exists a lot of useful infrastructure for processing HTTP requests on the server (sessions, templates, lots of middleware, debug tools, proxies, etc...) that might be easier to use for an AJAX call. And, Ajax calls may also be useful as an API when a webSocket is not already open). There are pros/cons both directions so it really depends upon the type of request, the tools used to fulfill the request and your own preference.
type: Answer
score: 3
downvote count: 0
upvote count: 3

http://stackoverflow.com/q/28331133
tagged with: java
type: Question
answer count: 1
tagged with: javascript
has body: I am writing a Rest service that checks to see if any providers are ingesting. If so return true and if not return false. I wouldn't mind if it returned a boolean but I couldn't find anything about it when doing research. This is the javascript that calls the rest service in a ajax call: var result = $.ajax({url:cdpeConfig.providerUrl+'/updateStatus',type: 'GET'}); if (result=="true"){ alert(result); } else{ alert(JSON.stringify(result)); } the json.stringify is the only way I have been able to see what it returns. All I have seen it return is {"readyState":1} Here is the java: `@GET @Path("/updateStatus") @Produces({MediaType.TEXT_PLAIN}) public String isIngesting(){ String result = "false"; List&lt;Provider&gt; providers = new ArrayList&lt;Provider&gt;(); providers = providerManager.getAllProviders(); for (Provider provider : providers) { if (provider.getUpdateStatus().toLowerCase().equals(CdpeEnum.UpdateStatus.INGEST.toString().toLowerCase()) ) { result = "true"; } } return result; }`
score: 0
tagged with: rest
has answer: http://stackoverflow.com/a/28331239
accepted answer: http://stackoverflow.com/a/28331239
has title: Is there anyway to get a Rest service call to return a plain String?
tagged with: spring
has comment: http://stackoverflow.com/comment/45009773
type: AnsweredQuestion

http://stackoverflow.com/comment/45223322
type: Comment
has text: This free, just download from github repos in the links
comment on: http://stackoverflow.com/a/28416221
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45032746
comment on: http://stackoverflow.com/q/28343486
score: 0
type: Comment
type: QuestionComment
has text: Ok, can you post an [mcve](http://stackoverflow.com/help/mcve). I can hardly imagine that a hack like this is needed. And please next time mention what you did and tried before, see [ask]. Saves us time. And

http://stackoverflow.com/a/28437204
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45237811
type: Answer
has body: I recommend you use SockJS module in server and client side. Look this example for client: var sock = new SockJS('YOUR_SOCKJS_URL'); sock.onopen = function() { console.log('open'); }; sock.onmessage = function(e) { console.log('message', e.data); }; sock.onclose = function() { console.log('close'); }; function send(){ // this for onclick="send()" sock.send(); } For server use Sockjs module. example: var http = require('http'); var sockjs = require('sockjs'); var echo = sockjs.createServer({ sockjs_url: 'http://cdn.jsdelivr.net/sockjs/0.3.4/sockjs.min.js' }); echo.on('connection', function(conn) { conn.on('data', function(message) { conn.write(message); }); conn.on('close', function() {}); }); var server = http.createServer(); echo.installHandlers(server, {prefix:'/echo'}); server.listen(9999, '0.0.0.0');
downvote count: 0
answers question: http://stackoverflow.com/q/28437000
score: 1
accepted answer of: http://stackoverflow.com/q/28437000
has comment: http://stackoverflow.com/comment/45240102

http://stackoverflow.com/q/28419509
has title: Return an array of strings after filtering #tags
possible better answer: http://stackoverflow.com/a/28419602
answer count: 3
has answer: http://stackoverflow.com/a/28419602
has answer: http://stackoverflow.com/a/28419897
has answer: http://stackoverflow.com/a/28419619
favorite count: 0
has comment: http://stackoverflow.com/comment/45172207
tagged with: regex
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28419619
has body: I was wondering if someone could provide me with a JavaScript RegEx statement to filter out the text out of all the #tags in the input box. Scenario: I have a user input text box where users can enter multiple #tags. What I would like to do is have all the texts filtered out and stored in an array after removing the special characters and save it to the database by looping over the array. Example: Input- #tag1, #tag2, #tag3... Output: An array of [tag1, tag2, tag3...] Thanks in advance..
downvote count: 1
type: Question
upvote count: 0
tagged with: arrays
tagged with: tags
tagged with: javascript
score: -1

http://stackoverflow.com/q/28370386
has title: How to get the Kendo control in the viewmodel when using MVVM
tagged with: kendo-panelbar
tagged with: javascript
has comment: http://stackoverflow.com/comment/45092685
tagged with: kendo-ui
score: 0
linked to: http://stackoverflow.com/q/28859975
has comment: http://stackoverflow.com/comment/45995026
has comment: http://stackoverflow.com/comment/45155620
has comment: http://stackoverflow.com/comment/45147339
has body: I have a simple page with a few controls like this: Action menu Log users out and then I do something like this to create a view model and bind things: var vm; require(['App/Admin/userInfoGrid'], function (userInfo) { vm = userInfo.UserInfoGrid(config_UserInfo); kendo.bind($(config_UserInfo.gridId), vm); kendo.bind($(config_UserInfo.actionMenu), vm.ActionMenu); kendo.bind($(config_UserInfo.logOutButton), vm.LogOutButton); kendo.bind($(config_UserInfo.messageWindow), vm.MessageWindow); }); In the page there are multiple controls, so I bind all of them this way. Inside the vm: this.ActionMenu = kendo.observable({ expandMode: "single", //onCollapse: onCollapse, //onEnable: function(e) { // alert("on enable"); //} }); This works, but the panel bar that I am using has it's on methods and events and I want to use those. So far if I want to use the in-built methods and events inside the viewModel I have to do something like this: var panelBar = $(config.actionMenu).data("kendoPanelBar"); panelBar.enable($("#item1"), false); And if I try to grab and inspect the observable: console.log(that.ActionMenu) It doesn't have the kendo in-built methods, only the ones I have defined myself. Since I don't want to re-invent the wheel and re-implement all those methods that should be already in place, is there a way to get my ActionMenu to get access to the "kendoPanelBar" functionality? Since they are, after all, the same control, I would imagine there must be some way I could get it to work like this instead: that.ActionMenu.enable($("#item1"), false); Any ideas? This particular example is for the panelBar but the same question applies for all other controls. Thanks in advance
answer count: 0
type: UnansweredQuestion
tagged with: kendo-mvvm
type: Question

http://stackoverflow.com/comment/45228309
type: Comment
comment on: http://stackoverflow.com/a/28433576
score: 0
type: AnswerComment
has text: Hi Federico, thanks for the response, I tried your suggestion but then realised that you can't actually run php code within javascript, it just prints the line as text ...

http://stackoverflow.com/comment/44968483
comment on: http://stackoverflow.com/q/28301077
type: Comment
type: QuestionComment
has text: i faced this problem a few months back, couldn't find a fix for it, so what i did was use the blockUI plugin to disable all the page until the table finish load. of course this doesn't make sense at all since im making a async task work like a sync one, but this solution was still better then let it free couse aparently the user loves the ideia to press on a link before the table finish. im upvoting your question couse i need a solution for this too
score: 1

http://stackoverflow.com/q/28349877
tagged with: angularjs
type: UnansweredQuestion
has title: using `angular.copy ` to set model - what's the benefit?
upvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28350409
downvote count: 0
answer count: 1
has body: Today I was reviewing this widget and found the following way to set property: if (selected !== $scope.dropdownModel) { angular.copy(selected, $scope.dropdownModel); } I'm wondering what's the benefit of such method as opposed to: $scope.dropdownModel = selected;
score: 1
favorite count: 0

http://stackoverflow.com/a/30021546
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28294994
has body: What's your file plugin version? I had an similar issue with File plugin 1.3, and fixed with that: public LocalFilesystemURL filesystemURLforLocalPath(String localPath) { LocalFilesystemURL localURL = null; int shortestFullPath = 0; for (Filesystem fs: filesystems) { if (fs != null) { //LocalFilesystemURL url = fs.URLforFilesystemPath(localPath); LocalFilesystemURL url = fs.URLforFilesystemPath(Uri.encode(localPath, "/")); if (url != null) { if (localURL == null || (url.fullPath.length() &lt; shortestFullPath)) { localURL = url; shortestFullPath = url.fullPath.length(); } } } } return localURL; }

http://stackoverflow.com/a/28383704
upvote count: 10
has comment: http://stackoverflow.com/comment/49765118
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28383488
accepted answer of: http://stackoverflow.com/q/28383488
has comment: http://stackoverflow.com/comment/56747331
score: 10
type: Answer
has body: Got it. I was forgetting to specify that the preset layout must be used. Added the following: layout: { name: 'preset' }, to the cy object and it works.

http://stackoverflow.com/q/28400297
type: AnsweredQuestion
tagged with: breeze
downvote count: 0
score: 1
linked to: http://stackoverflow.com/q/2086666
type: Question
tagged with: javascript
tagged with: sql
upvote count: 1
answer count: 1
favorite count: 0
tagged with: wcf
has answer: http://stackoverflow.com/a/28403371
has title: breeze.js plain old sql
accepted answer: http://stackoverflow.com/a/28403371
has body: I am into the process of evaluating either I should use Breeze.js in my project. I understand that Breeze uses some kind of linq-esque language to send queries to the server and then to the database. Does Breeze.js allow the alternative use of plain old sql? example: var plain_old_query = EntityQuery.from_plain_old_query('select * from customers where bla bla bla'); manager.executePlainOldQuery(plain_old_query) In fact the main reason I would like to know if Breeze support this feature is that I will have some very complex queries to make, some very complex whereclause to build. And figuring it out how to build these queries with their linq-esque language -for the moment - would cost a precious time I do not have. Also I would like to know if Breeze.js can work with WCF because most of the examples I have been looking at these fews days are also exclusively with Web API. (In our project we are already making heavy use of WCF). Thank to the community

http://stackoverflow.com/comment/45013319
type: AnswerComment
score: 0
type: Comment
has text: actually no, I wanted the image to be below the button
comment on: http://stackoverflow.com/a/28333177

http://stackoverflow.com/q/28297283
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28297357
tagged with: jquery
score: 1
favorite count: 0
tagged with: ajax
type: Question
tagged with: fadeout
upvote count: 1
has body: I have created a login system. Login Form submission through AJAX. However the Response show only the first time. ie. Suppose i enter the Wrong credentials first. The response shows. But when I enter new credentials again it doesn't show the response message. Sorry I'm relatively new to JQuery. Gven below is the Jquery code &lt;script type="text/javascript"&gt; $(document).ready(function() { var form = $('#loginform'); form.submit(function (ev) { ev.preventDefault(); $.ajax({ type: form.attr('method'), url: form.attr('action'), cache: false, data: form.serialize(), success: function (data) { if(data == 1){ $("#user-result").html("&lt;font color ='#006600'&gt; Logged in | Redirecting..&lt;/font&gt;"); setTimeout( function() { window.location.replace("index.php"); }, 1000); } else{ $("#user-result").html(data).delay( 2500 ).fadeOut( 800 ); } } }); }); }); &lt;/script&gt; I think it might be the problem with Fadeout. Any Help?
possible better answer: http://stackoverflow.com/a/28297378
has answer: http://stackoverflow.com/a/28297417
has answer: http://stackoverflow.com/a/28297378
has answer: http://stackoverflow.com/a/28297386
has title: Notifications works only First time - AJAX
has answer: http://stackoverflow.com/a/28297357
answer count: 4

http://stackoverflow.com/a/32370840
answers question: http://stackoverflow.com/q/28394572
score: 0
type: Answer
has body: by @manzapanza solution for days: $scope.duration_for = function(seconds){ if(!seconds) return var duration = new Date(1970, 0, 1).setSeconds(seconds) var mask = 'HH:mm' if(seconds &gt;= 86400){ mask = 'd days,' + mask } return $filter('date')(duration, mask); } in view: {{duration_for(100500)}}

http://stackoverflow.com/a/28431334
type: Answer
accepted answer of: http://stackoverflow.com/q/28431036
score: 2
answers question: http://stackoverflow.com/q/28431036
downvote count: 0
has body: The trouble was that you were creating your event handlers each time there was a mouseover. I've split them up to make it simpler, and that seems to have fixed your bug: var toolbar = $(' leave toolbar to element '); toolbar.on('mouseleave',function(e){ toolbar.remove(); }); var enter = function(e) { setTimeout(function(){ toolbar.addClass('widget-over'); },100); $('body').prepend(toolbar); toolbar.css({ left: $el.offset().left, top: $el.offset().top - toolbar.height() - 20 }); }; var leave = function(e){ if ($(e.relatedTarget).closest(toolbar).length) return; toolbar.removeClass('widget-over'); toolbar.remove(); } var $el = $('.el') .on('mouseenter', enter) .on('mouseleave', leave); JSfiddle: http://jsfiddle.net/3r8wrumL/2/
has comment: http://stackoverflow.com/comment/45193246
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/q/28347315
has answer: http://stackoverflow.com/a/28347408
has comment: http://stackoverflow.com/comment/45039126
has answer: http://stackoverflow.com/a/28347575
has comment: http://stackoverflow.com/comment/45038890
has title: Efficient way for parsing JSON
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45039133
has answer: http://stackoverflow.com/a/28347634
has body: Sorry people, a simple question but my concern here is performance implications (javascript): I have a JSON query result: [{'name': 'a'}, {'name': 'b'}] In order to prepare it to another query, I need to manipulate it to the following: ['a', 'b'] What will be the most efficient way of doing so? Is it through native JSON libraries or with simple JSON/string parsing? Thanks
type: Question
accepted answer: http://stackoverflow.com/a/28347575
has comment: http://stackoverflow.com/comment/45038921
has comment: http://stackoverflow.com/comment/45039001
has comment: http://stackoverflow.com/comment/45039060
score: 0
has comment: http://stackoverflow.com/comment/45039147
tagged with: http://stackoverflow.com/tag/json
answer count: 3
possible better answer: http://stackoverflow.com/a/28347408
tagged with: javascript

http://stackoverflow.com/comment/45195381
comment on: http://stackoverflow.com/a/28387526
score: 0
type: Comment
has text: The logic would be the same - Update the css file and create a button to refresh it. @seven-phases-max - You should not be a part of SE because you dont know how to answer a question - (and your aggressive denial of this). I came here to get answer to my question and not to debate with someone like you.
type: AnswerComment

http://stackoverflow.com/q/28426522
tagged with: leaflet
has title: Leaflet - How to show Markers instead of Polylines
downvote count: 0
score: 1
has body: I currently have a set of nicely declared array of latitude/longitude points using javascript and mySQL and when I used this set of arrays to show as polylines it was successful. var polyline= L.polyline(xxx).addTo(map); However when I tired to change to markers, the map did not portrayed any markers. Any help? Much appreciated :)
type: Question
tagged with: javascript
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/28430365
favorite count: 0
tagged with: polyline
type: UnansweredQuestion

http://stackoverflow.com/q/28357682
score: 1
tagged with: css
accepted answer: http://stackoverflow.com/a/28357978
has body: I'm building a "piano-like" music app, where users can click on a certain div (boxes) and it plays a note. I know I could do this by grabbing all the Ids of both the boxes and the audio file, but I think there's an easier and more flexible way. I tried looping through the boxes and grabbing the Ids, but I can't seem to get the names of audio files. I had an idea that I could get the Ids and see if they match the value of the name attribute for the audio and play it that way, but I'm stuck. Here's the sample code: JavaScript: var box1 = document.getElementById('box1'); var box1Note = document.getElementById('box1_sound'); box1.addEventListener('mousedown', function(){ box1Note.currentTime = 0; box1Note.play(); }); var boxName = document.getElementsByClassName('box'); var notes = document.getElementsByName('notes'); for (var j = 0; j < notes.length; j++) { var notesVal = notes[j].name; console.log(notesVal); } for (var i = 0; i < boxName.length; i++) { boxName[i].addEventListener('mousedown', function(){ var boxId = this.id; console.log(boxId); }); } Any help would be awesome, thanks guys!
answer count: 2
upvote count: 1
has title: How to play a certain audio file based on an user's click?
has answer: http://stackoverflow.com/a/28357935
possible better answer: http://stackoverflow.com/a/28357935
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28357978
downvote count: 0
tagged with: javascript
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/44938058
type: Comment
has text: You have to write your own method. There is no direct method available to cater your requirement.
score: 0
comment on: http://stackoverflow.com/q/28292504
type: QuestionComment

http://stackoverflow.com/a/28330508
has body: Try this: var datax = $("#x").val(); var e = JSON.parse(datax); function compare(a,b) { var da = a.birthday.split("/"); da = new Date(da[2], da[0]-1, da[1]); var db = b.birthday.split("/"); db = new Date(db[2], db[0]-1, db[1]); if (da &lt; db) return -1; if (da &gt; db) return 1; return 0; } e.sort(compare); console.log(JSON.stringify(e)); http://jsfiddle.net/cbe6vxgh/8/
type: Answer
answers question: http://stackoverflow.com/q/28330367
has comment: http://stackoverflow.com/comment/45008783
score: 0

http://stackoverflow.com/comment/45027033
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/28340920
has text: Is this is any use? http://stackoverflow.com/q/28129601/334274
type: Comment

http://stackoverflow.com/comment/45062724
type: Comment
has text: Flash objects can expose APIs via javascript, so with cooperation from the Flash object, it is possible to tell it to do things from Javascript, so it's a bit over reaching to say you cannot interact with a Flash object from Javascript.
comment on: http://stackoverflow.com/a/28360038
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45165642
type: Comment
comment on: http://stackoverflow.com/a/28415835
type: AnswerComment
has text: @FrankMiller - you're welcome, and no, it's not that straight forward, one has to count the number of groups based on unique names, or at least something similar to that
score: 0

http://stackoverflow.com/q/28280338
tagged with: logging
tagged with: node.js
has comment: http://stackoverflow.com/comment/44914995
upvote count: 5
has comment: http://stackoverflow.com/comment/44915056
has comment: http://stackoverflow.com/comment/44919049
tagged with: http
has comment: http://stackoverflow.com/comment/44922501
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44922205
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/41374254
has body: I would like to write an express middleware printing HTTP access log in the Common (Access) Log format. The last column in this format is the size of the response body in bytes. How to determine a size of the HTTP response produced by the Node.js server? Example that does not work: app.use(function(req, res, next) { var bytes = 0; res.on('data', function(chunk) { bytes += chunk.length; }); res.on('finish', function() { // `bytes` is the response size console.log(/* common log entry */); }); }); I have done some research, for example Hapi's common-log always emits - as the size. Does it mean it is not possible to obtain the size?
favorite count: 0
type: Question
score: 5
has title: How to get the size of a Node.js writable stream (HTTP server response)

http://stackoverflow.com/q/28411379
tagged with: ember.js
answer count: 1
has body: While writing my first app in Ember.js I I ran into a problem where I wanted to execute an action through calling some API with jQuery. When this call fails, I want the page to be redirected to the error state. I've been trying to get my head around this one. I created an action like this: Contributionkeeper.RepositoriesController = Ember.Controller.extend({ actions: { delete: function(repo) { Ember.$.ajax({ url: '...', success: function(data) { }, error: function() { //TODO: Raise error }); } } }); I want the application to navigate to an error substate. How can I fix this?
has title: Redirecting to error state from action in Ember.js controller
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28412410
type: Question
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28412410

http://stackoverflow.com/q/28411369
has body: How can I get #&lt;name&gt; id, for example like this number 345170787868762112. I got it from following example: http://codepen.io/jasonmayes/pen/Ioype . Maybe it is not #hashtag id, but can anyone explain, what it is then and how could I find it for any kind of #hashtag? Tried to google it, but didn't find any relevant result for that.
tagged with: twitter
type: Question
has answer: http://stackoverflow.com/a/28419221
tagged with: javascript
score: 0
has title: How to get Twitter #hashtag id
answer count: 1
type: UnansweredQuestion

http://stackoverflow.com/comment/45107004
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28384508
type: Comment
has text: What do you see if you `console.log(mink)` in the `eple` handler.

http://stackoverflow.com/q/28364430
has comment: http://stackoverflow.com/comment/45072816
has comment: http://stackoverflow.com/comment/45071430
tagged with: cryptography
has comment: http://stackoverflow.com/comment/45071310
has body: I would like to encrypt some user data before it's sent to the server. That is, the data will be encrypted on the client side in browser using JavaScript. My question is, what options are available for storing private keys on the client side (it will be used for decrypting the data when user views it later on)? HTML5 local storage or just reading local text file containing the key from JavaScript seems a bit off... Is it possible to use personal certificates for this purpose? Or is there any other option? EDIT: Slight clarification, All the sensitive data that needs to be encrypted is generated on the client machine and it should never leave it in plain-text. The data in question is mostly files which user will upload to the server, however we might want to encrypt some form fields as well in the future. Once the encrypted data is sent to server it is stored in ciphered form and will never be decrypted anywhere else other than the same client machine. For example if the user decides to download his files back, he will receive encrypted files which will be decrypted in browser using JavaScript. Also it's crucial for us that the Public-Private key pair is generated on the same client machine. This will be done only once manually by the user or with the help of some automated solution. Bottom line is, private key nor plain-text data should ever leave client's machine.
type: AnsweredQuestion
tagged with: web-applications
upvote count: 7
has comment: http://stackoverflow.com/comment/45073630
type: Question
has title: Best way to store private crypto key in browser?
has answer: http://stackoverflow.com/a/28366628
tagged with: rsa
tagged with: javascript
has comment: http://stackoverflow.com/comment/45070955
has comment: http://stackoverflow.com/comment/45072443
answer count: 1
downvote count: 0
score: 7
has comment: http://stackoverflow.com/comment/45072543
favorite count: 0
has comment: http://stackoverflow.com/comment/45070577
accepted answer: http://stackoverflow.com/a/28366628
tagged with: token

http://stackoverflow.com/q/28296252
has comment: http://stackoverflow.com/comment/44944950
has answer: http://stackoverflow.com/a/28297496
accepted answer: http://stackoverflow.com/a/28297289
score: 6
has comment: http://stackoverflow.com/comment/44944999
tagged with: php
possible better answer: http://stackoverflow.com/a/28297496
has body: I am passing Image base64 data through ajax to my php function, but for large size image Ajax does not post the data. But the same code works perfectly for small images. srcdata=[binary] ` data is too large so partially posted , ajax count = 1; name='test' jQuery.ajax({ url:"/createImage.php", data:{img_data:srcdata,img_id:count,name:name}, type:"POST", contentType:"application/x-www-form-urlencoded", success:function(result) { alert(result); } }); PHP print_r($_POST); // is empty when logging.. When I'm trying to get the post data in php I am getting empty . What could be the reason for ajax not sending the data when base64 is used.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44944959
type: Question
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/28297289
tagged with: javascript
tagged with: base64
tagged with: jquery
has comment: http://stackoverflow.com/comment/44945703
has comment: http://stackoverflow.com/comment/44944929
tagged with: ajax
has title: Ajax not post base64 data of large image
upvote count: 6
favorite count: 0

http://stackoverflow.com/comment/44970575
comment on: http://stackoverflow.com/q/28309706
score: 1
has text: Seems odd, it certainly should work in models.js, assuming you're still running it in node and not the browser. Browsers don't have a `require` method built-in, hence the usage of concatenation build processes.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28417333
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: variable "i" always be "10" because of timeout will be called after for loop. so you get always integers because of you devide it to 10 Do this for your own good :) for(var i=0;i&lt;10;i=i+1){ console.log("before timeout" + i/10); setTimeout(function(i){ console.log("after timeout" + i/10); },1000, i); }
score: 3
answers question: http://stackoverflow.com/q/28417282
accepted answer of: http://stackoverflow.com/q/28417282
upvote count: 3

http://stackoverflow.com/comment/44946784
type: Comment
type: QuestionComment
has text: It's run through Rails. The only thing that will change by rendering is that the Id of the respective tag will be shown instead of <%=(@tag.id)%>. This part should be right though.
comment on: http://stackoverflow.com/q/28297178
score: 0

http://stackoverflow.com/comment/45092207
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28375676
has text: @KazekageGaara considering you are using bootstrap, why have you decided to use a table instead of the BootStrap Grid (which would allow you to use animations on a `.row`?
type: QuestionComment

http://stackoverflow.com/comment/45324078
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28423190
has text: @StephenMuecke you mean to inspect the html for the partial view ? i did not get ur point sorry...
score: 0

http://stackoverflow.com/comment/45118025
score: 2
comment on: http://stackoverflow.com/q/28390319
type: Comment
type: QuestionComment
has text: what is `control.log`? do you mean `console.log` ?

http://stackoverflow.com/comment/102059014
comment on: http://stackoverflow.com/a/45409613
type: AnswerComment
type: Comment
has text: all three parameters are zero for images in latest firefox if the image is on a sub-domain (most of the cases it is so), so pretty much useless sadly
score: 3

http://stackoverflow.com/q/28433362
type: Question
has comment: http://stackoverflow.com/comment/45197364
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28433983
has comment: http://stackoverflow.com/comment/45197832
tagged with: parsing
has comment: http://stackoverflow.com/comment/45197196
has body: I'm trying to parse a string to a chars array, surrounding each char with . the function to commit the parse works and each char is surround with the tag. function to parse: app.controller('tableCtrl',function($scope,$sce) { //parse cron_format and edit each digit individually $scope.parse = function (cron_format){ var parsed = cron_format.split(" "); for(var i = 0; i < parsed.length; i++) { parsed[i] = '' + parsed[i] + ''; } $scope.parsedCron = $sce.trustAsHtml(parsed.toString()); return $scope.parsedCron; } }); what I'm getting in the its this string: */3,*,*,*,* why won't the render? here is the table where im trying to add the result: {{user(user_id)}} {{script(script_id)}} ** {{parse(cron_format)}} **
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45196947
tagged with: http://stackoverflow.com/tag/html
has title: rendering string using $sce.trustAsHtml returns undefined
has comment: http://stackoverflow.com/comment/45197620
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28433983
has comment: http://stackoverflow.com/comment/45197512
has comment: http://stackoverflow.com/comment/45197468

http://stackoverflow.com/comment/44970069
score: 0
has text: "Will be much slower loading and executing than the equalivent:" not so much on the execution...execution will stay the same no matter if you're using 3000 character variables or 1 character. Also not MUCH slower on the loading either...
type: Comment
comment on: http://stackoverflow.com/a/28309465
type: AnswerComment

http://stackoverflow.com/a/28330067
score: 1
upvote count: 1
downvote count: 0
type: AcceptedAnswer
type: Answer
has body: Basically, it takes a directive to approach your goal Take a look at the plunker I wrote for you. As you can see, in the list of selected tags the text property of each tag is displayed, it means that the object structure is kept. In your case, you would bind the $scope.question.tags array as the collection attribute and each tag from the $scope.tags as the element attribute.
accepted answer of: http://stackoverflow.com/q/28329332
answers question: http://stackoverflow.com/q/28329332

http://stackoverflow.com/comment/45083888
comment on: http://stackoverflow.com/q/28371657
type: Comment
type: QuestionComment
score: 1
has text: Read up about localStorage or cookies.

http://stackoverflow.com/a/28410401
has body: Simply add the second function inside the first; in the case below I've automatically called it too. $(document).ready(function(){ $('button').click(function(){ // first thing console.log('click'); (function(){ // second thing console.log('callback'); })(); }); });
answers question: http://stackoverflow.com/q/28410286
type: Answer
score: 0

http://stackoverflow.com/comment/45146662
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28406098
has text: @Cerbrus same code is for different dropdown id
score: 0

http://stackoverflow.com/q/28404948
type: Question
tagged with: javascript
has body: I am building a Phonegap Application and for client side MVC I am using Backbone. My App is using camera for clicking images then it uploads that images to the server. However Phonegap provides us an option to upload images to server using FileTransfer() but since I am already using Backbone thats why I needs something integrated with Backbone. So that I can easily upload it just using the save method and utilize the already build Backbone.sync feature.
tagged with: android
favorite count: 0
has comment: http://stackoverflow.com/comment/45156473
tagged with: backbone.js
tagged with: cordova
answer count: 0
upvote count: 2
type: UnansweredQuestion
has title: Phonegap: Uploading an image to server using backbone
downvote count: 1
score: 1

http://stackoverflow.com/q/28411799
has title: Javascript arraybuffer to file in Django
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45157056
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45159773
tagged with: django
has comment: http://stackoverflow.com/comment/45187637
has comment: http://stackoverflow.com/comment/45161822
has comment: http://stackoverflow.com/comment/45162880
answer count: 0
score: 0
tagged with: arraybuffer
has body: people! I have tried to send via HTTP POST (using AngularJS) the content of a file (images to be more precise) converted in ArrayBuffer (UInt8) to a Django server but I cannot manage to save it correctly in file on the server. Javascript code: filesToUpload = document.getElementById('files') var files = filesToUpload.files; for(var i = 0; i &lt; files.length; i++) { var reader = new FileReader(); reader.onload = (function(fileToBeUploaded) { return function(e) { var fileContent = e.target.result; var bin = new Uint8Array(fileContent); console.log(bin); var request = $http({ url: urlAddImagesRestaurant, method: "post", data: { fileStructure: fileToBeUploaded, datafile: bin } }); return request.then( service.handleSuccess, service.handleError ); }; })(files[i]); reader.readAsArrayBuffer(files[i]); } } Has someone any idea how to save the content of the arraybuffer in django?
type: Question
has comment: http://stackoverflow.com/comment/45162366
tagged with: javascript

http://stackoverflow.com/q/28304189
has answer: http://stackoverflow.com/a/28308185
has comment: http://stackoverflow.com/comment/44966034
tagged with: javascript
has comment: http://stackoverflow.com/comment/44964972
score: 0
has title: How to link to HTML page with a table with a button and have it input data from Firebase using AngularJS
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44967150
has comment: http://stackoverflow.com/comment/44964079
has comment: http://stackoverflow.com/comment/44963926
has comment: http://stackoverflow.com/comment/44959654
has body: I have an AngularJS app I am creating. On the main page is a table with each row containing information. In each row there is a button "View More" that links to a new page with a standard table. Is there a way to make each View More button link to that view but fill in the table with different data related to each row from the main page.
type: Question

http://stackoverflow.com/comment/44930552
score: 0
comment on: http://stackoverflow.com/a/28288362
type: Comment
has text: Don't guess desired behavior in answers, the author has stated his code works for him the way he wants it to.
type: AnswerComment

http://stackoverflow.com/a/38876024
type: Answer
score: 0
has body: Cast it to an HTMLInputElement before calling the .files property, like so: (&lt;HTMLInputElement&gt;$('#file0')[0]).files[0].size
answers question: http://stackoverflow.com/q/28344089

http://stackoverflow.com/q/28305205
favorite count: 0
tagged with: d3.js
has answer: http://stackoverflow.com/a/28306974
has title: How to add Label to each state in d3.js (albersUsa)?
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28306974
tagged with: http://stackoverflow.com/tag/json
tagged with: dom
type: Question
score: 9
upvote count: 9
has body: The us.json loaded, but when i try to add Label name i can't make it work. I don't see the name property in .json file so how can i add each state name? I'm really new to this framework. I try different Tutorial on Google and Stackoverflow, but none of them work for me. Here is the link to couple tutorial i tried, that i think is worthy. Add names of the states to a map in d3.js State/County names in TopoJSON or go back GeoJSON? The concerns I have: I think I'm missing name property in us.json file. (if that's the issue, is there any other .json file that includes state name? And how to use the state name with that file?) Is the US state name included in http://d3js.org/topojson.v1.min.js? .html File (Framework Loaded) &lt;script src="http://d3js.org/d3.v3.min.js" charset="utf-8"&gt;&lt;/script&gt; &lt;script src="http://d3js.org/topojson.v1.min.js"&gt;&lt;/script&gt; .js File: var width = 1500, height = 1100, centered; var usData = ["json/us.json"]; var usDataText = ["json/us-states.json"]; var projection = d3.geo.albersUsa() .scale(2000) .translate([760, height / 2]); var path = d3.geo.path() .projection(projection); var svg = d3.select("body").append("svg") .style("width", "100%") .style("height", "100%"); svg.append("rect") .attr("class", "background") .attr("width", width) .attr("height", height) .on("click", clicked); var g = svg.append("g"); d3.json(usData, function(unitedState) { g.append("g") .attr("class", "states-bundle") .selectAll("path") .data(topojson.feature(unitedState, unitedState.objects.states).features) .enter() .append("path") .attr("d", path) .attr("class", "states") .on("click", clicked); }); Thank you everyone in advanced. I also appreciate if you tell me where did you learn d3.js.
tagged with: javascript
linked to: http://stackoverflow.com/q/13897534
answer count: 1
downvote count: 0

http://stackoverflow.com/a/28350144
type: Answer
answers question: http://stackoverflow.com/q/28349700
downvote count: 0
score: 1
has body: You don't need the flag, just make a recursive function. I changed the time to 300 milliseconds so you can see it easier http://jsfiddle.net/zfbptz9c/ $("#startButton").click(function () { startGame(); }); function startGame() { $("#shape").fadeIn(300, function () { $("#shape").fadeOut(300, function () { startGame(); }); }); } The div will fade in and on complete of the fade in, it will fade out then call the startGame function again and the entire process will repeat infinitely. Alternatively, this can be achieved with css only if you only need to target modern browsers. I will put this fiddle link here, it is from a different question. I won't paste the code since you did not tag the question with css but the fiddle shows everything. I take no credit for it. How can I create a looping fade-in/out image effect using CSS 3 transitions? http://jsfiddle.net/FTLJA/261/
upvote count: 1

http://stackoverflow.com/q/28310185
has comment: http://stackoverflow.com/comment/44971357
tagged with: uploader
upvote count: 0
has answer: http://stackoverflow.com/a/28310274
answer count: 1
has body: I am creating a asp.net MVC web application where i need to implement a artwork file uploader control. What is best AJAX driven file uploader library that is best fit for MVC architecture ? jQuery &amp; Bootstrap are in place already.
favorite count: 0
accepted answer: http://stackoverflow.com/a/28310274
downvote count: 8
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45479739
tagged with: file
has title: Which is best javascript file uploader?
type: Question
has comment: http://stackoverflow.com/comment/44971559
tagged with: javascript
has comment: http://stackoverflow.com/comment/44971516
score: -8

http://stackoverflow.com/a/28371468
type: Answer
has body: Your url rule should be url(r'^articles/search/', 'article.views.search_titles'), not url(r'^search/', 'article.views.search_titles'), You need to append "articles" in order to match your url ajax call "/articles/search/"
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/28371402
upvote count: 2
has comment: http://stackoverflow.com/comment/45083608

http://stackoverflow.com/a/29729706
answers question: http://stackoverflow.com/q/28391227
score: 1
upvote count: 1
downvote count: 0
has body: PHP is very strongly orientated towards creating web pages from a template, while Node.js is lower-level and broader in scope. A very rough overview of the differences between PHP and Node.js: In PHP, you'd start a web server (almost certainly Apache), and then put a PHP file in a directory where you want to serve something from. You might use some fancy .htaccess directives to make URLs nicer, etc. In Node.js you create a script, in which you use the http module to start a web server, and then you supply a callback for whenever a request is made to your server. Deciding which page to respond to the request with, etc, is all your work to do. In PHP, things like routing a request to a particular PHP file, compression, decoding POST and GET variables, are all done by using Apache - your PHP files are sort of just like templates which Apache runs whenever a request is received. In Node.js, everything, from starting the server to sending HTML, is all done within your Node.js script - you have to do everything. HTML isn't the first class citizen in Node.js that it is PHP. Generally, in Node.js you are just sending strings to the client. There are plenty of third party templating tools for Node.js - but they will be dependencies, not builtin functions.
type: Answer

http://stackoverflow.com/comment/44997402
type: Comment
comment on: http://stackoverflow.com/a/28324758
has text: `socket` object is unique for each client that connects. If you make it global then the global object will only refer to the `socket` object of the ***latest*** client that connected. Surely you don't want that.
type: AnswerComment
score: 0

http://stackoverflow.com/q/28312559
has comment: http://stackoverflow.com/comment/44975705
upvote count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28312729
has answer: http://stackoverflow.com/a/28330812
has title: get Y value of quadratic curve given the max height of the curve
type: Question
score: -2
tagged with: math
has body: When Y is 100 the maximum height of the curve will be (+/-) 60. I need a way to calculate Y when I have the maximum height of the curve. Code: point1 and point2 have x, y and z coordinates this.drawLine = function(point1, point2) { context = this.getContext(); context.beginPath(); context.moveTo(this.getX(point1), this.getY(point1)); point3 = { x: ( point1.x + point2.x ) / 2, y: ( point1.y + point2.y ) / 2, z: ( point1.z + point2.z ) / 2 } context.quadraticCurveTo( this.getX(point3), this.getY(point3) + point3.z * 0, this.getX(point2), this.getY(point2)); context.stroke(); } I need the line of the curve to hit the coordinates of point3 instead of it not reaching the coordinates.
answer count: 2
downvote count: 2
tagged with: javascript
favorite count: 0

http://stackoverflow.com/a/28393255
score: 1
answers question: http://stackoverflow.com/q/28392538
has comment: http://stackoverflow.com/comment/45124246
has body: The simplest way to go is maybe this css rule: a { text-decoration:none; color:red; } span { color:black; cursor:default; } and a short inline js onclick event where you don't want the event propagated: Word2 jsFiddle example But don't do that in production. It's pointless and ugly. If you want the second link inside the first one, for the sake of simplicity, i would do this: Word2 updated jsFiddle Here you go then new fiddle with visual hint
upvote count: 1
has comment: http://stackoverflow.com/comment/45123679
has comment: http://stackoverflow.com/comment/45123763
has comment: http://stackoverflow.com/comment/45123649
type: Answer
has comment: http://stackoverflow.com/comment/45124796
downvote count: 0

http://stackoverflow.com/q/28404439
has body: Web browsers fail to capture windows key shortcut. For instance, Windows key + D displays the desktop. However, in the browser, JS could only detect the keydown event of the Windows key, but is not able to capture the keyboard event of D or the keyup event of the windows key. What's the deep reason behind it? Is there any document explaining it?
answer count: 2
tagged with: keypress
tagged with: javascript
favorite count: 0
linked to: http://stackoverflow.com/q/301053
tagged with: windows-key
has answer: http://stackoverflow.com/a/28404846
has comment: http://stackoverflow.com/comment/45143395
has answer: http://stackoverflow.com/a/31668198
has comment: http://stackoverflow.com/comment/45143339
upvote count: 2
type: UnansweredQuestion
downvote count: 1
has comment: http://stackoverflow.com/comment/79086865
score: 1
linked to: http://stackoverflow.com/q/5203407
has title: Web browser is not able to capture Windows key + D, why?
type: Question
tagged with: browser

http://stackoverflow.com/a/28398942
has comment: http://stackoverflow.com/comment/45133783
score: 0
has comment: http://stackoverflow.com/comment/45133727
type: Answer
has comment: http://stackoverflow.com/comment/45133561
has body: Although jQuery might be forgiving enough to handle it, the documented format is: var input = $("#profile-edit-form").find('input[name="file"]'); Note the quotes around "file" in the selector.
answers question: http://stackoverflow.com/q/28398770

http://stackoverflow.com/comment/44945009
score: 0
comment on: http://stackoverflow.com/q/28296007
type: QuestionComment
has text: i dont realy understand what u mean/want or how it will help, sorry. If you please could explain yourself?
type: Comment

http://stackoverflow.com/comment/44934543
score: 0
comment on: http://stackoverflow.com/q/28290422
has text: @TZHX what do you mean by this, sorry for my ignorance and thanks for the response
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28302636
answer count: 1
downvote count: 1
has title: Non-jumping parallax with IE11 - but how?
has body: On my website, I experience - and a lot of others do on theirs - a kind of jumping/lagging effect with Internet Explorer 11 (on a Windows 8.1 machine) when creating a parallax. On Firefox for example it is working absolutely fine. According to my research, this is a common problem with IE11 that has no solution, but I have found a website that somehow fixed the issue (or made a Workaround?!?) : http://focuslabllc.com/journal But my website has the same issue as this one: http://negativespacealphabet.com/ What are they doing differently to get it work? I appreciate your help!
tagged with: internet-explorer-11
score: 8
upvote count: 9
has comment: http://stackoverflow.com/comment/44957058
has comment: http://stackoverflow.com/comment/44957043
has answer: http://stackoverflow.com/a/36428667
tagged with: javascript
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
tagged with: parallax
favorite count: 0
has comment: http://stackoverflow.com/comment/44957602
type: Question
accepted answer: http://stackoverflow.com/a/36428667
has comment: http://stackoverflow.com/comment/49521036
has comment: http://stackoverflow.com/comment/49520869

http://stackoverflow.com/comment/44946179
has text: Create a function instead, taking parameters and operators to use them. It might even use sandboxed `eval` inside, after making sure the params are valid.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28296878

http://stackoverflow.com/q/28349534
has comment: http://stackoverflow.com/comment/45045867
has body: I am having a strange problem. My javascript function appears to be working fine, when I alert("1"+res) it gives me the desired results but I am trying to set a checkbox with the boolean it returns and it just will not work. I must be missing something stupid, here is my code first the javascript function: function GetDisplayImages() { if (localStorage.DisplayImages) { var name = "DisplayImages="; var ca = document.cookie.split(';'); for (var i = 0, len = ca.length; i &lt; len; i++) { var c = ca[i].trim(); if (c.indexOf(name) == 0) { var res = c.substring(name.length, c.length); // resetting, just in case local storage not in sync. self.SetDisplayImages(res); if (self.Debug) { toastr.info(res, "Returning Display Images setting from Cookie", { timeOut: 0, extendedTimeOut: 0 }); } alert("1"+res); return res; } } } } As mentioned the alert("1"+res) displays the desired value. I can't seem to get that value from the .cshtml file I call the function from though. Here is that code there: chk.onload = function (e) { alert("2"+Library.settings.GetDisplayImages()); this.value = Library.settings.GetDisplayImages(); } The alert(Library.settings.GetDisplayImages()); doesn't even popup but I know the function is being called, because the alert in the javascript function does show up. Please help me so I can stop bashing my head against my desk! :) There are actually 2 errors and here they are: Here is my whole script section: @section scripts{ &lt;script type="text/javascript"&gt; $(document).ready(function () { chk = document.getElementById("chkDisplayImages"); chk.onload = function (e) { alert(Library.settings.GetDisplayImages()); this.value = Library.settings.GetDisplayImages(); } chk.onchange = function (e) { Library.settings.SetDisplayImages(this.checked); } }); &lt;/script&gt; } The SetDisplayImages() works perfectly for some reason.
has comment: http://stackoverflow.com/comment/45043415
has comment: http://stackoverflow.com/comment/45043451
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28352799
tagged with: cookies
type: Question
tagged with: javascript
has title: Javascript Function Not Returning Value to CSHTML
accepted answer: http://stackoverflow.com/a/28352799
has comment: http://stackoverflow.com/comment/45043140
score: 0
has comment: http://stackoverflow.com/comment/45047343
has comment: http://stackoverflow.com/comment/45043627
has comment: http://stackoverflow.com/comment/45043336
answer count: 1

http://stackoverflow.com/comment/45051721
has text: Or should the response be in json format here?
score: 0
comment on: http://stackoverflow.com/q/28353996
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28394045
tagged with: mathematical-typesetting
has answer: http://stackoverflow.com/a/45351480
has body: I've been working on the development of mobile app that typesets the mathematical application, but I'm facing a problem. The code is OK as per the rules but the expression doesn't change. Not typesetting is taking place. This is my MainActivity code, kindly tell me where's the loophole: public class MainActivity extends Activity implements View.OnClickListener { private String doubleEscapeTeX(String s) { String t=""; for (int i=0; i &lt; s.length(); i++) { if (s.charAt(i) == '\'') t += '\\'; if (s.charAt(i) != '\n') t += s.charAt(i); if (s.charAt(i) == '\\') t += "\\"; } return t; } public void onClick(View v) { if (v == findViewById(R.id.button2)) { WebView w = (WebView) findViewById(R.id.webview); EditText e = (EditText) findViewById(R.id.edit); w.loadUrl("javascript:document.getElementById('math').innerHTML='\\\\[" +doubleEscapeTeX(e.getText().toString())+"\\\\]';"); w.loadUrl("javascript:MathJax.Hub.Queue(['Typeset',MathJax.Hub]);"); } else if (v == findViewById(R.id.button3)) { WebView w = (WebView) findViewById(R.id.webview); EditText e = (EditText) findViewById(R.id.edit); e.setText(""); w.loadUrl("javascript:document.getElementById('math').innerHTML='';"); w.loadUrl("javascript:MathJax.Hub.Queue(['Typeset',MathJax.Hub]);"); } } /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); WebView w = (WebView) findViewById(R.id.webview); w.getSettings().setJavaScriptEnabled(true); w.getSettings().setBuiltInZoomControls(true); w.loadDataWithBaseURL("http://bar", "&lt;script type='text/x-mathjax-config'&gt;" +"MathJax.Hub.Config({ " +"showMathMenu: false, " +"jax: ['input/TeX','output/HTML-CSS'], " +"extensions: ['tex2jax.js'], " +"TeX: { extensions: ['AMSmath.js','AMSsymbols.js'," +"'noErrors.js','noUndefined.js'] } " +"});&lt;/script&gt;" +"&lt;script type='text/javascript' " +"src='file:///android_asset/MathJax/MathJax.js'" +"&gt;&lt;/script&gt…
has title: Develop a offline MathJax Android Mobile App
has comment: http://stackoverflow.com/comment/46604331
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: android
has answer: http://stackoverflow.com/a/32669111
score: 1
linked to: http://stackoverflow.com/q/17029780
type: UnansweredQuestion
tagged with: webview
upvote count: 1
tagged with: mathjax

http://stackoverflow.com/comment/44936104
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28291200
score: 0
has text: @DanHeberden I'm not going to learn the syntax of a new language because a friend asks for help every four years. I figured this was an easy question -- or something -- that was just a matter of something silly happening. I always appreciate tips, though. Thanks.

http://stackoverflow.com/q/28283481
has comment: http://stackoverflow.com/comment/44923312
favorite count: 0
tagged with: cordova
tagged with: angularjs
tagged with: android
score: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28284777
has title: How to check android app first run - Cordova
downvote count: 1
accepted answer: http://stackoverflow.com/a/28284777
type: Question
has body: I am using cordova for my android application. I have lots of pages, and my main or homepage is the index.html. How can I check if it's the first time the user to land to the homepage from opening the app (regardless of how many times he clicked and open the app on different time). I just want to check if it is the first time he access the index.html after he opened the app since he can navigate back to homepage anytime from other pages. I'm using cordova and angularjs
has comment: http://stackoverflow.com/comment/44922772
upvote count: 5
tagged with: javascript
answer count: 1

http://stackoverflow.com/comment/45126593
comment on: http://stackoverflow.com/a/28394912
type: AnswerComment
score: 0
type: Comment
has text: it's working thnx, but why it didn't work with class selector?

http://stackoverflow.com/comment/45061350
score: 0
comment on: http://stackoverflow.com/q/28359262
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28354433
type: Answer
has body: According to your HTML: &lt;input type='text' id='rank_1' value='4' class='ranky'&gt; You have a problem with this line: abovecnt = $original.find('.ranky input[type="text"]').val(); Which should be: abovecnt = $original.find('input[type="text"].ranky').val(); // As "id" attribute have to be unique, even better using this: abovecnt = $('#rank_1').val(); Why is that? Using .ranky input[type="text"] (note the space between ranky and input) means, that you're looking for an input type="text" which is inside an element with ranky class (which is not). Using input[type="text"].ranky you refer to input field with ranky class - as should be. Althought the rest of your code works correctly, you should NOT use the same id attribute for more than one element. id-selector have to be unique. I would also suggest you to not use custom attributes like cnt. There's a data attribute to store arbitrary data associated with the matched elements. Eg: &lt;a href='#' class='change-rank' data-direction='down' data-cnt=4&gt; And then access it using jQuery's data() method: var cnt = $(this).data('cnt');
accepted answer of: http://stackoverflow.com/q/28354373
has comment: http://stackoverflow.com/comment/45081095
score: 0
answers question: http://stackoverflow.com/q/28354373
type: AcceptedAnswer

http://stackoverflow.com/comment/44925913
has text: var_dump the $_POST array to see exactly what your PHP script is getting
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28285561
score: 0

http://stackoverflow.com/comment/45156992
type: QuestionComment
comment on: http://stackoverflow.com/q/28411653
score: 0
has text: See my update please . How to change it even if there is no value yet ?
type: Comment

http://stackoverflow.com/comment/45928285
score: 0
type: Comment
has text: @richie - can the frequencies be different that you get back from the scenario call be different for both endpoints? If not - things will be pretty simple - else we need to rewrite things a bit more since I think we then need to branch the promise chain. - Also: will they 'sync' after execution, that is: will the fastest then wait on the slowest to get a new scenario - or will it continue to get a new one immediately?
comment on: http://stackoverflow.com/a/28465401
type: AnswerComment

http://stackoverflow.com/q/28393824
favorite count: 0
has answer: http://stackoverflow.com/a/28393975
type: UnansweredQuestion
upvote count: 1
has body: I have written following code to find out palindrome number/string. Enter String: Check it However, it is giving the o/p of else statement even i am entering palindrome string in the box.. I don;t think there is something wrong. please correct the code and explain what was wrong. Thank you, sameer
duplicate of: http://stackoverflow.com/q/958908
score: 1
has title: Cant able to find out the palindrome string/number
has answer: http://stackoverflow.com/a/28393953
has answer: http://stackoverflow.com/a/28393901
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/958908
has answer: http://stackoverflow.com/a/28393926
has comment: http://stackoverflow.com/comment/45124278
has comment: http://stackoverflow.com/comment/45124226
answer count: 4

http://stackoverflow.com/comment/45037670
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28313031
has text: I took a look at the codepen, but your dropbox video throws a "Failed to load resource: net::ERR_CONNECTION_REFUSED" error in the chrome console. Can you use a link that does not require authentication?
score: 0

http://stackoverflow.com/q/28310862
upvote count: 3
has answer: http://stackoverflow.com/a/28311090
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: angularjs
type: AnsweredQuestion
downvote count: 0
tagged with: angularjs-controller
has title: Using controllerAs syntax in Angular, how can I watch a variable?
has body: With standard controller syntax in AngularJS, you can watch a variable like: $scope.$watch(somethingToWatch, function() { alert('It changed!'); }); Using the controllerAs syntax, I want to react to this change in an active controller. What's the easiest way to do this? More detail, if it helps. I have one controller in a side pane that controls the context of the application (user selection, start time, end time, etc.). So, if the user changes to a different context, the main view should react and update. I'm storing the context values in a factory and each controller is injecting that factory.
type: Question
score: 3
accepted answer: http://stackoverflow.com/a/28311090

http://stackoverflow.com/a/28425241
type: Answer
downvote count: 1
answers question: http://stackoverflow.com/q/28303587
score: -1
upvote count: 0
has body: Take a look at Instruments User Guide. Basically you should use accessibilityIdentifier property.

http://stackoverflow.com/comment/45134839
comment on: http://stackoverflow.com/a/28380886
type: AnswerComment
score: 0
type: Comment
has text: ---And--- function allowDrop(ev) { ev.preventDefault(); } function drag(ev) { ev.dataTransfer.setData("text", ev.target.id); } function drop(ev) { var data = ev.dataTransfer.getData("text"); document.getElementById("divDrop").addEventListener("drop", drop, false); }

http://stackoverflow.com/comment/45039001
comment on: http://stackoverflow.com/q/28347315
score: 0
type: Comment
type: QuestionComment
has text: Do you actually have a string, or a JavaScript object? Your first string is not valid JSON, as noted above. You should modify whatever service is providing the result to provide valid JSON instead of "almost-JSON".

http://stackoverflow.com/comment/44915733
has text: That is of no help... is your "datepicker" javascript function part of a library or a plugin? Do you have the support pages for the function?
comment on: http://stackoverflow.com/q/28280713
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44954494
score: 0
type: AnswerComment
has text: @Karl-AndréGagnon oh ok, now it's clear. I was not aware of the namespaces in jqm. thank you! I think you (or the answer owner) should edit the answer adding your explaination to make it more complete.
comment on: http://stackoverflow.com/a/28301398
type: Comment

http://stackoverflow.com/comment/45084106
has text: Any errors in your browser's JavaScript console? Where does `name`, the first argument you're passing to `element(name, hotel.name)` come from? What is `idd` supposed to be inside that function?
score: 0
comment on: http://stackoverflow.com/q/28371814
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28393063
has body: Despite the answers here, some comments are very clear. The thing you want is not possible. You can set a variable to the return of a function, but I won't be saved anywhere. The reference is immediately lost. var myvar = { f: function() { var x = 'something'; return x; } } document.write(myvar.f()); This will return x from the method f inside the object myvar. The object returned is a string. In your original code x isn't event defined as something. Since everything in JavaScript is an object, you can assign a property x to the result if it's defined, BUT that is not the case here: var myvar = { f: function() { var x; return x; } } var a = myvar.f(); document.write(a + "&lt;br /&gt;"); document.write(Object.prototype.toString.call(a) + "&lt;br /&gt;"); //returns [object Undefined] So you're attaching a property to a undefined which never gets set. To be able to set x you need to make it a property of the function myvar. Setting it to the method will only work if you don't invoke the method. Invoking the method causes it to return the variable that is not bound to the method object itself.
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28392726
upvote count: 1

http://stackoverflow.com/comment/45034371
type: AnswerComment
comment on: http://stackoverflow.com/a/28333569
type: Comment
has text: Interesting, I've tried using the audio tag but I always get 15-30s worth of buffering before playback.
score: 0

http://stackoverflow.com/comment/45050677
comment on: http://stackoverflow.com/q/28352767
score: 0
type: Comment
type: QuestionComment
has text: oke thank you nice solution if you have the data in that stucture !

http://stackoverflow.com/comment/44916741
score: 0
comment on: http://stackoverflow.com/q/28280895
type: Comment
type: QuestionComment
has text: time stored in millis always preferred as it is more general and basic

http://stackoverflow.com/comment/44967728
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28294309
type: AnswerComment
has text: thanks for your effort, for whatever reason I can seem to get the playlist to be selected. Unfortunately the UI for the site I am trying to modify is rather complex. I'm guessing I'll have to ask some other questions to figure out what I need to do to get it to work

http://stackoverflow.com/comment/63344923
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28439671
has text: `$timeout(() => { $timeout(() => { var height = element.children(':first').outerHeight(); //find the height of the first item output by ng-repeat }, 0, false); }, 0, true);`

http://stackoverflow.com/q/28436647
possible better answer: http://stackoverflow.com/a/28436708
type: Question
has answer: http://stackoverflow.com/a/28436708
score: 0
has title: How do I take input value and append it to new element?
has body: This is what I want to do: On click of button, create a "p" element, give it an id, append it to parent div, then take the value of the input field and append that to the "innerHTML" of the newly created "p" element. Please help! html: TITLE Create a username: button js: $('#usr_btn').on('click', function (e) { if ($('#input1').val() != null) { e.preventDefault(); var userName = document.createElement('p'); userName.id = 'name_created'; $('#name_created').append($('#content_container')); $('#name_created').append($('#input1').val()); } });
tagged with: createelement
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45203789
has answer: http://stackoverflow.com/a/28436733
answer count: 3
has comment: http://stackoverflow.com/comment/45203925
tagged with: http://stackoverflow.com/tag/html
tagged with: append
accepted answer: http://stackoverflow.com/a/28436733
has comment: http://stackoverflow.com/comment/45203613
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28436732

http://stackoverflow.com/comment/45205367
type: Comment
comment on: http://stackoverflow.com/a/28436750
has text: well you writed in your code that the function is called onclick of an link element () so you have to click on your link to call the method addFields Look the jsfiddle i linked above, and look on the internet about "link in html" and "onclick"
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45055901
type: AnswerComment
comment on: http://stackoverflow.com/a/28356097
type: Comment
score: 1
has text: Oh okay, have you looked into browser resets, like eric mayers reset.css or normalize.css?

http://stackoverflow.com/comment/45200499
comment on: http://stackoverflow.com/q/28435078
type: QuestionComment
has text: You shouldn't need to handle OnClientClick here. Why are you doing this?
score: 0
type: Comment

http://stackoverflow.com/a/28313520
has comment: http://stackoverflow.com/comment/44977092
score: 0
has body: First set your header to fixed and 100%, possibly add z-index. Then you will need the following CSS .header{ position:fixed; width:100%; height:100px; z-index:9999; //only if you need the header on top of everything } .header.shorty{ height:50px; } Then we can add the shorty call once the page has scrolled. $(window).scroll(function(){ if($(window).scrollTop() &gt; 100){ $(".header").addClass("shorty"); }else{ $(".header").removeClass("shorty"); } });
type: Answer
answers question: http://stackoverflow.com/q/28313310

http://stackoverflow.com/q/28304581
has body: I'm writing a JavaScript Library that offers the function tablify(anything);, which is able to represent any Array or Object as an HTML Table. Now I'm trying to extend the Array and Object prototypes in order to use it like this: var arr = ["a", "b", "c"]; var obj = {"A": "a", "B": "b", "C": "c"}; arr.tablify(); obj.tablify(); This is my approach: Array.prototype.tablify = function() { return tablify(this); } Object.defineProperty(Object.prototype, 'tablify', { value: function () { return tablify(this); }, writable: true, configurable: true, enumerable: false }); The issue is, that everything in JavaScript is an Object and therefore not only literals like {a: 1, b: 2} can be converted, but also everything else. This wouldn't be such a big deal since my tablify() can also deal with primitive types, but when I extend Object.prototype, typeof anything always returns "object" and I can't distinguish between types anymore: function tablify(object) { if (object instanceof Array) { return ArrayToTable(object); } //This is always true if I extend Object.prototype: if (typeof object === "object") { //only for "normal" objects like "{a: 1, b: 2, c: [],...}" return ObjectToTable(object); } return PrimitiveToTable(object); //strings, numbers, functions, ... } Why is typeof always returning "object"? Is it a good thing for a JS-API to provide this sort of functionality (extending Arrays/Objects with ".tablify();")? How is it possible to distinguish between "normal" objects, numbers, functions,... ? Is it possible to only extend "normal" objects? (forbid (42).tablify();, "string".tablify(); ...) Whats the name for those "normal" objects? How should I call them?
has comment: http://stackoverflow.com/comment/44960293
upvote count: 1
linked to: http://stackoverflow.com/q/14034180
tagged with: prototype-programming
possible better answer: http://stackoverflow.com/a/28304724
has comment: http://stackoverflow.com/comment/44960399
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/44960833
accepted answer: http://stackoverflow.com/a/28305414
has title: How to extend Obect.prototype correctly?
type: Question
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/44960340
has comment: http://stackoverflow.com/comment/44960479
tagged with: javascript
has comment: http://stackoverflow.com/comment/44960630
has answer: http://stackoverflow.com/a/28305414
has answer: http://stackoverflow.com/a/28304724
favorite count: 0
linked to: http://stackoverflow.com/q/13296340

http://stackoverflow.com/comment/45038288
score: 0
type: Comment
has text: It says in the specs that _If the String does not conform to that format the function may fall back to any implementation-specific heuristics or implementation-specific date formats._ So yes, a particular date format might work in one browser but not in another.
comment on: http://stackoverflow.com/a/28343471
type: AnswerComment

http://stackoverflow.com/comment/45202731
type: QuestionComment
has text: Since others are working on the answer, I'll throw out the obligatory comment that this is a really bad way to display data. Everything about the set up works to obfuscate the information rather than making sense of it. It's hard to say what the best solution is without knowing the full purpose of your display, but it almost assuredly involves two separate charts instead of cramming everything into one. FWIW
score: 1
comment on: http://stackoverflow.com/q/28426562
type: Comment

http://stackoverflow.com/comment/44929816
score: 0
has text: Seems correct to me at first glance. Perhaps the reference is to another controller?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28287906

http://stackoverflow.com/comment/44981653
score: 1
has text: It works for me. What happens when you try, does it not get executed, or do you have any errors in the console? Is breakpoint set to false? (Required for the if statement to be executed)
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28309270

http://stackoverflow.com/comment/45195039
type: Comment
has text: Since you were asking for a delay you could also add a `$timeout` function
type: AnswerComment
comment on: http://stackoverflow.com/a/28432189
score: 0

http://stackoverflow.com/comment/44974647
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28311957
has text: So a few questions. Why aren't you using an iFrame with the iframe API? - Nevermind it looks like it replaces the div with an iframe. And why don't you have the event triggers when you create the player? I'm looking here: https://developers.google.com/youtube/iframe_api_reference#Loading_a_Video_Player
score: 0

http://stackoverflow.com/a/28319578
answers question: http://stackoverflow.com/q/28319467
type: Answer
has body: you could make use of double and single quotes to not escape quotes $('body').append(' ');
score: 0

http://stackoverflow.com/q/28330912
type: UnansweredQuestion
type: Question
tagged with: recursion
tagged with: performance
has comment: http://stackoverflow.com/comment/45009064
score: 0
linked to: http://stackoverflow.com/q/17090292
tagged with: javascript
has comment: http://stackoverflow.com/comment/45009070
has title: Is this recursion going to blow up my browser?
duplicate of: http://stackoverflow.com/q/17090292
has comment: http://stackoverflow.com/comment/45008976
has body: Quick background to this project: Have a list of 4 videos play on a kiosk-type machine that is running the chrome web browser. Allow users to select a video to play, and then continue looping through the list, allowing a user to select a video to play at will. So, I have the JavaScript all written to kick off this process, and it occurred to me that the recursive nature of the way I have things written may be a bad way to go ... even though it seems like the most logical way to do it. Is this thing going to overflow the stack at some point and throw an error if I leave it going for long stretches of time? The basic idea is that it should loop on it's own until some user intervention. Here's my JavaScript code for playing videos (in my html I have four buttons that are set to call the function with the corresponding video numbers): function playVideo(video_number) { //remove all previous event listeners for the video element node var el = document.getElementById('video'), elClone = el.cloneNode(true); el.parentNode.replaceChild(elClone, el); //define the array that has information about our videos. //array defines the following: //[0]=path to video, [1]=video title, [2]=color code for visual, //[3]=next video to play in list var video_array = [ ['./video1.mp4', 'VIDEO 1 TITLE', 'red', 1], // ['./video2.mp4', 'VIDEO 2 TITLE', 'green', 2], // ['./video3.mp4', 'VIDEO 3 TITLE', 'blue', 3], // ['./video4.mp4', 'VIDEO 4 TITLE', 'orange', 0], // ]; //get all the elements we're going to be using var t = document.getElementById('title'); var v = document.getElementById('video'); var s = document.getElementById('source'); var p = document.getElementById('progress'); t.innerHTML = video_array[video_number][1]; //set the title of the video t.style.color = video_array[video_number][2]; p.className = 'progress-bar ' + 'btn' + (video_number + 1); v.src = video_array[video_number][0]; v.load(); v.play(); //add event listener for the progress bar update v.addEventListener('timeupdate…
answer count: 0
has comment: http://stackoverflow.com/comment/45009105

http://stackoverflow.com/q/28350748
has comment: http://stackoverflow.com/comment/45045331
type: AnsweredQuestion
has title: Why is CSS animation delayed?
type: Question
has answer: http://stackoverflow.com/a/28350868
downvote count: 0
tagged with: javascript
tagged with: jquery
score: 4
upvote count: 4
answer count: 2
has comment: http://stackoverflow.com/comment/45045501
linked to: http://stackoverflow.com/q/6989734
possible better answer: http://stackoverflow.com/a/28350985
favorite count: 0
has answer: http://stackoverflow.com/a/28350985
accepted answer: http://stackoverflow.com/a/28350868
tagged with: animation
tagged with: http://stackoverflow.com/tag/html
has body: I am trying to set an "updating" image spinning during a long-running JS function. I am adding a class ("spinning") using JQuery which I have defined in my CSS to trigger the animation - this works fine when run on it's own. However, when I follow the addClass with a long-runnning JS function call, there is a delay in the animation, even though the class is applied instantaneously. Can someone show me where I am going wrong &amp; how to get the animation to initiate before the long-runnning function is run? This JSFiddle illustrates the problem: http://jsfiddle.net/gLas4k23/2/ - the spinning starts before "doSomething" completes, but after a noticeable delay which is absent if the call to doSomething is not present. html: &lt;div id='updateIcon' class='update'&gt;&lt;/div&gt; css: .update { width: 40px; height: 40px; background: url("http://s24.postimg.org/4psxulnkh/update_light.png") no-repeat; background-size: 40px; cursor: pointer; } .update.spinning { -webkit-animation: spinner 1s infinite linear; } @-webkit-keyframes spinner { from { -webkit-transform: rotate(0deg); } to { -webkit-transform: rotate(360deg); } } JS: $('#updateIcon').on('click', function(e){ console.log('i have been clicked'); $('#updateIcon').addClass('spinning'); doSomething(); }) function doSomething(){ console.log('doing something') for(var i=0;i&lt;20000;i++){ console.log('waiting'); } }
tagged with: css

http://stackoverflow.com/q/28312986
answer count: 2
has comment: http://stackoverflow.com/comment/44976354
has answer: http://stackoverflow.com/a/28313090
possible better answer: http://stackoverflow.com/a/28313186
accepted answer: http://stackoverflow.com/a/28313090
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44976189
score: 0
has comment: http://stackoverflow.com/comment/44976238
has comment: http://stackoverflow.com/comment/44976209
has comment: http://stackoverflow.com/comment/44976251
has body: I have a DOM to which I would like to add an element. The problem here is that I would like to add the element deep in the DOM (in an element with a specific class). I tried that: document.getElementsByClassName('lm_content')[0].append(iframeDoc) But it doesn't add to the document... Edit: Here is my html home +
has comment: http://stackoverflow.com/comment/44976366
has comment: http://stackoverflow.com/comment/44976336
has comment: http://stackoverflow.com/comment/44976254
has answer: http://stackoverflow.com/a/28313186
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44976284
has title: Add element to a deep element in the DOM
has comment: http://stackoverflow.com/comment/44976208
tagged with: dom
type: Question

http://stackoverflow.com/q/28305627
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28305700
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28305793
score: 1
upvote count: 1
type: Question
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has title: Getting JSON data from text area
answer count: 2
has body: In the fiddle - http://jsfiddle.net/660m7g7k/ &lt;textarea id="input"&gt; [ { name: "Tyorry", age: 22 }, { name: "greg", age: 44 }, { name: "aff", age: 99 }, { name: "ben", age: 20 } ] var x=document.getElementById("input").value; alert(x[0]); There is JSON data, array of objects basically. I have 2 questions. 1) Is this JSON data in JSON.stringify format or JSON.parse format? since JSON.parse is erroring out and JSON.stringify is working properly. 2) Am getting the JSON data from textarea. but x[0] or x[3] is returning blank. basically i want to loop through the array item(which are objects) and get the values, name and age.
tagged with: textarea

http://stackoverflow.com/comment/45153659
score: 0
comment on: http://stackoverflow.com/q/28409765
type: Comment
type: QuestionComment
has text: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date

http://stackoverflow.com/comment/45004360
comment on: http://stackoverflow.com/a/28323882
score: 0
type: AnswerComment
type: Comment
has text: Yes, you can declare the variable outside of the function and than just set within the function. I updated the answer.

http://stackoverflow.com/a/28360628
score: -1
answers question: http://stackoverflow.com/q/28360530
has body: The JavaScript validations are client-side validations. The end user could easily break this with the browser's JavaScript settings. It is best to use Ajax validation for security purposes. The blog post Form Validation Using Ajax will help more to use Ajax validations.
type: Answer
upvote count: 0
downvote count: 1

http://stackoverflow.com/a/28420952
type: Answer
has comment: http://stackoverflow.com/comment/45175375
score: 0
accepted answer of: http://stackoverflow.com/q/28420895
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28420895
has body: Should get you on the right track: var ID = 9691717 var ids = [1,2,3,4,5,6,7] var i = 0 function PM(){ $.post("http://www.roblox.com/messages/send",{ subject : "Hi!", body : "Hello", recipientid : ids[i], cacheBuster : new Date().getTime() }) i++; } setInterval(PM, 5000); One thing to keep in mind is handling when there are no more IDs to iterate over. Also, it would be cleaner just to call ids.pop() each time, but that would assume that you didn't need to use the ids array elsewhere

http://stackoverflow.com/comment/45075206
type: Comment
has text: 1) Are you using this? http://www.appelsiini.net/projects/viewport I have never heard of :in-viewport so I assume you are. 2) Your question is odd, you want to hide an element when it is outside of the viewport i.e. it is not visible anyway? That is normal browser behaviour. How will the user know the element is hidden? Or perhaps you plan to fade them in/out.
comment on: http://stackoverflow.com/q/28366422
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45125281
has text: Edited to allow any number of select boxes to be used to filter the final select box. Just give any select box you want to act as a filter the `filterElements` class then call `$('#select').filterByValues( $('.filterElements') );`
type: AnswerComment
comment on: http://stackoverflow.com/a/28393708
type: Comment
score: 0

http://stackoverflow.com/comment/44951085
type: AnswerComment
comment on: http://stackoverflow.com/a/28292962
type: Comment
has text: I need all three labels: min, max, average.
score: 0

http://stackoverflow.com/q/28329660
type: Question
has title: Dynamic FLOT legend table
tagged with: flot
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28330909
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28330909
favorite count: 0
score: 0
has comment: http://stackoverflow.com/comment/45006950
tagged with: legend
tagged with: css
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45006739
type: AnsweredQuestion
has body: I have a somewhat limited knowledge of JS and JQuery so I am sorry if this is a stupid question. I have a dashboard of charts which will have varying widths and also allows a user to change the width. The chart automatically adjusts it's size. What I want is for the legend to appear under that chart but fill the width given. My issue is it seems that the number of columns for the legend is set once and unable to be updated. So if I a chart that covers the entire width of the page I want to be able to show a larger number of columns, but if the chart only has a small amount of width space I would like it to use less columns. I can capture the width and figure out the number of columns I would like but is it possible to redraw the legend dynamically? Thanks for the help!

http://stackoverflow.com/a/28302226
accepted answer of: http://stackoverflow.com/q/28299593
has comment: http://stackoverflow.com/comment/45020534
has comment: http://stackoverflow.com/comment/44956007
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44977139
has body: try this one http://jsfiddle.net/xbtxzaax/1/ You can update the row by clicking images on the row. nu76
type: Answer
has comment: http://stackoverflow.com/comment/44994040
answers question: http://stackoverflow.com/q/28299593
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45021589

http://stackoverflow.com/q/28384508
has comment: http://stackoverflow.com/comment/45106899
has comment: http://stackoverflow.com/comment/45106977
has comment: http://stackoverflow.com/comment/45107156
has comment: http://stackoverflow.com/comment/45107004
tagged with: php
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/11502244
has title: Why does I get "Cannot read property 'obj2' of undefined" on one but not the on the other one?
has comment: http://stackoverflow.com/comment/45106964
has comment: http://stackoverflow.com/comment/45107241
has answer: http://stackoverflow.com/a/28384530
accepted answer: http://stackoverflow.com/a/28384530
type: Question
has comment: http://stackoverflow.com/comment/45107316
tagged with: arrays
tagged with: javascript
tagged with: ajax
has comment: http://stackoverflow.com/comment/45119379
score: 0
has body: Hi im trying to make a script where i can get more info of an object by pressing one button but i have had some problems so far. The code works fine on the fist "Drue" when i hit "mer info" but if i try to press the "Eple" or one of the other one i get the error "Cannot read property 'objX' of undefined" where X is the name of the array in the php This is just the code for the two first objects "Drue" and "Eple" var request = new XMLHttpRequest(); request.onreadystatechange = function () { if (request.readyState == 4 &amp;&amp; request.status == 200) { var response = request.responseText; var mink = JSON.parse(request.responseText); text.innerHTML = mink[0].obj1; epletext.innerHTML = mink[1].obj1; banantext.innerHTML = mink[2].obj1; orangetext.innerHTML = mink[3].obj1; } else { text.innerHTML = "pissing..."; epletext.innerHTML = "pissing..."; banantext.innerHTML = "pissing..."; orangetext.innerHTML = "pissing..."; } } request.open("GET", "info.php", true); request.send(); btn.onclick = function (){ request.onreadystatechange = function () { if (request.readyState == 4 &amp;&amp; request.status == 200) { if (drue == 0) { var response = request.responseText; var mink = JSON.parse(request.responseText); text.innerHTML = mink[0].obj2; drue = 1; } else { var response = request.responseText; var mink = JSON.parse(request.responseText); text.innerHTML = mink[0].obj1; drue = 0; } } else { text.innerHTML = "pissing..."; } } request.open("GET", "info.php", true); request.send(); } eple.onclick = function (){ request.onreadystatechange = function () { if (request.readyState == 4 &amp;&amp; request.status == 200) { if (eplenr == 0) { var response = request.responseText; var mink = JSON.parse(request.responseText); epletext.innerHTML = mink[1].obj2; eplenr = 1; } else { var response = request.responseText; var mink = JSON.parse(request.responseText); epletext.innerHTML = mink[1].obj1; eplenr = 0; } } else { epletext.innerHTML = "pissing..."; } } request.open("GET", "info.json", …
answer count: 1

http://stackoverflow.com/q/28302995
tagged with: multidimensional-array
score: 0
possible better answer: http://stackoverflow.com/a/28303719
has body: I have the the following two dimensional array: SideNavItems= [["Parent Section 1", "Parent Section 2"],["Parent Section 3", "Parent Section 4"]] I want to use ng-repeat to display them the following way on a page that has tabbed navigation: Desired output: When first tab is selected: Parent Section 1 Parent Section 2 When second tab is selected: Parent Section 3 Parent Section 4 Current output: When first tab is selected: Parent Section 1 Parent Section 2 Parent Section 3 Parent Section 4 I have a $index variable that changes based on what tab is selected. Can I set it so that only the contents of the first array(element 0 of the 2D array) are repeated when the index is 0, the contents of the second array(element 1 of the 2D array) are repeated when the index is 1, and so on if the 2D array had more elements? Here is the html I have for repeating the arrays: {{cell}} and I don't know if this will be very relevant but here is the HTML for the tabs. The getClass methods giving active classes that change the tabs appearance in CSS. The toggleSelect method changes the current index to the active tab. {{tab}} I have similar arrays with the child sections for each of these parent sections and hope to do the same thing if there is a way to make this work. I guess I would need another variable to act as a second index though... ***EDIT 2/3/15 2:00PM Using your advice, I was able to get my desired output. I am now trying to get similar functionality for the children of these parent sections and it seems a bit more complicated. I actually have a 3D array: [ [[Parent1Child1, Parent1Child2],[Parent2Child1, Parent2Child2, Parent2Child3]], [[Parent3Child1, Parent3Child2],[Parent4Child1, Parent4Child2, Parent4Child3]] ] Desired Output: When first tab is selected: Parent Section 1 Parent1Child1 Parent1Child2 Parent Section 2 Parent2Child1 Parent2Child2 Parent2Child3 When second tab is selected: Parent Section 3 Parent3Child1 Parent3Child2 Parent Section 4 Parent4Child1 Parent4Chil…
accepted answer: http://stackoverflow.com/a/28303125
has comment: http://stackoverflow.com/comment/44992880
type: AnsweredQuestion
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/44992213
tagged with: javascript
has answer: http://stackoverflow.com/a/28303125
has answer: http://stackoverflow.com/a/28303719
tagged with: angularjs-ng-repeat
has comment: http://stackoverflow.com/comment/44985164
tagged with: angularjs
has title: AngularJS ng-repeat 2D array and display only certain values based on index

http://stackoverflow.com/comment/44927754
comment on: http://stackoverflow.com/q/28286866
score: 0
type: QuestionComment
type: Comment
has text: Ok thankyou, is there any fix? or should I just use a new loaded letter?

http://stackoverflow.com/comment/45007438
has text: I want the check statement/code to read a file (eg. /sys/cpu/cpuvalue) and see what the value written in the file is... if it is 12 then the check box state should show as checked otherwise not
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28329948

http://stackoverflow.com/comment/45261495
type: AnswerComment
comment on: http://stackoverflow.com/a/28399606
type: Comment
has text: @Thanu, I just tried over the local network and it does work. Must come from your mp4 files, it might not have been encoded with the right settings. Have a look at [this answer](http://stackoverflow.com/a/13402284/3702797), and to be sure, download the examples video files [here](http://media.w3.org/2010/05/sintel/trailer.mp4) and [here](http://media.w3.org/2010/05/sintel/trailer.ogv) and try loading them with the script.
score: 0

http://stackoverflow.com/comment/45042713
score: 0
type: Comment
type: QuestionComment
has text: It's valid, but typically considered a bad practice because it's a form of eval.
comment on: http://stackoverflow.com/q/28349445

http://stackoverflow.com/q/28392629
score: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45122244
type: Question
has comment: http://stackoverflow.com/comment/45122291
has comment: http://stackoverflow.com/comment/45122227
answer count: 1
tagged with: javascript
has body: How do I get the button grade me work when I click on it? It should provide with an alert box displaying all the score for each correct answer. See the code below: !DOCTYPE html> Question 1 He _____ it. don't like doesn't like don't likes Question 2 They _____ here very often. don't come doesn't comes don't doesn't come Question 3 John and Mary _____ twice last week. comes come coming function validate(){ var cor = 0; var radios = document.getElementById('q'); for(var i = 1; i < radios.length; i++){ if (radios[i].checked == true && radios[i].value == "right") { cor++ } } }alert("Correct " + cor);
has comment: http://stackoverflow.com/comment/45122110
has answer: http://stackoverflow.com/a/28392906
tagged with: http://stackoverflow.com/tag/html
has title: JavaScript - Quiz RadioButtons and Form validation

http://stackoverflow.com/comment/45049961
type: Comment
comment on: http://stackoverflow.com/a/28351866
has text: An anchor tag which has an HREF attribute has a default EventHandling to go to HREF specified. By using onclick you have to override the default behaviour of the anchor tag. javascript: is a fully supported feature by all browsers and has been for a couple of decades. If you solely want to use onclick use a button and style it to look like an anchor tag. In this case you are doing extra work and overriding the default behaviour of the anchor tag needlessly.
score: 0
type: AnswerComment

http://stackoverflow.com/a/31817074
has body: I tried to customize the appearance of jQuery knob, but as per the current behavior of knob we can't add additional handles with it. Alternatively you can use the jQuery roundSlider plugin, which is very flexible to use so that we can add multiple handles with a single slider. Check the exact demo for your requirement: jsFiddle Screenshot of the Output:
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28408445
answers question: http://stackoverflow.com/q/28408445
has comment: http://stackoverflow.com/comment/53462326
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/q/28373453
has answer: http://stackoverflow.com/a/28373596
has comment: http://stackoverflow.com/comment/45087404
downvote count: 1
has title: JQuery .hide() won't hide button suddenly
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28373495
upvote count: 1
has comment: http://stackoverflow.com/comment/45087426
type: Question
accepted answer: http://stackoverflow.com/a/28373596
tagged with: javascript
tagged with: jquery
has body: I have this a button which a user can click on which adds a comment box at the bottom of the page. My button html looks like this: So as you can see it calls a method called generateComment which looks like this: function generateComment(name, id, isInspection, button){ //get the current button and hide it var btn = $("a[name='" + button.name + "'"); btn.hide();//doesn't work var generatedName = ''; if(isInspection){ generatedName = "comment_" + id; } else{ generatedName = "section_" + id; } var comment = $('#comments'); var genHtml = ' ' + ' ' + name + ' ' + ' x' + ' ' ' '; comment.append(genHtml); $('html,body').animate({ scrollTop: $(".bigDataDiv").offset().top}, 'slow'); } All this method does it hide the button, generate the comment div then scroll to the newly created div. This code worked no problem and used to hide the button but now for some reason it doesn't work and the button still shows up
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/45087441
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28373847
favorite count: 0
possible better answer: http://stackoverflow.com/a/28373847

http://stackoverflow.com/comment/45197832
has text: i tried to do that but i couldn't figure out why...any direction please?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28433362

http://stackoverflow.com/comment/44977357
score: 1
comment on: http://stackoverflow.com/q/28312944
has text: setting the `$timeout` to 5 seconds worked..
type: Comment
type: QuestionComment

myo
tag name: myo
type: Tag
tags question: http://stackoverflow.com/q/28282231

http://stackoverflow.com/comment/45096955
score: 0
type: Comment
has text: Thank you man much appreciated. I editted my original question to show you my updated code and see if there were any better ways of doing this and more specifically displaying the function and writing it to the document @Aweary
comment on: http://stackoverflow.com/a/28378363
type: AnswerComment

angular-amd
tag name: angular-amd
type: Tag
tags question: http://stackoverflow.com/q/28331502

http://stackoverflow.com/a/28321221
accepted answer of: http://stackoverflow.com/q/28320979
upvote count: 1
answers question: http://stackoverflow.com/q/28320979
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44990534
has body: . is used for to access object property while [] notation is used for to access array value. console.log(data[0]['request_id']); Demo Update: Try with - var response = jQuery.parseJSON(data0) console.log(response.request_id);
has comment: http://stackoverflow.com/comment/44991027

http://stackoverflow.com/q/28342516
has title: What selector do I use to access this div?
downvote count: 4
has answer: http://stackoverflow.com/a/28342937
answer count: 4
favorite count: 0
accepted answer: http://stackoverflow.com/a/28342576
has body: If I have a structure like this: var myThing = jQuery( jQuery('&lt;div/&gt;') .addClass('myTopDiv') .append( jQuery('&lt;div/&gt;') .text('some text') .addClass('mySecondDiv') ).append('&lt;div/&gt;') .text('some more text') // I WANT TO REPLACE THIS TEXT ); How do I target the div which contains the text some more text and replace that text with new text? I've stored it inside a variable called myThing, but I don't know how to navigate down to the div I want. I can't use the classes as selectors as there are multiple instances of this variable in my application. Something like this perhaps? Which doesn't work... jQuery( jQuery('&lt;tr/&gt;') .text('new text') ).appendTo(myThing);
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28342597
upvote count: 3
type: Question
possible better answer: http://stackoverflow.com/a/28342554
has answer: http://stackoverflow.com/a/28342576
has answer: http://stackoverflow.com/a/28342554
has comment: http://stackoverflow.com/comment/45029523
tagged with: javascript
tagged with: jquery
score: -1

http://stackoverflow.com/q/28408292
tagged with: backbone-routing
tagged with: javascript
has title: Get id of another view in Backbone
score: 0
answer count: 2
tagged with: backbone.js
has answer: http://stackoverflow.com/a/28408426
has body: I have two views, one of them have a search box that includes a button "Search" with id="search". In the second view I want when click in button "Search" make a search. But for this happens I need to get the id. How can do this? Here the code of my second view, but not works because #search is in the first view: ev.views.Home = Backbone.View.extend({ events: { 'click #search' : 'searchKey', });
type: AnsweredQuestion
tagged with: backbone-views
possible better answer: http://stackoverflow.com/a/28411996
has answer: http://stackoverflow.com/a/28411996
type: Question
accepted answer: http://stackoverflow.com/a/28408426

storage
tag name: storage
tags question: http://stackoverflow.com/q/28341289
type: Tag

http://stackoverflow.com/comment/45173280
comment on: http://stackoverflow.com/q/28420024
has text: http://jsfiddle.net/9k9v09ds/
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45033043
has text: Indeed I need to watch any change to any filed of a model.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28344131
score: 0

http://stackoverflow.com/comment/45014477
type: AnswerComment
has text: @micah It's still kinda unclear. You're saying that if an `auth_code` already exists, it needs to be replaced... but if an `auth_code` *doesn't* exist, nothing should happen? Is that what you're trying to do?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28333721

http://stackoverflow.com/q/28349396
favorite count: 0
has body: This script is working fine in chrome and firefox but not safari... Any help please? Shop By Category ----Some Text---- $(document).ready(function () { $("li").click(function () { //Toggle the child but don't include them in the hide selector using .not() $('li > ul').not($(this).children("ul").toggle()).hide(); }); });
accepted answer: http://stackoverflow.com/a/28349708
has comment: http://stackoverflow.com/comment/45042660
has title: Simple Java Script not working in Safari?
score: -4
has answer: http://stackoverflow.com/a/28349708
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45042724
tagged with: javascript
downvote count: 4
upvote count: 0
answer count: 1

http://stackoverflow.com/comment/45183309
type: Comment
has text: @user1731468, it works for me with such translation file. Could you prepare a short [jsFiddle](http://jsfiddle.net/) with your non-working example
comment on: http://stackoverflow.com/a/28398310
type: AnswerComment
score: 0

http://stackoverflow.com/a/28305629
has body: ^(?!\((.)\1\1\)\s*\1\1\1-\1\1\1\1)\([0-9]{3}\) [0-9]{3}-[0-9]{4}$ Try this.See demo.Just add a lookahead to check if all digits are not same.See demo. https://regex101.com/r/vD5iH9/65
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28305528

http://stackoverflow.com/q/28308403
type: Question
score: 0
answer count: 1
tagged with: javascript
type: UnansweredQuestion
tagged with: ember.js
has title: Ember.js: How to use an observer on select helper to filter content?
has body: I'm trying to achieve the following with Ember-CLI: After an initial list of items is loaded, the user can select a city from the dropdown to see only those items that are interesting to him/her. In my case that's districts in cities. You can select from a dropdown list a city to see only districts in that city. Ideally, all should happen without calling an separately (on click). So far, I've got this, but the console.log for 'filteredContent' returns an array of 0 elements. Any hints where I'm doing something wrong? district/index.hbs: &lt;p&gt;{{view "select" content=cities optionValuePath="content.id" optionLabelPath="content.name" selection=selectedCity}}&lt;/p&gt; {{#each item in filteredContent}} &lt;p&gt;{{item.name}} in {{item.city.name}}&lt;/p&gt; {{/each}} route: var DistrictListRoute = Ember.Route.extend({ model: function () { return this.store.find('district'); }, setupController: function(controller, model) { this._super(controller, model); this.store.find('city').then(function(cities) { controller.set('cities', cities); }); } }); export default DistrictListRoute; controller: export default Ember.Controller.extend({ filteredContent: [], selectedCity: null, selectedCityChanged: function () { var selectedCity = this.get('selectedCity'); console.log(selectedCity); var filteredContent = this.get('model').filterBy('city', selectedCity); console.log(filteredContent); }.observes('selectedCity') }); model: export default DS.Model.extend({ city: DS.belongsTo('city', {async: true}), name: DS.attr('string'), advert: DS.hasMany('item') });
has answer: http://stackoverflow.com/a/28456000

http://stackoverflow.com/q/28360091
tagged with: jquery
has answer: http://stackoverflow.com/a/28360760
tagged with: setinterval
favorite count: 0
score: 2
has answer: http://stackoverflow.com/a/28360132
upvote count: 2
has comment: http://stackoverflow.com/comment/45062840
type: UnansweredQuestion
has title: How to use setInterval until image not loaded?
has comment: http://stackoverflow.com/comment/45063231
has comment: http://stackoverflow.com/comment/45063251
has comment: http://stackoverflow.com/comment/45062883
type: Question
has comment: http://stackoverflow.com/comment/45062947
answer count: 2
has comment: http://stackoverflow.com/comment/45063182
downvote count: 0
has body: I am using setInterval for change image on mouse over, I want that set interval call again after or next interval comes after only when image loaded.. Following is my code: jQuery('.product').on('mouseover',function(){ timer = setInterval(function() { if (counter !== 0) { time = 2000; } if (counter === product_images.length) { counter = 0; } selector.attr('src', 'localhost/product/' + product_images[counter]); var loadImage = new Image(); loadImage.src = selector.attr('src'); loadImage.onload = function(){ selector.show(); }; counter = counter + 1; },1000); }); What i want that before coming next image using set interval time next image should not be loaded until previous one not loaded... and in that time i want display loading image How could i do it with jquery promise or by other solution. Please help me... One more thing i do not want to called next interval until first image not loaded
tagged with: javascript

http://stackoverflow.com/a/28399358
score: 8
upvote count: 8
has comment: http://stackoverflow.com/comment/45135503
type: Answer
accepted answer of: http://stackoverflow.com/q/28398550
answers question: http://stackoverflow.com/q/28398550
has comment: http://stackoverflow.com/comment/45134898
downvote count: 0
has comment: http://stackoverflow.com/comment/45134869
has body: The root cause of the problem is that extension content scripts execute in an isolated world. One of the reasons for this is so that your code does not conflict with the page's code: for instance, you can use a different version of jQuery. So, your content script has its own copy of jQuery. The way jQuery's .click() works is by maintaining a list of event handlers that are triggered by the click.. ..and you may see the problem already. The content script's copy of jQuery is not aware of the page's copy list of handlers, and cannot trigger them. That, by the way, explains why it works when you put it in the console - by default, console executes in the page's context and triggers the page's copy of jQuery. There are ways to overcome this, but the most straightforward for your task is to emit a proper DOM event, that will be caught by the page's code. See this question for an example.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45135363
has comment: http://stackoverflow.com/comment/45134938
has comment: http://stackoverflow.com/comment/45134957

http://stackoverflow.com/q/28283344
has answer: http://stackoverflow.com/a/59330087
has title: Is there a way to hide the line numbers in Ace Editor?
accepted answer: http://stackoverflow.com/a/28283527
possible better answer: http://stackoverflow.com/a/31406713
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/31406713
tagged with: ace-editor
downvote count: 1
type: Question
tagged with: javascript
upvote count: 22
answer count: 3
score: 21
has body: Is there any way to remove the line numbers when using the ace editor? Similar to removing the print margin as shown below? editor.setShowPrintMargin(false);
favorite count: 0
has comment: http://stackoverflow.com/comment/44921051
has answer: http://stackoverflow.com/a/28283527

http://stackoverflow.com/a/28351390
score: 1
answers question: http://stackoverflow.com/q/28351231
upvote count: 1
has body: You could use the onLoad attribute to specify a new location, something like: ... ...
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28351231
type: Answer
downvote count: 0

http://stackoverflow.com/q/28416547
accepted answer: http://stackoverflow.com/a/28416810
upvote count: 18
has body: What exactly is the difference between: Array(3) // and Array.apply(null, Array(3) ) The first returns [undefined x 3] while the second returns [undefined, undefined, undefined]. The second is chainable through Array.prototype.functions such as .map, but the first isn't. Why?
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/28416810
type: Question
has title: Difference between Array.apply(null, Array(x) ) and Array(x)
linked to: http://stackoverflow.com/q/25512771
has answer: http://stackoverflow.com/a/28416813
has comment: http://stackoverflow.com/comment/56443566
possible better answer: http://stackoverflow.com/a/34349113
has answer: http://stackoverflow.com/a/56819024
has answer: http://stackoverflow.com/a/34349113
has comment: http://stackoverflow.com/comment/56443706
score: 18
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/34349412
answer count: 5

http://stackoverflow.com/a/70809112
type: Answer
answers question: http://stackoverflow.com/q/28431505
score: 0
has body: This error has something to do with some google chrome extensions per Already addressed here. I disabled all of my extensions and the error went away. After playing with each one of them some more, I found that Natural Reader Text to Speech extension was the one causing it. It's highly possible you have an extension causing this. Good luck.

http://stackoverflow.com/a/28303037
has body: You can't decide to use promises where none exist. The dialog library you're using accepts a complete callback, and that's what you need to use. You need to fundamentally change the way your code works. Your getTemplate method cannot return a value if that value comes from an event that will happen some time in the future, such as a user dismissing a dialog. Instead, it must accept a callback which gets passed the value at some point in the future: getTemplateName: function(callback) { this.openDialog({ height: 150, width: 300, position: ["center", 80], closeOnEscape: true, modal:true, close: function () { callback($("#templateName").val()); } }, "templateName.html"); }
upvote count: 2
has comment: http://stackoverflow.com/comment/44965412
accepted answer of: http://stackoverflow.com/q/28302512
has comment: http://stackoverflow.com/comment/44964521
has comment: http://stackoverflow.com/comment/44967853
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44957896
has comment: http://stackoverflow.com/comment/44964243
has comment: http://stackoverflow.com/comment/44965124
type: Answer
answers question: http://stackoverflow.com/q/28302512
has comment: http://stackoverflow.com/comment/44965364
score: 2

http://stackoverflow.com/q/28290136
downvote count: 0
has comment: http://stackoverflow.com/comment/44933915
favorite count: 0
tagged with: promise
tagged with: angularjs
tagged with: angular-promise
upvote count: 3
has answer: http://stackoverflow.com/a/28292030
has comment: http://stackoverflow.com/comment/44950298
type: AnsweredQuestion
has body: I'm trying to figure out a clean way to chain promises in AngularJs. My goal is to not rewrap the $http promise using $q and to instead take advantage of the fact that $http.xxx() methods return promises and use chaining. In the below code I'm trying to satisfy the following Use Case. Note: If I remove the innner .catch() block my 404 will get caught by the outer catch(). I've tried using the then(actionHandler, errorHandler) approach as well as tried returning a string from .catch() and tried using this.reject() in .catch(). Give $scope.username is Bret When calling getPosts() and getting a 404 from /users Then scope.error has a message indicating that the user wasn't found // Code angular.module('app', []) .controller('MainController', function ($scope, $log, $q, $http) { $scope.posts = []; $scope.message = ""; function getUserByUserName(userName) { return getUsers() .then(function (response) { var user; for (var i = 0; i &lt; response.data.length; i++) { if (response.data[i].username === userName) { user = response.data[i]; break; } } return user; }).catch(function (error) { throw "User could not be found."; }); }; function getUsers() { return $http.get('http://jsonplaceholder.typicode.com/users'); } function getPostByUser(user){ return getPosts() .then(function (posts) { var postsByUser = []; for (var i = 0; i &lt; posts.length; i++) { if (posts[i].userId === user.id) { postsByUser.push(posts[i]); } } return postsByUser; }); } function getPosts() { return $http.get('http://jsonplaceholder.typicode.com/posts') .then(function (response) { return response.data; }); }; function addPostsToScope(posts) { $log.debug('MainController.getPostByUserName reponse.length: ' + posts.length); $scope.posts.length = 0; $scope.posts.username = $scope.username; for (var i = 0; i &lt; posts.length; i++) { $scope.posts.push(posts[i]); } }; $scope.getPosts = function () { getUserByUserName($scope.username) .then(getPostByUser) .then(addPostsToScope) .catch(function (error) { $scope.er…
tagged with: javascript
has title: Rethrowing exceptions in nested promise chains
type: Question
accepted answer: http://stackoverflow.com/a/28292030
score: 3
answer count: 1

http://stackoverflow.com/q/28317219
downvote count: 0
has title: Delete a file with ajax request
possible better answer: http://stackoverflow.com/a/28317354
type: Question
has comment: http://stackoverflow.com/comment/44983562
answer count: 2
has comment: http://stackoverflow.com/comment/44983790
has comment: http://stackoverflow.com/comment/44983464
has answer: http://stackoverflow.com/a/28317280
has comment: http://stackoverflow.com/comment/44983508
accepted answer: http://stackoverflow.com/a/28317280
tagged with: javascript
score: 4
tagged with: ajax
has comment: http://stackoverflow.com/comment/44983459
has comment: http://stackoverflow.com/comment/44983560
has answer: http://stackoverflow.com/a/28317354
favorite count: 0
tagged with: file
has body: I'm trying to delete a file with ajax request: javascript: function deleteFile(file_path) { var r = confirm("Sure?") if(r == true) { $.ajax({ url: 'delete_file.php', data: {'file' : file_path }, method: 'GET', success: function (response) { alert('Deleted!'); }, error: function () { alert('Not Deleted!'); } }); } } delete_file.php : unlink($_GET['file']); It returns true on succes,but the file is not deleted.
upvote count: 4
tagged with: php
type: AnsweredQuestion

http://stackoverflow.com/comment/45059934
comment on: http://stackoverflow.com/a/28358356
type: AnswerComment
has text: sorry, first time on stackoverflow, it is the other way around , if g is defined and not initialized , value of g carried to the next iteration however if it is defined and initialized its value is set to zero each for each iteration
score: 0
type: Comment

http://stackoverflow.com/q/28361713
answer count: 0
upvote count: 3
has title: Build Dynamic Layout For restaurant
type: Question
score: 3
tagged with: javascript
tagged with: html5-canvas
downvote count: 0
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has body: I am developing canvas using jquery and i am able to take only one kind of image from toolbox to actual canvas(i.e. drag, drop of one image from toolbox to canvas). I want to add more inputs in toolbox like door,table,chair etc. And want to use same for drag drop operation. This is my Current Code which takes only one input in toolbar. i want multiple options in toolbar and same for drag drop functionality in the canvas. // get a reference to the house icon in the toolbar // hide the icon until its image has loaded var $house=$("#house"); $house.hide(); // get the offset position of the kinetic container var $stageContainer=$("#container"); var stageOffset=$stageContainer.offset(); var offsetX=stageOffset.left; var offsetY=stageOffset.top; // create the Kinetic.Stage and layer var stage = new Kinetic.Stage({ container: 'container', width: 350, height: 350 }); var layer = new Kinetic.Layer(); stage.add(layer); // start loading the image used in the draggable toolbar element // this image will be used in a new Kinetic.Image var image1=new Image(); image1.onload=function(){ $house.show(); } image1.src="https://dl.dropboxusercontent.com/u/139992952/multple/4top.png"; // make the toolbar image draggable $house.draggable({ helper:'clone', }); // set the data payload $house.data("url","house.png"); // key-value pair $house.data("width","32"); // key-value pair $house.data("height","33"); // key-value pair $house.data("image",image1); // key-value pair // make the Kinetic Container a dropzone $stageContainer.droppable({ drop:dragDrop, }); // handle a drop into the Kinetic container function dragDrop(e,ui){ // get the drop point var x=parseInt(ui.offset.left-offsetX); var y=parseInt(ui.offset.top-offsetY); // get the drop payload (here the payload is the image) var element=ui.draggable; var data=element.data("url"); var theImage=element.data("image"); // create a new Kinetic.Image at the drop point // be sure to adjust for any border width (here border==1) var image = new Ki…
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28377723
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28377759
accepted answer: http://stackoverflow.com/a/28377759
favorite count: 0
tagged with: cpu-usage
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/57822765
score: 2
type: AnsweredQuestion
upvote count: 2
tagged with: bandwidth-throttling
type: Question
tagged with: google-chrome-devtools
has answer: http://stackoverflow.com/a/57822765
has title: How to monitor and/or throttle rate limit cpu/bandwidth by client-side web pages?
answer count: 2
has body: Nowadays it appears that many webpages want to use my cpu/harddrive/bandwidth in order to show me their ads/pages/information in beautiful but expensive ways. Often I like these new pages, but sometimes I'm a curmudgeon and am just annoyed that my fan starts spinning and the EMF loads rise when I open the pages. Is there a browser/plugin that I can use to throttle, best case, and/or monitor, worst case? I am not very knowledgeable of the Reactive JS, etc techniques, so I am hoping there is an easy solution? thank you! Anne ps Normally I use Firefox but of course I have Chrome on my machines (win8, win7, mac 10.8) as well.

meteor
tags question: http://stackoverflow.com/q/28305666
tags question: http://stackoverflow.com/q/28297982
tags question: http://stackoverflow.com/q/28308803
tags question: http://stackoverflow.com/q/28352498
tags question: http://stackoverflow.com/q/28294696
tags question: http://stackoverflow.com/q/28435847
tags question: http://stackoverflow.com/q/28355989
tags question: http://stackoverflow.com/q/28385245
tags question: http://stackoverflow.com/q/28301286
tags question: http://stackoverflow.com/q/28281949
tags question: http://stackoverflow.com/q/28378112
tags question: http://stackoverflow.com/q/28389906
tags question: http://stackoverflow.com/q/28321019
tags question: http://stackoverflow.com/q/28408568
tags question: http://stackoverflow.com/q/28336743
tags question: http://stackoverflow.com/q/28358735
tags question: http://stackoverflow.com/q/28280895
tags question: http://stackoverflow.com/q/28332032
tags question: http://stackoverflow.com/q/28405573
tags question: http://stackoverflow.com/q/28428322
tags question: http://stackoverflow.com/q/28296013
tags question: http://stackoverflow.com/q/28297566
tags question: http://stackoverflow.com/q/28372994
tags question: http://stackoverflow.com/q/28336570
type: Tag
tags question: http://stackoverflow.com/q/28318758
tags question: http://stackoverflow.com/q/28351791
tags question: http://stackoverflow.com/q/28310145
tags question: http://stackoverflow.com/q/28286050
tags question: http://stackoverflow.com/q/28383589
tags question: http://stackoverflow.com/q/28311408
tags question: http://stackoverflow.com/q/28341943
tags question: http://stackoverflow.com/q/28348167
tags question: http://stackoverflow.com/q/28308994
tags question: http://stackoverflow.com/q/28311666
tags question: http://stackoverflow.com/q/28350623
tags question: http://stackoverflow.com/q/28315126
tags question: http://stackoverflow.com/q/28283963
tags question: http://stackoverflow.com/q/28371261
tags question: http://stackoverflow.com/q/28404630
tags question: http://stackoverflow.com/q/28326757
tags question: http://stackoverflow.com/q/28341700
tags question: http://stackoverflow.com/q/28397930
tags question: http://stackoverflow.com/q/28355957
tags question: http://stackoverflow.com/q/28337717
tags question: http://stackoverflow.com/q/28369798
tags question: http://stackoverflow.com/q/28429292
tag name: meteor
tags question: http://stackoverflow.com/q/28351197
tags question: http://stackoverflow.com/q/28402595
tags question: http://stackoverflow.com/q/28406726
tags question: http://stackoverflow.com/q/28359335
tags question: http://stackoverflow.com/q/28346874
tags question: http://stackoverflow.com/q/28335147
tags question: http://stackoverflow.com/q/28334886

http://stackoverflow.com/q/28300583
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28300789
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: append
answer count: 1
tagged with: jquery-ui-sortable
has title: jQuery Sortable append on Div
score: 0
has body: I have a shopping basket where i need to be able to add multiple items, i have configured the jQuery sortable plugin, however, when i add more than 1 extra item, they group together as i am appending the add another item, to a placer div, i gather this is the problem, but how do i make it so i can add more items, but still keep the sortable function working on individual items? Please help or can someone show me a working Fiddle where Adding more thena 1 more food Item doesnt group them within the foodplacer div <?php $mCount = 1; if(isset($_POST['itemDetails']) && is_array($_POST['itemDetails']) && count($_POST['itemDetails']) > 0){ foreach($_POST['itemDetails'] as $itemDetail){ if(!empty($itemDetail['title']) || !empty($itemDetail['brand']) || !empty($itemDetail['order']) || !empty($itemDetail['notes'])){ echo(' '); $mCount++; } } } else { //INITAL REQUEST IF 0 POST DATA echo(' Track '.$mCount.' Title brand Notes '); $mCount++; } ?> Add Another food Item
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28388334
type: Question
has comment: http://stackoverflow.com/comment/45114545
has title: Exporting Highcharts charts to Excel?
has body: I am using highcharts on my Jsf based web site. I am exporting my page to export , but i cant export charts. my excel code is like this var tableToExcel = (function() { var uri = 'data:application/vnd.ms-excel;base64,' , template = ' <!--[if gte mso 9]> <x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook> <![endif]--> {table} ' , base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))) } , format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p]; }) } return function(table, name) { if (!table.nodeType) table = document.getElementById(table) var ctx = {worksheet: name || 'Worksheet', table: table.innerHTML} window.location.href = uri + base64(format(template, ctx)) } })() My chart html My chart js $(function () { $('#container').highcharts({ chart: { type: 'column' }, title: { text: 'Monthly Average Rainfall' }, subtitle: { text: 'Source: WorldClimate.com' }, xAxis: { categories: [ 'Jan', 'Feb', 'Mar' ] }, yAxis: { min: 0, title: { text: 'Rainfall (mm)' } }, tooltip: { headerFormat: '{point.key} ', pointFormat: ' {series.name}: ' + ' {point.y:.1f} mm ', footerFormat: ' ', shared: true, useHTML: true }, plotOptions: { column: { pointPadding: 0.2, borderWidth: 0 } }, series: [{ name: 'Tokyo', data: [49.9, 71.5, 106.4] }, { name: 'New York', data: [83.6, 78.8, 98.5] }] }); }); How can i export chart to excel with its data ?
tagged with: highcharts
answer count: 1
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45273603
has comment: http://stackoverflow.com/comment/45151542
has comment: http://stackoverflow.com/comment/45114641
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45270865
has comment: http://stackoverflow.com/comment/45114744
has answer: http://stackoverflow.com/a/51007497
tagged with: excel
tagged with: charts
linked to: http://stackoverflow.com/q/7325363

http://stackoverflow.com/q/28322791
has body: I am very new to JSON and would like some inputs. I have a JSON object of address that looks like below. There are mulitple address in the same key separated by ||. Original JSON is: {"Address":"123 dead drive,camp hill,PA|| 456 N Street,Harrisburg, PA"}; I am trying to reformat this JSON to have 2 different address with comma separated as below. {"Address": "Formatted Address" : "Street Address":"123 dead drive" "City": "camp hill" "State": "PA" , "Formatted Address" : "Street Address":"456 N Street" "City": "Harrisburg" "State": "PA" } I am trying something like this $(function() { var resultJSON = '{"Address":"123 dead drive,camp hill,PA || 456 N Street,Harrisburg, PA"}'; var result = $.parseJSON(resultJSON); var splitresult = result.Address.split("||"); address = []; $(splitresult).each(function(index) { address.push({'Formatted': splitresult[index]}); }); var json0bj = JSON.stringify(address); console.log(json0bj); });
has answer: http://stackoverflow.com/a/28322998
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44993485
answer count: 1
accepted answer: http://stackoverflow.com/a/28322998
has title: Formatting JSON object and adding new keys to the structure
tagged with: http://stackoverflow.com/tag/json
type: Question
type: AnsweredQuestion

http://stackoverflow.com/comment/44940322
score: 0
comment on: http://stackoverflow.com/q/28293399
type: Comment
type: QuestionComment
has text: `JSON.parse()` takes a JSON string as a parameter, not a filename. You'll have to load the file first with other means.

http://stackoverflow.com/q/28285793
has comment: http://stackoverflow.com/comment/44926073
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/44925929
has comment: http://stackoverflow.com/comment/44926227
has body: Recently I've started learning JavaScript in use with HTML. I wanted to create a simple calculator for a game I am using. You select a type of ore, the amount of the ore left in the asteroid, the value mined each cycle, and the duration of one cycle, and the script is supposed to return the volume of ore to be mined and number of cycles required as well as their total duration. I've tried several things, like enclosing the function in try statement, but that didn't work either. I am asking for your help trying to figure out what I did wrong and point me in the right way. Thanks in advance. Mining Calculator - IndX: Industry Extension Ore: Veldspar Scordite Pyroxeres Plagioclase Omber Kernite Jaspet Hemorphite Gneiss Dark Ochre Spodumain Crokite Arkonor Mercoxit Amount: Yield: Cycle duration:
accepted answer: http://stackoverflow.com/a/28286135
type: AnsweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/44925695
type: Question
linked to: http://stackoverflow.com/q/2282140
tagged with: javascript
linked to: http://stackoverflow.com/q/5431351
has title: JavaScript Doesn't Output Any Value
has comment: http://stackoverflow.com/comment/44925901
has comment: http://stackoverflow.com/comment/44926075
has answer: http://stackoverflow.com/a/28286135
has comment: http://stackoverflow.com/comment/44926080
has comment: http://stackoverflow.com/comment/44925953

http://stackoverflow.com/a/28289431
downvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/44932590
score: 1
has comment: http://stackoverflow.com/comment/44932621
answers question: http://stackoverflow.com/q/28289424
has body: Why does your if not have brackets to surround the case? It only runs the 1st line after it, which is fine. It just tends to be good practice to surround your cases with brackets Also, in your if you are setting names[i] to ' '. You need to use the double equals operator. Change this: if (names[i] = '') To this: if (names [i] == ' ')
upvote count: 2

http://stackoverflow.com/q/28417769
has comment: http://stackoverflow.com/comment/45169632
has comment: http://stackoverflow.com/comment/45168946
has body: (Newb here) I have a PHP function that gets 2 csv files from the server and create a new one with the difference between values contained in those files. This PHP function is inside a separate file test.php and looks like this: &lt;?php require_once('libs/parsecsv-for-php-master/parsecsv.lib.php'); $csv1name = $_POST['csv1']; $csv2name = $_POST['csv2']; $data1 = 'data/'.$csv1name.'.csv'; $data2 = 'data/'.$csv2name.'.csv'; $csv1 = new parseCSV($data1); $csv2 = new parseCSV($data2); $csv = new parseCSV(); $csv-&gt;data[0] = array('label','difference'); $j = 1; for ($i = 0; $i &lt; count($csv1-&gt;data); $i++) { $csv-&gt;data[$i+1] = array($j.'d',$csv1-&gt;data[$i][$csv1name] - $csv2-&gt;data[$i][$csv2name]); if($i == 0) {$j += 20;} else {$j += 21;} } $csv-&gt;save('test.csv'); ?&gt; This function works correctly and produces the expected csv file. I have a JavaScript function that sits on another page (namely update.html) and calls the aforementioned php function via ajax: function callPHP() { $.ajax({ type:"POST", url:"test.php", dataType:"json", data:{csv1: '02-01-2015', csv2: '02-12-2014'}, error: function(requestObject, error, errorThrown) { alert(error); alert(errorThrown); }, }); } PROBLEM: The error function is always executed, that is, whenever I run callPHP() I get two alerts. QUESTION: Why is it error always being called? (Extra: Is it possible to work with the response variable? How can I debug it without having to upload my files to a server every time? Is it guaranteed that when the complete function is called, the $csv-&gt;data function was already resolved?) Thanks for helping!!! :D UPDATE 1: I changed the code above by removing the complete function from ajax and I added some extra parameters to the error function.
has comment: http://stackoverflow.com/comment/45169080
has title: jQuery.ajax + php 5.3 - always executing error function
answer count: 2
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45168912
tagged with: ajax
has answer: http://stackoverflow.com/a/28418132
score: 0
tagged with: http://stackoverflow.com/tag/csv
has comment: http://stackoverflow.com/comment/45169490
has comment: http://stackoverflow.com/comment/45169687
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/45169062
type: Question
has comment: http://stackoverflow.com/comment/45169383
has comment: http://stackoverflow.com/comment/45169810
has answer: http://stackoverflow.com/a/28417940

http://stackoverflow.com/a/28417159
has body: There's so many errors on your script and logic. Also, when getting geolocation coords a assync call is made. Try it out: var DistanceCalc = function(latitudeB, longitudeB, onReadyCallback) { this.latitudeB = latitudeB; this.longitudeB = longitudeB; this.callback = onReadyCallback; //calling this.calc() here is ok... }; DistanceCalc.prototype.calc = function() { var __calc = function(position) { var lat1 = position.coords.latitude; var lon1 = position.coords.longitude; var lat2 = this.latitudeB; var lon2 = this.longitudeB; var R = 6371; // km var dLat = (lat2-lat1)*Math.PI/180; var dLon = (lon2-lon1)*Math.PI/180; var a = ( Math.sin(dLat/2) * Math.sin(dLat/2) + Math.cos(lat1*Math.PI/180) * Math.cos(lat2*Math.PI/180) * Math.sin(dLon/2) * Math.sin(dLon/2) ); var c = 2 * Math.asin(Math.sqrt(a)); var d = R * c; var result = d.toFixed(1); this.callback(result); }.bind(this); //bind to DistanceCalc object context if (navigator.geolocation) { navigator.geolocation.watchPosition(__calc); } else { console.log("geolocation is not available"); this.callback(null); } }; function doSomething(result) { console.log("&gt;&gt;&gt; ", result); } var calculator = new DistanceCalc(44.35678, 33.78546, doSomething); calculator.calc();
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28414199
type: Answer
answers question: http://stackoverflow.com/q/28414199

http://stackoverflow.com/q/28344494
answer count: 3
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/57488634
upvote count: 7
has comment: http://stackoverflow.com/comment/45033910
possible better answer: http://stackoverflow.com/a/37223355
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45033330
has answer: http://stackoverflow.com/a/28344837
has comment: http://stackoverflow.com/comment/45033236
has comment: http://stackoverflow.com/comment/45034031
has answer: http://stackoverflow.com/a/37223355
score: 7
tagged with: google-chrome
accepted answer: http://stackoverflow.com/a/28344837
type: Question
tagged with: internet-explorer
has body: I have a simple input field: &lt;input id="myInput" class="someClass"&gt;&lt;/input&gt; and some JQuery code: $(e.currentTarget).prop('readonly', true); where e.currentTargetis that [object HTMLInputElement] as IE11 names it. I'm only trying to set this input field to be readonly. In chrome that code works but in IE not. I tried already: .prop('readonly','readonly'); .prop('readonly', ''); .attr('readonly', true); but none of them works in IE11 ( in chrome everyone of them works)
has title: Can not set readonly on input field in IE
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45033292

http://stackoverflow.com/comment/45115522
type: Comment
type: QuestionComment
has text: @dandavis - How is the Ajax better secured?
score: 0
comment on: http://stackoverflow.com/q/28388731

http://stackoverflow.com/comment/45130601
has text: *"So how can I grab the last value of the file with the help of javascript?"* You'd be much better off doing it server-side with PHP, and then just outputting that value in response to the ajax call.
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28397347

http://stackoverflow.com/q/28409784
has title: jQuery Ajax post is not running the Controller Action
accepted answer: http://stackoverflow.com/a/28411280
has comment: http://stackoverflow.com/comment/45153071
has comment: http://stackoverflow.com/comment/45153206
has body: I have this jQuery-script: var registrationModel = { SurName: document.getElementById("SurName").value, LastName: document.getElementById("LastName").value, Email: document.getElementById("Email").value, PhoneNumber: document.getElementById("PhoneNumber").value, Password: document.getElementById("Password").value, Name: document.getElementById("Name").value, Street: document.getElementById("Street").value, ZipCode: document.getElementById("ZipCode").value, City: document.getElementById("City").value, Country: document.getElementById("Country").value }; $.ajax({ url: '@Url.Action("SaveRegisterDetailsToDb")', type: "POST", data: JSON.stringify(registrationModel), contentType: "application/json" }); And I have this Controller Action (user and company is set globally on the Controller): [HttpPost] public async Task&lt;ActionResult&gt; SaveRegisterDetailsToDb(RegisterViewModel model) { //Skapa ApplicationUser i db user.UserName = model.Email; user.Email = model.Email; user.PhoneNumber = model.PhoneNumber; user.SurName = model.SurName; user.LastName = model.LastName; company.CompanyIdentity = model.CompanyIdentity; company.Name = model.Name; company.Street = model.Street; company.ZipCode = Convert.ToInt32(model.ZipCode); company.City = model.City; company.Country = model.Country; user.WorkPlaceId = company.CompanyIdentity; var result = await UserManager.CreateAsync(user, model.Password); if (result.Succeeded) { await UserManager.AddToRoleAsync(user.Id, "Customer"); //Spara Company mot db. var db = new IdentityDb(); db.Companies.Add(company); db.SaveChanges(); } else { AddErrors(result); } return View("Login"); } And this is my model: public class RegisterViewModel { //Constructor public RegisterViewModel() { _companyIdentity = Guid.NewGuid().ToString(); } [Display(Name = "Användarnamn")] public string UserName { get; set; } [Required] [Column("SurName")] [Display(Name = "Förnamn")] public string SurName { get; set; } [Required] [Column("LastName")] [Display(Name = "Eftern…
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45153305
has comment: http://stackoverflow.com/comment/45154849
has comment: http://stackoverflow.com/comment/45153311
downvote count: 0
has comment: http://stackoverflow.com/comment/45153941
has comment: http://stackoverflow.com/comment/45153053
has answer: http://stackoverflow.com/a/28411280
type: Question
score: 3
has comment: http://stackoverflow.com/comment/45153664
has comment: http://stackoverflow.com/comment/45155896
has comment: http://stackoverflow.com/comment/45153292
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/45153249
has comment: http://stackoverflow.com/comment/45155439
has comment: http://stackoverflow.com/comment/45155931
upvote count: 3
has comment: http://stackoverflow.com/comment/45155393
has comment: http://stackoverflow.com/comment/45154023
answer count: 1
has comment: http://stackoverflow.com/comment/45154256
tagged with: javascript
has comment: http://stackoverflow.com/comment/45155123
tagged with: jquery
favorite count: 0
tagged with: ajax

http://stackoverflow.com/q/28421327
score: 4
has answer: http://stackoverflow.com/a/28421765
type: Question
has title: Extract name and email from string in JS
has body: How can I extract the name and email from a string, where emails are separated by commas. The regex below works great for individual emails, but not for emails within a string. (?:"?([^"]*)"?\s)?(?:&lt;?(.+@[^&gt;]+)&gt;?) Note the comma within the name as well. johndoe@baidu.com, John &lt;johndoe@google.com&gt;, John D, A &lt;johndoe@bing.com&gt;, "John Doe , Yen" &lt;johndoe@163.com&gt; Output: Name: null Email: johndoe@baidu.com Name: John Email: johndoe@google.com Name: John D, A Email: johndoe@bing.com Name: John Doe , Yen Email: johndoe@163.com
answer count: 2
tagged with: email
downvote count: 0
has answer: http://stackoverflow.com/a/28421770
accepted answer: http://stackoverflow.com/a/28421770
favorite count: 0
linked to: http://stackoverflow.com/q/14010875
has comment: http://stackoverflow.com/comment/45176872
upvote count: 4
tagged with: regex
possible better answer: http://stackoverflow.com/a/28421765
has comment: http://stackoverflow.com/comment/45175773
type: AnsweredQuestion
tagged with: javascript

http://stackoverflow.com/comment/45090240
has text: `type="text/javascript"` is standard. Did this really solve the issue?
comment on: http://stackoverflow.com/a/28373745
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28381737
accepted answer of: http://stackoverflow.com/q/28381671
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28381671
type: Answer
upvote count: 3
score: 3
has body: When specifing a function in ng-click you dont need {{}} {{item.name}} Your function then looks something like this: $scope.functionToInvoke = function(var, static){ console.log('This is the variable:' + var); console.log('This is the static:' + static); }

http://stackoverflow.com/q/28435162
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45200336
has body: I dont know why, but with this code: $(document).ready(function(){ $("#errorTitle").change(getErrors()); function getErrors(){ console.log($(".nombre").val()+"/"+$(".email").val()); if($("#nombre").val() === "" || $("#nombre").val() === "undefined"){ $("#nombre").addClass("error"); }else{ $("#nombre").removeClass("error"); } if($("#email").val() !== "" && $("#email").val() !== "undefined"){ $("#email").removeClass("error") }else{ $("#email").addClass("error"); } } }); The function executes before I change anything, and if I try with the click() event it happens exactly the same. I´m just trying to change the background color with the most simple way of validation to change the error at my wish. Nombre* Email* He leído y acepto la política de privacidad <?=$error?> ENVIAR
upvote count: 0
has title: jQuery change() executes when reload
tagged with: jquery
has answer: http://stackoverflow.com/a/28435317
favorite count: 0
type: Question
tagged with: css
score: -1
answer count: 3
has answer: http://stackoverflow.com/a/28435196
has answer: http://stackoverflow.com/a/28435211
downvote count: 1
tagged with: javascript

http://stackoverflow.com/comment/45098120
has text: @CandiedOrange what function/method would give me two consecutive pairs?
score: 0
comment on: http://stackoverflow.com/q/28379196
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28417831
tagged with: oauth-2.0
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28420122
downvote count: 0
linked to: http://stackoverflow.com/q/3487991
tagged with: javascript
tagged with: security
has title: In JS web apps, how is it ensured that a malicious user with the access token will not be able to refresh it?
answer count: 1
favorite count: 0
tagged with: oauth
type: UnansweredQuestion
has body: I find ensuring safety for OAuth with JS apps a̶ ̶p̶a̶i̶n̶ ̶i̶n̶ ̶t̶h̶e̶ ̶a̶.̶.̶.̶ very annoying :( Let's imagine I am Alice, a legal user, using a JS single page app client of an OAuth server. I have logged in and received my tokens (access and refresh). At some point, unfortunately, my still valid access token and the refresh token are retrieved by a malicious user, Bob (note that there is no reason only the refresh token could be retrieved since both are sent back by the OAuth server the same way). Ok, so what I'm understanding from this question is that, well, that does not matter that much because evil Bob will only have a limited amount of time to do bad stuff, since the token has a short life. Now let's assume the token has expired. In theory, all should be over for Bob. But I do not understand what now prevents Bob to request a new token. What does Alice has that Bob does not so that only Alice can get a new access token? Let's now think of slightly different client configuration: there is still a JS web app, but this time the actual OAuth client is a PHP backend the JS client makes requests to. This PHP back-end acts as a sort of proxy and, as any OAuth client, makes/forwards requests to the OAuth server. In this case, the refresh token could have been kept secret by the back-end, and Bob would have only retrieved the access token. But in this case, again, except from the this now expired access token, that Bob do know, what data can Alice give the back-end so that it differentiates between her and Bob so that the refreshing process is only done for Alice?
score: 1

http://stackoverflow.com/q/28320135
favorite count: 0
tagged with: cordova-plugins
tagged with: cordova
has answer: http://stackoverflow.com/a/28410987
tagged with: android
has body: I am trying to use the sms-reception-plugin. I created the plugin.xml SmsReception Cordova SmsReception Plugin Apache 2.0 cordova,smsreception <clobbers target="cordova.plugin" /> <source-file src="src/android/SmsInboxPlugin.java" target-dir="src/org/apache/cordova/plugin" /> <source-file src="src/android/SmsReceiver.java" target-dir="src/org/apache/cordova/plugin" /> Then i used this code in .html var smsPlugin = cordova.require('cordova/plugin/smsplugin'); still its showing the error Uncaught module cordova/plugin/smsplugin not found I created the plugin.xml as described in here. If any body have any idea help me.
score: 2
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28322400
downvote count: 0
has answer: http://stackoverflow.com/a/28322400
has comment: http://stackoverflow.com/comment/44989134
has comment: http://stackoverflow.com/comment/44989298
type: Question
upvote count: 2
tagged with: javascript
answer count: 2
accepted answer: http://stackoverflow.com/a/28410987
has title: cordova: module "cordova/plugin/SmsInboxPLugin not found

http://stackoverflow.com/a/28353741
answers question: http://stackoverflow.com/q/28346733
type: Answer
has body: That is only expected behavior, because you used for="k". The for attribute will target the id="k", and whenever you clicked on label it will focus element with id="k" which you mention in for attribute. Remove attribute for="k" from label will work proper on each browser. HTML {{checkText}} NOTE This is not angular related issue JS BIN Hope this could help you, Thanks.
accepted answer of: http://stackoverflow.com/q/28346733
score: 0
type: AcceptedAnswer

http://stackoverflow.com/q/28419792
downvote count: 0
score: 1
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45173065
tagged with: angular-directive
has answer: http://stackoverflow.com/a/28420497
type: AnsweredQuestion
has title: How to call my own function inside an Angular Directive?
possible better answer: http://stackoverflow.com/a/28420393
upvote count: 1
has answer: http://stackoverflow.com/a/28420393
has answer: http://stackoverflow.com/a/28419909
type: Question
accepted answer: http://stackoverflow.com/a/28419909
tagged with: javascript
has body: I'd like to call "myFunc()" inside my angular directive, how might I do this? myApp.directive("test", function () { return { restrict: 'A', template: "&lt;div class='box'&gt;&lt;/div&gt;", myFunc: function() { console.log('myFunc'); }, link: function ($scope, element, attrs) { element.bind('click', function () { myFunc(); //&lt;------------- doesn't work }); } } // of return });
answer count: 3

http://stackoverflow.com/q/28355602
type: AnsweredQuestion
type: Question
possible better answer: http://stackoverflow.com/a/28355700
tagged with: slideshow
tagged with: javascript
has title: What's Wrong With My JavaScript Slideshow?
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28355700
has answer: http://stackoverflow.com/a/28355861
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28355861
has body: I've been building a slideshow with JavaScript, and I can't seem to get it to work. I think part of the issue might be my referencing of an external .js file...I'm not sure if I am doing that properly with href. However, I've tried putting the script in the head on my HTML page and using the href:ecoquiet.html instead, but that didn't work either. My HTML: Previous Next Auto My JavaScript: function change_image (num) { var image = new Array("lawn.jpg", "nicelawn.jpg", "eco.png"); var description = new Array("100% Organic", "Gasoline-Free", "75% Quieter"); var = Image_Number = 0; var = Image_Length = Image.length - 1; Image_Number = Image_Number + num; if (Image_Number > Image_Length) { Image_Number = 0; } if (Image_Number < 0) { Image_Number = Image_Length; } document.slideshow.src=Image[Image_Number]; document.getElementById("decription").innerHTML = description[Image_Number]; return false; } function auto () { setInterval("change_image(1)", 3000); }

http://stackoverflow.com/a/28389857
score: 3
has comment: http://stackoverflow.com/comment/45117187
has comment: http://stackoverflow.com/comment/45117177
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28389746
has body: I'm assuming that you are asking more about the process to sort an array based on the values / indexes of another. Otherwise, there would be no reason to sort. You can try using Array.prototype.sort() with something like this: var string = "first;second;third;last".split(';'), items = ["third", "first", "last", "second"], result = []; result = items.sort(function(a,b) { return string.indexOf(a) - string.indexOf(b) }); document.getElementById("output").innerHTML = JSON.stringify(result); Here's a JSFiddle example. --edit-- As per the comments, this should be more performance-friendly: var string = "first;second;third;last".split(';'), stringHash = {}, items = ["third", "first", "last", "second"], result = []; for (var i = 0, j = string.length; i &lt; j; i++) { stringHash[string[i]] = i; } result = items.sort(function(a,b) { return stringHash[a] - stringHash[b]; }); document.getElementById("output").innerHTML = JSON.stringify(result); You will be adding in an extra step, so if the original arrays are small it may not be worth it. If the arrays are larger, though, this will perform significantly better.
type: Answer
has comment: http://stackoverflow.com/comment/45117208
accepted answer of: http://stackoverflow.com/q/28389746
upvote count: 3

http://stackoverflow.com/comment/45170148
type: Comment
comment on: http://stackoverflow.com/a/28417940
type: AnswerComment
score: 0
has text: You can use firebug net pannel to see the response coming back. Check to make sure you are getting a 200 success response for your ajax call.

http://stackoverflow.com/a/28400257
has comment: http://stackoverflow.com/comment/45138427
downvote count: 0
has comment: http://stackoverflow.com/comment/45138049
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/28400187
has body: You can do this with $.fadeIn and $.fadeOut: var text = ["ease your mind.", "focus.", "sleep better."]; var counter = 1; var elem = document.getElementById("changeText"); setInterval(change, 2000); function change() { $(elem).fadeOut(400, function() { $(elem).html(text[counter++]).fadeIn(400); if (counter >= text.length) counter = 0; }); } ease your mind.

http://stackoverflow.com/comment/45184324
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28426145
type: Comment
has text: I have used 'jsonp' as datatype because 'json' is not supported for receiving cross site json data in jQuery as far as I know.

http://stackoverflow.com/comment/45214496
comment on: http://stackoverflow.com/q/28428338
has text: Well it's weird that you get an access denied error... Please post some code, how you create that `iframe`!
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28319318
has answer: http://stackoverflow.com/a/28328848
upvote count: 1
type: AnsweredQuestion
score: 1
type: Question
tagged with: google-apps-script
tagged with: google-sheets
downvote count: 0
tagged with: javascript
has body: I have simple script to send e-mail based on data in spreadsheet. Column 1 is Subject. Column 2,3,4,5 is body. The problem is - the dipper I am in spreadsheet - the more commas script send in the end of e-mail message. If this is 1st row - no additional commas. 2nd row - 2 commas, 3rd row - 4 commas and so on. How to get rid of these not required commas? I am really sorry for this newbie question. The code is function sendEmails() { var time = new Date; Logger.log(time); var sheet = SpreadsheetApp.getActiveSheet(); var hojaRegistro = SpreadsheetApp.getActive(); var activeRow = hojaRegistro.getActiveCell().getRow(); var subject = sheet.getRange(activeRow, 1, activeRow, 1).getValues(); var message = sheet.getRange(activeRow, 2, activeRow, 5).getValues(); MailApp.sendEmail('my@mymail.com', subject, message); sheet.getRange(activeRow, 6).setValue('E-mail sent on ' +time); SpreadsheetApp.flush(); } function onOpen() { var sheet = SpreadsheetApp.getActiveSpreadsheet(); var entries = [{ name : "Send Email", functionName : "sendEmails" }]; sheet.addMenu("Script Center Menu", entries); };
accepted answer: http://stackoverflow.com/a/28328848
answer count: 1
favorite count: 0
has title: Google apps script return correct values + multiple not required commas

http://stackoverflow.com/comment/45197861
comment on: http://stackoverflow.com/q/28433786
type: QuestionComment
has text: It seems like you're trying to remove the loading html but, why not just `.hide()` it?
type: Comment
score: 0

http://stackoverflow.com/comment/45091742
comment on: http://stackoverflow.com/q/28375676
type: Comment
type: QuestionComment
score: 0
has text: @T.J.Crowder ok. I'll edit it. I had linked the fiddle so that it would be easier for the users to run it and see.

state
tag name: state
tags question: http://stackoverflow.com/q/28435915
tags question: http://stackoverflow.com/q/28394226
tags question: http://stackoverflow.com/q/28414836
type: Tag
tags question: http://stackoverflow.com/q/28385501
tags question: http://stackoverflow.com/q/28380709

http://stackoverflow.com/comment/44999893
has text: This works great! Only a minor flaw: the panel doesn't close when clicking the empty space at right or left of the label. Could you please explain me what does "$(event.target).closest( "#contacts" ).length" actually mean?
type: Comment
comment on: http://stackoverflow.com/a/28325797
type: AnswerComment
score: 0

http://stackoverflow.com/q/28402057
has answer: http://stackoverflow.com/a/28402076
has title: regex in javascript
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45139605
tagged with: javascript
type: Question
has comment: http://stackoverflow.com/comment/45139380
tagged with: regex
accepted answer: http://stackoverflow.com/a/28402076
has body: Hey there how do I escape ' and " using javascript regex? because I want Annie said, "It's really funny." to be like, Annie said, \"It\'s really funny.\"
has comment: http://stackoverflow.com/comment/45139548
score: 0
answer count: 1

http://stackoverflow.com/q/28338450
tagged with: google-chrome-extension
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28352982
has title: Prevent removal of DOM elements on the Tumblr dashboard
has comment: http://stackoverflow.com/comment/45076236
tagged with: tumblr
type: Question
has comment: http://stackoverflow.com/comment/45075640
score: 4
has body: I decided to keep the posts displayed on the dashboard by my extension inside the #posts element. Now my problem is that Tumblr automatically removes posts' content while scrolling. Here is an example of a normal post before the removal: And the same post, after the removal of its content: Since that my extension re-positions the posts into a pinterest-like layout, the removal of posts' content messes up the entire layout. Is it possible to stop the Tumblr dashboard from removing the DOM elements inside each .post? EDIT: I added this injection code for the removeChild method in my content script: function addScript(){ var script = document.createElement('script'); script.id = 'newRemoveChildScript'; ///just to find is faster in the code script.src = chrome.extension.getURL("injectedCode.js"); $($('script')[0]).before(script); ///Script is indeed present, I checked that } window.onload = addScript; The next I did, was to create the injectedCode.js file with the second version, looking like this: (function (obj, method) { function isPost(el) { return (/^post_\d+$/.test(el.id) && ~el.className.indexOf('post')); } obj[method] = (function (obj_method) { return function (child) { if (isPost(child)) return child; return obj_method.apply(this, arguments); } }(obj[method])); }(Element.prototype, 'removeChild')); When I load the Tumblr-Dashboard I can confirm that the Script-element is present in the head-element. The file is also properly linked, because the 'removeChild' function is called once. A script element is being removed there, it seems. From that point on, the function is never called again and I can see those 'empty' posts again.
upvote count: 4
has comment: http://stackoverflow.com/comment/45076117
downvote count: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45063748
favorite count: 0
has answer: http://stackoverflow.com/a/28352982

http://stackoverflow.com/q/28390225
tagged with: express
has body: I'm having trouble setting up my www file, the file responsible for running my application both in my development environment, such as the production environment. I'm constantly developing new things for my application on my development environment, then sending for the production, and I would like to set up my file responsible for creating the server and make it run in a dynamic way, without changing all the time that i need send to the production. What I need is to make the following code to understand what environment the application is and apply the correct settings, without having to be manually. This is the code that i am using in my development environment: var app = require('../app'); var debug = require('debug')('myapp'); var http = require('http'); var server = http.createServer(app); server.listen(3000, "0.0.0.0", function() { var addr = server.address(); debug('Running on port ' + addr.address + ':' + addr.port); });
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/45118417
has title: How set the create server dynamically for the development and production environment? [Node.js]
favorite count: 0
duplicate of: http://stackoverflow.com/q/10714315
type: UnansweredQuestion
tagged with: node.js
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/28390284
type: Question
linked to: http://stackoverflow.com/q/10714315
tagged with: server
tagged with: javascript

http://stackoverflow.com/comment/45123304
type: Comment
has text: Ye I'm using a service which holds a bunch of shared properties. I got it working with the loop :) Thanks a lot for the help!
comment on: http://stackoverflow.com/a/28393027
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44942767
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28295139
score: 2
has text: Are you using jQuery? And where is _send_ button?

http://stackoverflow.com/q/28329000
has body: I have almost the exact same snippet of code in other areas of my application and it works perfectly fine. I'm pushing an object into an empty array and have an ng-repeat in my view. JavaScript: $scope.upload = $upload.upload({ url: BASE + 'files/tasks', file: file, data: data }).success(function(data) { for(var i = 0; i < $scope.case.task.notes.length; i++) { if($scope.case.task.notes[i].in_api === false) { $scope.case.task.notes[i].documents.push(data); } } }); When I console.log the $scope.case.task.notes after adding the JSON response to the array, I see the expected result (the note object along with the documents array, with the returned object in the documents array). In my view, the page has the HTML below augmented with Angular templating: {{document.name}} download When I first load the page, all of the notes that do have documents show up correctly. However, when the success function is called from the above upload function, and the document is pushed onto the note's array, it does not appear in the view. If it makes a difference, the HTML above is also surrounded inside of an ng-repeat that iterates over every note (so it's multi-level). What could be the problem? The JavaScript function is functioning appropriately but the view is not updating when the model does.
has title: JavaScript array.push (object) with Angular ng-repeat not functioning as expected
score: 1
has answer: http://stackoverflow.com/a/28329198
upvote count: 1
type: Question
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45005625
answer count: 2
has answer: http://stackoverflow.com/a/28329122
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/q/28320624
has answer: http://stackoverflow.com/a/44908929
possible better answer: http://stackoverflow.com/a/34081735
has answer: http://stackoverflow.com/a/34081735
has answer: http://stackoverflow.com/a/30457538
downvote count: 0
tagged with: javascript
favorite count: 0
upvote count: 8
has comment: http://stackoverflow.com/comment/48545481
has answer: http://stackoverflow.com/a/58309463
has title: TypeError: Cannot read property 'Roboto-Regular.ttf' of undefined
answer count: 4
score: 8
accepted answer: http://stackoverflow.com/a/30457538
tagged with: pdfmake
has body: Trying to build a PDF using the JS API PdfMake : Then according to this Helloworld , i run : var docDef={ content: 'This is an sample PDF printed with pdfMake' } pdfMake.createPdf(docDef).download('optionalName.pdf'); i've got this error : Uncaught TypeError: Cannot read property 'Roboto-Regular.ttf' of undefined Does Roboto-Regular.ttf File is required ? And Where to put it ,if so ?
type: Question
type: AnsweredQuestion

http://stackoverflow.com/comment/45140658
score: 0
type: Comment
has text: Hi Dominik Yakoubek, I Updated the code above. I am just adding on to the earlier text the new selection. I hope this is how you need it? Thanks
type: AnswerComment
comment on: http://stackoverflow.com/a/28402597

http://stackoverflow.com/comment/45170466
comment on: http://stackoverflow.com/a/28416279
score: 0
type: AnswerComment
type: Comment
has text: i've tried that already and it doesn't seem to work. something like ' responseData.testing = "AAAAA";' has no effect, i don't see 'testing' anywhere. @AlfredoDelgado

http://stackoverflow.com/comment/45186736
has text: In the console i just get "NaN NaN"
type: Comment
comment on: http://stackoverflow.com/q/28427434
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45163697
type: Comment
comment on: http://stackoverflow.com/a/28413996
score: 0
type: AnswerComment
has text: Edit your question with what you did (add the code).

http://stackoverflow.com/q/28305024
type: AnsweredQuestion
has title: Disable select box and enable textbox using one checkbox with JavaScript
upvote count: 0
type: Question
has answer: http://stackoverflow.com/a/28305076
accepted answer: http://stackoverflow.com/a/28305076
has answer: http://stackoverflow.com/a/28305340
tagged with: javascript
has answer: http://stackoverflow.com/a/28305175
score: -1
answer count: 3
downvote count: 1
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28305175
has body: I'm am fairly new to JavaScript; I have been googling all day for this but i only found how to enable and disable one textbox using one checkbox. Here is my code JavaScript function enable_text(status){ status=!status; document.sr2.other_text.disabled = status; } HTML &lt;form name=sr2 method=post&gt; &lt;input type="checkbox" name=others onclick="enable_text(this.checked)"&gt; Others &lt;input type=text name=other_text&gt; &lt;/form&gt; Note: the code I posted is only for a textbox that when uncheck in checkbox it will be enabled. My question is how do you disable select tag and enable a textbox after unchecking a checkbox?

http://stackoverflow.com/q/28434311
has answer: http://stackoverflow.com/a/33730390
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28435037
has body: /How/ Can I disable the “You've gone full screen” notification in Chrome with chrome extension? I have got this manifest.json: { "name": "Me", "description": "Disable Fullscreen notification", "version": "2.0", "permissions": [ "activeTab" ], "browser_action": { "default_title": "Make this page red", "default_icon": "icon.png" }, "manifest_version": 2 }
has answer: http://stackoverflow.com/a/28435037
has comment: http://stackoverflow.com/comment/45198702
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/45198849
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45198746
upvote count: 5
has answer: http://stackoverflow.com/a/28434754
tagged with: javascript
answer count: 3
favorite count: 0
has title: Can I disable the “You've gone full screen” notification in Chrome with chrome extension?
accepted answer: http://stackoverflow.com/a/28434754
tagged with: google-chrome-extension
tagged with: http://stackoverflow.com/tag/html
score: 4

http://stackoverflow.com/comment/45177187
has text: It doesn't work that way, that's why there is a callback function.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28422058
score: 1

http://stackoverflow.com/q/28290821
has comment: http://stackoverflow.com/comment/44935182
has body: I've got an element that I want to determine its height and width so I can fill it properly, but when I use $('#element').height(); $('#element').width(); it returns the values in percentages. I've been looking for a solution, but all the questions that come up in my searches imply that jQuery returns the pixels by default, and so do not explain how to get it to do so.
linked to: http://stackoverflow.com/q/9117738
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28290875
has title: .height() returns height in percent, how to get it in pixels
has answer: http://stackoverflow.com/a/28290944
answer count: 2
has answer: http://stackoverflow.com/a/28290875
upvote count: 1
tagged with: width
tagged with: javascript
tagged with: jquery
favorite count: 0
score: 0
possible better answer: http://stackoverflow.com/a/28290944
has comment: http://stackoverflow.com/comment/44935698
downvote count: 1
tagged with: height

http://stackoverflow.com/q/28327140
upvote count: 3
answer count: 2
has answer: http://stackoverflow.com/a/28327210
accepted answer: http://stackoverflow.com/a/28327210
has comment: http://stackoverflow.com/comment/45002011
tagged with: proj4js
favorite count: 0
has body: I'm having trouble with including the proj4.js JavaScript library in my code. The code looks like this: Proj4js Testing But it never gives me a message saying "Done!". I'm having very little knowledge about JavaScript, but I can't see the problem in this code. I followed the user guide on GitHub.
type: AnsweredQuestion
has title: How to include JavaScript libraries?
downvote count: 0
has answer: http://stackoverflow.com/a/28327197
type: Question
score: 3
possible better answer: http://stackoverflow.com/a/28327197
tagged with: javascript

http://stackoverflow.com/a/28392360
has comment: http://stackoverflow.com/comment/45150143
has comment: http://stackoverflow.com/comment/45239241
score: 0
type: Answer
has body: You can try like this DEMO function someJSON() { var resp = $.ajax({ dataType: "json", url: "http://somewebsite.com/api/?callback=?" }) .success(function (data) { }); return resp; }; someJSON().success(function (data) { console.log(data); }); Hope this helps, Thank you.
has comment: http://stackoverflow.com/comment/45164685
has comment: http://stackoverflow.com/comment/45127344
answers question: http://stackoverflow.com/q/28391528

http://stackoverflow.com/comment/45247377
comment on: http://stackoverflow.com/a/28324267
type: Comment
score: 1
has text: Why is the necessity to trap element click event not mentioned in the official backbone documentation?
type: AnswerComment

http://stackoverflow.com/comment/76299545
type: Comment
comment on: http://stackoverflow.com/a/44656670
has text: Welcome to Stack Overflow! Please feel free to take a [tour](//stackoverflow.com/tour) of the site, and if you need additional help with the site, check [this](//stackoverflow.com/help) out. Oh, and if you ever run into issues that the help page doesn't cover, feel free to ask on [meta](//meta.stackoverflow.com/).
type: AnswerComment
score: 0

http://stackoverflow.com/q/28312778
has body: I've encountered a problem, when I wrote some small program. There is an SVG textNode: textMeasureNode.style.cssText "font-family: "Open Sans", Arial, Helvetica, sans-serif; font-size: 22px; font-style: oblique; font-weight: normal; fill: #333333;" and textMeasureNode.textContent "Q1" When I call the function: textMeasureNode.getComputedTextLength() I get different values in IE and Chrome. IE: 49.269996643066406 Chrome: 29.34765625 It seems, that font-style: oblique affects these results. Has anyone encountered this problem?
tagged with: internet-explorer
has title: .getComputedTextLength() returns different values in IE and Chrome
tagged with: javascript
score: 16
answer count: 1
downvote count: 0
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
type: UnansweredQuestion
upvote count: 16
has answer: http://stackoverflow.com/a/70870387
tagged with: google-chrome
type: Question

http://stackoverflow.com/q/28378831
has title: Custom sort for US date format is not working using J-query datatable
has body: Issue with jquery datatables sorting: Hi i'm using the below code for sorting the US dates in table columns, but its not working... jQuery.fn.dataTableExt.oSort['custom_us_date-asc'] = function(x, y) { var xVal = getCustomEuroDateValue(x); var yVal = getCustomEuroDateValue(y); if (xVal &lt; yVal) { return -1; } else if (xVal &gt; yVal) { return 1; } else { return 0; } } jQuery.fn.dataTableExt.oSort['custom_us_date-desc'] = function(x, y) { var xVal = getCustomEuroDateValue(x); var yVal = getCustomEuroDateValue(y); if (xVal &lt; yVal) { return 1; } else if (xVal &gt; yVal) { return -1; } else { return 0; } } function getCustomEuroDateValue(strDate) { var frDatea = $.trim(strDate).split(' '); var frTimea = frDatea[1].split(':'); var frDatea2 = frDatea[0].split('/'); var x = (frDatea2[2] + frDatea2[1] + frDatea2[0] + frTimea[0] + frTimea[1]); x = x * 1; return x; } function tableDef(){ oTable = j$('#example').dataTable({ "bPaginate":false, "bJQueryUI": true, "aoColumns": [ null, null, null, {"stype" :"custom_us_date", "fnRender" : function(obj, val) { if(j$(val).text() != '') { var d = new Date(j$(val).text()); var month = d.getMonth() + 1; var sMonth = ''; if(month &lt; 10) sMonth = '0' + month; else sMonth = month; var day = d.getDate(); var sDay = ''; if(day &lt; 10) sDay = '0' + day; else sDay = day; var sYear = d.getFullYear(); var hour = d.getHours(); var sHour = ''; if(hour &lt; 10) sHour = '0' + hour; else sHour = hour; var minute = d.getMinutes(); var sMinute = ''; if(minute &lt; 10) sMinute = '0' + minute; else sMinute = minute; var finalString = sMonth + '/' + sDay + '/' + sYear + ' ' + sHour + ':' + sMinute; return finalString; } but it is not doing custom sort(date), its just doing string sort. Its not at all considering the custom sort for dates. I'm formatting the date in fnRender to US date format then returning the value to custom sort function using sType. I'm very new to j-query, if you can update my code, it would be highly appreciated.... Thanks fo…
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/41299379
type: UnansweredQuestion
score: 3
upvote count: 3
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/44928816
score: 0
type: Comment
type: QuestionComment
has text: At the very least, you need to put the `jquery-2.0.0.min.js` line before the `jscript.js` line, since the latter *uses* jQuery. Are you seeing any errors in the Javascript console? [How to open the JavaScript console in different browsers?](http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers)
comment on: http://stackoverflow.com/q/28287387

http://stackoverflow.com/comment/45110551
type: QuestionComment
type: Comment
has text: related: [Is it bad practice to have a constructor function return a Promise?](http://stackoverflow.com/q/24398699/1048572)
score: 1
comment on: http://stackoverflow.com/q/28375619

http://stackoverflow.com/q/28320029
tagged with: javascript
has title: Using JQuery toggle seems to interfere with CSS media queries for flexbox
has answer: http://stackoverflow.com/a/28320478
score: 0
answer count: 3
tagged with: flexbox
tagged with: jquery
has comment: http://stackoverflow.com/comment/44989186
has body: My page uses CSS media queries to display collapsible vertical menus for mobiles and standard horizontal menus for larger devices. For mobiles, the collapse is triggered by a Click function which toggles the wrapper around the menus. This works fine normally, but if the user resizes the browser window after having toggled the menus the media queries don't seem to work properly (at least not for the flexbox elements). Is this a limitation of JQuery and is there a workaround? Fiddle is here http://jsfiddle.net/nakbrooks/nyrzp4ps/1/ Full page (including JScript and CSS is here: Toggle Menus Menu 1 Menu 2 Menu 3 Menu 4 English Francais On small window widths the Menu items should appear below each other with the Language items in a row below that - all centered. On larger window widths the Menu items should appear side by side on the left and the Language items side by side on the right, all on the same line. Clicking 'Toggle Menus' hides both the Menu and Language options. Clicking again restores them. PROBLEM: If, after clicking 'Toggle Menus' to hide the items, the window is resized from big to small or vice-versa and 'Toggle Menus' is then clicked again to restore the items the display styling (block or flex) appropriate to the new window size is not applied. The JQuery script used to toggle the menu items seems to interfere with the application of the CSS media query styling (at least so far as flexbox is concerned).
tagged with: css
has answer: http://stackoverflow.com/a/28320486
accepted answer: http://stackoverflow.com/a/28320486
possible better answer: http://stackoverflow.com/a/28320478
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28320477
type: Question

http://stackoverflow.com/comment/44994061
type: QuestionComment
score: 0
has text: use $location.path() instead of window.location just like you do in RequireLoginService
comment on: http://stackoverflow.com/q/28322811
type: Comment

http://stackoverflow.com/q/28288318
upvote count: 1
tagged with: jqlite
has answer: http://stackoverflow.com/a/28288398
score: 1
has title: How To Find Elements By Id in Angular Directive Test
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
has body: I have a directive that renders the following html in a unit test: Published to QA (Jan 29, 2015) PROD (Jan 30, 2015) I am trying to get a hold of the and assert that it has two child 's in it. I have tried the following but it does not work: var environments = element.find('#published-envs'); //comes back empty What is the correct way to find elements by id in an angular unit test?
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/comment/45095755
has text: [Why don't you use georg's?](http://stackoverflow.com/a/28350435/1377002) Also, I don't think you can have question marks in method names.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28350420

http://stackoverflow.com/a/28379523
type: Answer
answers question: http://stackoverflow.com/q/28378053
score: 0
has comment: http://stackoverflow.com/comment/45115070
has comment: http://stackoverflow.com/comment/45113289
has body: Like minion stated, what exactly is sent as invoiceidcopy? From what I see the selecting the last one should send "THIS IS A TEST 2759f633-d6cb-4b3e-b4dc-3a4d0b54367..." exactly. It would be better to come up with another shorter Key for this field like "ThisIsATest-2759f633" or "ThisIsATest-201502070057". Also keep in mind that you want to sanitize the input to keep out SQL injection. Even though it is a drop down list, someone can use the HTML to change the variable.

http://stackoverflow.com/a/28472438
downvote count: 0
type: Answer
has body: It didn't work with app/index.html#/ but It worked well with app/#/, you don't need specify the index.html on URL or you can redirect directly to URL without index.html by code var url = window.location.href; if(url.indexOf("index.html") &gt; 0){ window.location.replace(url.replace("index.html","")); }
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28407576
score: 3
answers question: http://stackoverflow.com/q/28407576
type: AcceptedAnswer

http://stackoverflow.com/a/28294600
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/28294528
has body: Yes almost all browsers support the click method. The only exception being in Safari where it does not support click for anything except buttons.
accepted answer of: http://stackoverflow.com/q/28294528
score: 0

http://stackoverflow.com/comment/45165945
score: 1
has text: possible duplicate of [What is the scope of variables in JavaScript?](http://stackoverflow.com/questions/500431/what-is-the-scope-of-variables-in-javascript)
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28416384

http://stackoverflow.com/a/28314153
type: Answer
has body: This one is interesting. I originally tried to use the insertAdjacentHTML function to insert the string ' ' after the first , but strangely, the Dom rearranges these divs automatically to be ' '. So, the next best option is to just do it manually. I'm not sure if this will work in your case, but it does output the desired result with less javascript. Check out this fiddle. http://jsfiddle.net/justinbchristensen/k2y2uggj/ var div1 = document.getElementById('1'); var ps = div1.children; div1.removeChild(ps[1]); div1.insertAdjacentHTML('afterend',' abc2 '); 1) Get the div by its ID, assign it to a variable 'div1' 2) Access the 2 child of the div and assign them to 'ps' 3) Remove the second 4) Insert the entire second with its child Let me know if this will work for your situation. If not, I'm sure we can come up with something more creative.
answers question: http://stackoverflow.com/q/28313682
score: 0

http://stackoverflow.com/comment/45126436
comment on: http://stackoverflow.com/a/28394997
score: 0
type: AnswerComment
type: Comment
has text: @Quentin: Edited. I was just trying to simplify things. Anyway, edited. :)

http://stackoverflow.com/a/28371513
has comment: http://stackoverflow.com/comment/50026600
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28360386
downvote count: 0
score: 1
has body: Replace c.code with c.field("code").
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28360386

http://stackoverflow.com/a/28367279
type: Answer
has body: Without seeing a single line of code, it's hard to give a 100% accurate answer, but sounds like you need to force a scope digest cycle after pushing new markers. So, either use $scope.$apply() or wrap the push code in a $timeout callback, and you should be forcing the map update with the new markers.
has comment: http://stackoverflow.com/comment/45091389
upvote count: 1
answers question: http://stackoverflow.com/q/28367201
downvote count: 1
has comment: http://stackoverflow.com/comment/45092797
has comment: http://stackoverflow.com/comment/45075563
has comment: http://stackoverflow.com/comment/45076484
score: 0
has comment: http://stackoverflow.com/comment/45091731

http://stackoverflow.com/comment/45154765
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28410514
has text: Look like a nice approch !
score: 0

http://stackoverflow.com/a/28369883
downvote count: 0
answers question: http://stackoverflow.com/q/28369782
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/45081059
score: 1
has body: You can change to a normal array using .get() children.get().sort(someSortFunction);
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28369782

http://stackoverflow.com/comment/45164712
comment on: http://stackoverflow.com/q/28415607
has text: No difference at all. It is also not related to AngularJS. JavaScript supports both syntaxes (the latter declares the function with a name and then assigns it to a variable).
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28321833
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
tagged with: css
has body: Click here to access the website This website is developed using Javascript, CSS and HTML. We got it developed by a web designer. When we asked him to modify the site he refuses so we tried doing it by our-self. The designing part in the website is done using CSS. We wanted to put one more button(Testing Services) just before the contact us button. We did the code changes and add the button. But the problem is after adding the button we started getting two lines. First line carries 5 buttons and second line carries 2 buttons. I tried to fix the problem by changing the text size from 14px to 10px in css but after doing that the text become to small to read. Then we tried to increase the margin but won't get the result. Below is Screen shot of the menu after modification-- Below is Screen shot of the menu before modification-- Till now we have not updated the actual website so you can't see the second line on the actual website.
possible better answer: http://stackoverflow.com/a/28321956
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/28322286
has comment: http://stackoverflow.com/comment/44991606
accepted answer: http://stackoverflow.com/a/28322286
downvote count: 1
has title: Not able to put multiple boxes in a single line
type: Question
has answer: http://stackoverflow.com/a/28322173
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/28321956
has comment: http://stackoverflow.com/comment/44991572
answer count: 3

http://stackoverflow.com/q/28427434
has comment: http://stackoverflow.com/comment/45187313
has body: This code works well when i have it set as a canvas. But when i want to use it on an svg element, i get nothing. What i am trying to do is get the mouse coordinates relative to the canvas but then draw svg shapes depending on where the user clicks. It works with this html: &lt;section class=chartArea&gt; &lt;canvas id=svg&gt;&lt;/canvas&gt; &lt;/section&gt; This html does not work: &lt;section class=chartArea&gt; &lt;svg id=svg&gt;&lt;/svg&gt; &lt;/section&gt; javascript: svg = document.getElementById("svg"); function relMouseCoords(event){ var totalOffsetX = 0; //coordinates of corner of canvas var totalOffsetY = 0; var canvasX = 0; var canvasY = 0; var svg = this; //what called the event do{ totalOffsetX += svg.offsetLeft - svg.scrollLeft; //relative coordinates totalOffsetY += svg.offsetTop - svg.scrollTop; } while(svg = svg.offsetParent) canvasX = event.pageX - totalOffsetX; canvasY = event.pageY - totalOffsetY; point = {x:canvasX, y:canvasY}; console.log(canvasX + " " + canvasY); return point; //object returned } svg.addEventListener('mousemove', relMouseCoords);
has comment: http://stackoverflow.com/comment/45187163
type: Question
has answer: http://stackoverflow.com/a/28427994
tagged with: canvas
answer count: 1
has title: Why doesn't this code work for an svg element?
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28427994
tagged with: http://stackoverflow.com/tag/svg
has comment: http://stackoverflow.com/comment/45186736
has comment: http://stackoverflow.com/comment/45186787
has comment: http://stackoverflow.com/comment/45186832
has comment: http://stackoverflow.com/comment/45186631
type: AnsweredQuestion

http://stackoverflow.com/comment/45029539
comment on: http://stackoverflow.com/a/28342554
has text: _I can't use the classes as selectors_!
type: AnswerComment
type: Comment
score: 2

http://stackoverflow.com/comment/44958707
type: QuestionComment
comment on: http://stackoverflow.com/q/28303647
has text: Is "the underlying gray area" the popup mask or the wrapper around the link text?
score: 0
type: Comment

http://stackoverflow.com/q/28436824
has body: Having an issue using the ng-view to render a template from my controller. The index.html file is initially served to the client and looks like. @RenderSection("BootScript") A link here @* {{Heading}} *@ @RenderBody() the server pushes down my app.js and controllers.js file along with the deps. /// ap.js /// var hlmApp = angular.module('hlmApp', ['ngRoute', 'MyTempControllers']); hlmApp.config(['$routeProvider', function ($routeProvider) { $routeProvider.when('/Holdings', { templateUrl: 'templates/temp.html', controller: 'controllers/tempController' }); }]); the controller is pretty simple and is as follows var MyTempControllers = angular.module('MyTempControllers', []); MyTempControllers.controller('tempController', ['$scope', function () { console.log("stuff happening"); $scope.Heading = "Hello World"; }]); then the html template is as follows {{Heading}} When I use the ng-view nothing ever renders. the controller is never triggered in the debugger. If I specifically call out the controller via the ng-controller then everything shows up. can someone point out my error here?
answer count: 2
downvote count: 0
has title: AngularJS v1.3.13 ng-view not triggering controller to render template
has comment: http://stackoverflow.com/comment/45204074
tagged with: javascript
has comment: http://stackoverflow.com/comment/45204048
has answer: http://stackoverflow.com/a/28437360
has comment: http://stackoverflow.com/comment/45204317
has answer: http://stackoverflow.com/a/28437099
favorite count: 0
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/28437099
has comment: http://stackoverflow.com/comment/45204004
accepted answer: http://stackoverflow.com/a/28437360
has comment: http://stackoverflow.com/comment/45204138
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/45203898
has comment: http://stackoverflow.com/comment/45203772
upvote count: 1
type: Question

http://stackoverflow.com/q/28342553
tagged with: datepicker
tagged with: angularjs
tagged with: time
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28344204
possible better answer: http://stackoverflow.com/a/28342858
accepted answer: http://stackoverflow.com/a/28344204
tagged with: date
type: Question
answer count: 2
has title: Angular date time calculations gives wrong result
has body: Hi im working on calculating time between to dates my code $scope.startTime = new Date('0').setHours(7); $scope.endTime = new Date('0').setHours(17); $scope.breakTime = new Date('0').setMinutes(30); this.tosum = function(startTime, endTime, breakTime) { var timestamp1 = new Date(startTime).getTime(); var timestamp2 = new Date(endTime).getTime(); var timestamp3 = new Date(breakTime).getTime(); var diff = timestamp2 - timestamp1 - timestamp3; var newDate = new Date('0'); newDate.setMilliseconds(diff); return newDate; }; it works with timestamp1 and 2 but when i add, timestamp 3 i get wrong result.. :/ I want to get time between startTime and endTime - breakTime var diff = timestamp2 - timestamp1 Gives 10:00 as it should, but when adding -timestamp1it gives 10:30 not 9:30 as it should :/ if i add + timestamp3; instead of - i get 9:30 as it should, but then if add one hour to break time, so break time is 1hour 30 min, i get 10:30 and break time 2 hour 30 min result 11:30 and so one :/ but should be 8:30 and 7:30 how do i correct this ??
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28342858

http://stackoverflow.com/q/28317884
has comment: http://stackoverflow.com/comment/44985702
upvote count: 2
has comment: http://stackoverflow.com/comment/44984832
type: Question
has answer: http://stackoverflow.com/a/28317975
has comment: http://stackoverflow.com/comment/44984713
has answer: http://stackoverflow.com/a/28318143
tagged with: javascript
has comment: http://stackoverflow.com/comment/44984825
has comment: http://stackoverflow.com/comment/44984794
has answer: http://stackoverflow.com/a/28318418
has answer: http://stackoverflow.com/a/28318225
has title: how to make ajax request async?
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: ajax
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44985324
has body: I want to make some ajax requests asynchronous . such as two Ajax, The first Ajax doesn't need to completed, the second request can take place, $.ajax({ url: "urlone", async: true, complete: function () { console.log("1"); }, type: "post", dataType: "json" }); console.log("2"); $.ajax({ url: "urltwo", async: true, complete: function () { console.log("3"); }, type: "post", dataType: "json" }); in the urlone background,I make the thread sleep 5 seconds, and in the urltwo background I return the json Immediately. I write this, but no effect, I want the console print 2 3 1 but,actually,it print 2 1 3 this show the second request can be trigged only after the first request return How to solve this problem？？ Added in February 6th：Thanks for your enthusiasm answer. My server side is C# and in urlone I wrote JsonModel xx=new JsonModel(){.......}; //as you known System.Threading.Thread.Sleep(5000); return Json(xx); in urltwo I wrote JsonModel xx=new JsonModel(){.......}; //as you known return Json(xx); that's it！ I want this because I performed a very time-consuming operation in urlone, when I back from urlone,The front has lost response，Even if I set up a very large ajax waiting time。So I want to query whether the opration in urlone is completed by request urltwo,the urltwo is designed for query database complete field flag for the operation in urlone. This is my idea. But today, I found a new problem。 when I sleep background thread a long time,then back json data to front,front can response and done some js function,but when I perform a very time-consuming operation in urlone background,when it return to front,the front is no response. there must be some problem I have not realized, so
answer count: 4
score: 2

http://stackoverflow.com/q/28406157
answer count: 1
has comment: http://stackoverflow.com/comment/45146795
tagged with: angularjs
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45147507
has title: Want to display the warning Icon in a correct position without creating new class
has comment: http://stackoverflow.com/comment/45146895
has answer: http://stackoverflow.com/a/28406778
accepted answer: http://stackoverflow.com/a/28406778
type: Question
has comment: http://stackoverflow.com/comment/45147485
has body: I'm having a error messages in different tabs in my UI screen.But in one of the TAB the warning icon is not displaying in the middle of the screen.And that screen tab contains 2 Lines of error message and other screen tabs are containing one line message. I'm using common class for all the tabs if i change the "style="margin-top:-6px" " from -6 to 0. The tab is displaying the icon in the correct position.but other screens are affecting due to this. The 2 line error message needs 0px and other screens are needs -6px. So how can i do this with out creating separate classes for each tab {{workloadConfigurationErrorMessage}}
tagged with: javascript
has comment: http://stackoverflow.com/comment/45147075
score: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28320058
tagged with: xwiki
type: Question
answer count: 1
tagged with: javascript
has body: Is it possible to handle requests on XWiki other way than just with submitting HTML forms ? I need to use XMLHttpRequest, but $request simply doesn 't react to the request. JavaScript code function requestHandle(msg, subj) { var recipientName = recipientsArr.pop()[0]; req = new XMLHttpRequest(); req.onreadystatechange = function() { if (req.readyState == 4) { if (req.status == 200) { console.log('req ok'); var mailStatusTmp = " " + recipientName + " "; $('#mailStatusWrapper').append(mailStatusTmp); if (recipientsArr.length > 0) { requestHandle(msg, subj); // call requestHandle() for next recipient } else { return; } } else { console.log('req err'); var mailStatusTmp = " " + recipientName + " "; $('#mailStatusWrapper').append(mailStatusTmp); if (recipientsArr.length > 0) { requestHandle(msg, subj); // call requestHandle() for next recipient } else { return; } } } }; req.open("POST", "https://wiki.intra.tieto.com/xwiki/bin/view/Sandbox/TestPage1", true); req.send("msg=" + msg + "&subj=" + subj + "&recipientName=" + recipientName); } I want to use XMLHttpRequest, because the page will send data to multiple receivers and I need to check the status every request.
has answer: http://stackoverflow.com/a/28551323
score: 0
has title: XWiki request handling ( without form if possible )
type: UnansweredQuestion
tagged with: request
tagged with: xmlhttprequest

http://stackoverflow.com/q/28325880
has answer: http://stackoverflow.com/a/43833262
has comment: http://stackoverflow.com/comment/44999935
has comment: http://stackoverflow.com/comment/44999953
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44999774
tagged with: unit-testing
type: Question
has body: here is some code i have got: $scope.changePassword = function () { sessionService.save($scope.sessionData); if(sessionService.account.newPassword == sessionService.account.currentPassword) { return false; } webServiceDal.changePassword().success(function (response) { if (response.ChangePasswordAppResponse.errorFlag) $scope.globalError = response.ChangePasswordAppResponse.returnMsg; else $location.path('/my-preferences'); }); }; how would you write a unit test for this? do i need to mock something. im new to javascript/angular js unit testing and so need some guidance as to where to start. i have looked at the docs but they dont have examples for if else statements
has comment: http://stackoverflow.com/comment/44999850
has comment: http://stackoverflow.com/comment/44999817
answer count: 1
has title: how do you test an if statement in javascript/angular js?
tagged with: javascript
has comment: http://stackoverflow.com/comment/45000384
score: 0
has comment: http://stackoverflow.com/comment/44999287
tagged with: angularjs

http://stackoverflow.com/q/28320074
has comment: http://stackoverflow.com/comment/44989204
has title: timepicker does't allow hourMax value more than 99
tagged with: javascript
has answer: http://stackoverflow.com/a/33577746
tagged with: jquery
score: 0
answer count: 2
tagged with: datetimepicker
has body: If I keep the hourMax more than 99 only last two digits are taken as hourMax value. Ex: if hourMax:139 it's allowing upto 39. if you want to check then in script tab Change the hourMax in the following link to 139 &amp; run there. demo
tagged with: timepicker
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28320489
has comment: http://stackoverflow.com/comment/44990232
type: Question

http://stackoverflow.com/q/28356217
has answer: http://stackoverflow.com/a/28356218
tagged with: shadow-dom
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28372320
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
has body: I'm working with Web Components and try to bind a click event to an element inside of the Shadow DOM. 1. component.html included as inside of index.html 2. later element usage: Headline ... 3. Access element and bind a function to it Now I want to add an addEventListener() to the inside of my (which is unfortunately hidden through the #shadow-root). Like: var elemBtn = document.querySelector('my-element button'); elemBtn.addEventListener('click', function(event) { // do stuff }); But that won't work. How do I achieve that?
accepted answer: http://stackoverflow.com/a/28372320
tagged with: javascript
tagged with: custom-events
answer count: 2
tagged with: web-component
has title: How do I bind a function to elements inside of a Shadow DOM?
downvote count: 0
favorite count: 0
possible better answer: http://stackoverflow.com/a/28356218

http://stackoverflow.com/q/28291087
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44936144
score: 0
has comment: http://stackoverflow.com/comment/48288646
tagged with: http://stackoverflow.com/tag/html
tagged with: bootstrap-modal
has title: Bootstrap Modal doesn't appear when clicked, instead effects the tag
has comment: http://stackoverflow.com/comment/44935665
tagged with: twitter-bootstrap
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44935586
answer count: 0
has body: I have the following Html on my page for displaying a modal, pretty basic right? this is located at the bottom of my page. Launch Modal × Modal header One fine body… Close Save changes When I click the "Launch Modal" my page flickers and my scroll bar dis-appears, yet when I click "Launch Modal" again the page flickers and my scroll bar appears again, so I decided to check out firebug to see if any errors have been raised, error count = 0 Then I look at my HTML and this is what I see when clicking on "Launch Modal" Before clicking After is is clicked, you can see styles being assigned to the tag of the Html document? huh? how? why? How is this happening? what is wrong with the modal? I've never experienced this before when working with bootstrap modals.
has comment: http://stackoverflow.com/comment/44935711

http://stackoverflow.com/q/28301299
has title: Clear canvas player path - redraw level array
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28304443
type: Question
answer count: 2
tagged with: canvas
has comment: http://stackoverflow.com/comment/44955325
tagged with: arrays
has answer: http://stackoverflow.com/a/74419377
tagged with: javascript
has comment: http://stackoverflow.com/comment/44961314
score: 0
has body: I'm making a simple platformer game using canvas, my problem is that I can't seem to clear the canvas while using an array to create the level. If I use ctx.clearRect(0, 0, canvas.width, canvas.height); the player can then move correctly and the path behind it is cleared, but the canvas goes completely white. What is the best way to redraw my level from my array? (function() { var requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame; window.requestAnimationFrame = requestAnimationFrame; })(); /* Game Variables and Constants */ var canvas = document.getElementById('canvas'); var ctx = canvas.getContext('2d'); // level colors var color = { darkBlue: '#2c3e50', blue: '#2980b9', green: '#1abc9c' } // add level colors to array var colors = [color.darkBlue, color.blue, color.green]; // Level Plan var levelArray = [ [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28342746
has comment: http://stackoverflow.com/comment/45030180
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: When using function like .add, .remove, etc. on a jquery object, the jQuery object itself isn't modified, the result get caught by the returned new jQuery object. Is there a way to modify the object itself? I'd need that so I can write a function with a jQuery passed by reference, something like this : function DoThings(refJQuery) { refJQuery.find(...).remove(...); if (refJQuery.length &gt; 0) { DoThings(refJQuery); } } IMPORTANT: this sample of code is just a reminder for purpose/usage of "value passed by reference".
has comment: http://stackoverflow.com/comment/45030104
has comment: http://stackoverflow.com/comment/45030081
has comment: http://stackoverflow.com/comment/45029973
has comment: http://stackoverflow.com/comment/45029961
score: -1
type: UnansweredQuestion
has title: Is there a way to modify a jQuery object itself?
has answer: http://stackoverflow.com/a/28342916
downvote count: 1
has comment: http://stackoverflow.com/comment/45030774
has comment: http://stackoverflow.com/comment/45030024
type: Question

http://stackoverflow.com/comment/45113212
type: QuestionComment
comment on: http://stackoverflow.com/q/28352722
score: 0
has text: @BrettCaswell any ideas why the overflow x is affecting it, I need to have it hidden
type: Comment

http://stackoverflow.com/comment/45114321
type: AnswerComment
has text: Don't run styles task when js files change?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28381051

http://stackoverflow.com/q/28343723
upvote count: 2
has comment: http://stackoverflow.com/comment/45479902
has answer: http://stackoverflow.com/a/28343837
has answer: http://stackoverflow.com/a/28344839
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45032276
has comment: http://stackoverflow.com/comment/45031955
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45032040
downvote count: 0
possible better answer: http://stackoverflow.com/a/28343837
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45480022
has comment: http://stackoverflow.com/comment/45344949
accepted answer: http://stackoverflow.com/a/28344839
has comment: http://stackoverflow.com/comment/45032234
favorite count: 0
has comment: http://stackoverflow.com/comment/45031875
has title: Remaning characters textarea problems
has body: I am facing the following problem: I have to calculate the remaining characters in a textarea. It is a simple task and there's a lot of reference for doing such things. The piece of code I created to do this is bellow. Everything works fine an so, but, the QA team did this: they cut and pasted a piece of text of a txt document and they pasted till they reached the maximum of text allowed in my textarea. But what happens is that even when the max of characters is not reached the user cant type anymore. And also if I erase some characters using the backspace I cant type anymore. Let me be more specific. Let's say that the last word is "nerd" and the remaining characters is "47". The code doesn't allow me to write more and even if I use the backspace and have "ner" I cant type a single more letter! The fiddle bellow has the scenario to check what I am saying. You can paste the text that is in the comment of the html section of my fiddle to state what I am talking about. Thanks in advance for any help. http://jsfiddle.net/sLr8co1n/4/ GIF: http://gifmaker.cc/PlayGIFAnimation.php?folder=2015020423hlKs7Ki7knoQBCZAoSaQNN&amp;file=output_rwGbzN.gif $("#textAreaComplemento").bind("keyup change", function (e) { calculaCaracteresRestantes(); }); var text_max = 200; function calculaCaracteresRestantes() { if ($('#textAreaComplemento').val() == undefined) { return false; } var text_length = $('#textAreaComplemento').val().length; var text_remaining = text_max - text_length; $('#textarea_feedback').html(text_remaining); return true; }

http://stackoverflow.com/q/28396254
favorite count: 0
has comment: http://stackoverflow.com/comment/45283360
tagged with: browserify
tagged with: gulp
has comment: http://stackoverflow.com/comment/45133157
has body: I'm using gulp with browserify, to bundle an app. While the build is functional, I continually receive the following error message: Error: Cannot find module 'function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&amp;&amp;require;if(!u&amp;&amp;a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&amp;&amp;require;for(var o=0;o&lt;r.length;o++)s(r[o]);return s}' Does anyone have any ideas what could be causing the error or how to debug it? The only time the error does NOT appear is when there are zero require statements in the main js file. For reference below are the gulp and main.js files: gulpfile var gulp, browserify, stringify, sass, concat, uglify, source, buffer; gulp = require('gulp'); browserify = require('gulp-browserify'); stringify = require('stringify'); sass = require('gulp-sass'); concat = require('gulp-concat'); uglify = require('gulp-uglify'); function handleError(err) { console.log(err.toString()); } gulp.task('browserify', function () { return gulp.src('./src/js/**/*.js', { read: false }) .pipe(browserify({ transform: [stringify({ extensions: ['.html'], minify: true })] })) .on('error', handleError) .pipe(concat('main.js')) .pipe(gulp.dest('./bin/js')); }); gulp.task('sass', function() { return gulp.src('./src/scss/**/*.scss') .pipe(sass()) .on('error', handleError) .pipe(concat('main.css')) .pipe(gulp.dest('./bin/css')); }); gulp.task('index', function () { return gulp.src('./src/index.html') .pipe(gulp.dest('./bin')); }); gulp.task('default', ['browserify', 'sass', 'index']); gulp.task('watch', function() { gulp.watch('./src/js/**/*.js', ['browserify']); gulp.watch('./src/scss/**/*.scss', ['sass']); gulp.watch('./src/index.html', ['index']); gulp.watch('./src/html/**/*.html', ['browserify']); }); main.js 'use strict'; va…
type: UnansweredQuestion
upvote count: 1
has title: How to Find Cause of -- Error: Cannot find module
score: 1
has comment: http://stackoverflow.com/comment/45129075
type: Question
tagged with: commonjs
has answer: http://stackoverflow.com/a/38802808
downvote count: 0
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/28288193
type: Answer
answers question: http://stackoverflow.com/q/28288116
has comment: http://stackoverflow.com/comment/44931372
score: 2
downvote count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/44931160
has body: How about $("#myModalContent).css("max-height", screen.height * .80); That might work
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44933479
accepted answer of: http://stackoverflow.com/q/28288116

http://stackoverflow.com/q/28314445
linked to: http://stackoverflow.com/q/23643870
has body: Here two model with one to many relationship. Video: module.exports = { attributes: { ... (some attributes) createdBy:{ model: "user" } } }; User module.exports = { attributes: { ... (some attributes) videos:{ collection: "video", via: "createdBy" }, } }; And I'm using blueprints.js to request data to sails. If I have understood correctly, you can turn on or off auto population in config/blueprints.js (populate: ture) which I turned off. But when I request GET /video/1 for instance, it gave me populated data as following: { "createdBy": { "user_type": 3, "id": 5, "createdAt": "2015-01-21T03:36:04.832Z", "updatedAt": "2015-02-03T04:35:02.671Z" }, "title": "test video", "url": "http://localhost", "description": "testing submission", "view": 102, "id": 5, "createdAt": "2015-02-03T01:16:20.640Z", "updatedAt": "2015-02-03T04:34:26.726Z" } createdBy field where I believe it supposed to be just id of user. Is this expected behavior even though auto populate is turned off in blueprints.js?
has answer: http://stackoverflow.com/a/40438251
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/52367407
has comment: http://stackoverflow.com/comment/51730824
has comment: http://stackoverflow.com/comment/44998734
tagged with: waterline
type: Question
has title: does Sails js populate association automatically?
tagged with: sails.js
score: 5
has comment: http://stackoverflow.com/comment/45004765
upvote count: 5
tagged with: javascript

momentjs
tags question: http://stackoverflow.com/q/28384869
tags question: http://stackoverflow.com/q/28283351
tags question: http://stackoverflow.com/q/28425132
tags question: http://stackoverflow.com/q/28374901
tags question: http://stackoverflow.com/q/28358210
tags question: http://stackoverflow.com/q/28285059
tags question: http://stackoverflow.com/q/28331378
tag name: momentjs
tags question: http://stackoverflow.com/q/28346057
tags question: http://stackoverflow.com/q/28280895
tags question: http://stackoverflow.com/q/28308548
type: Tag
tags question: http://stackoverflow.com/q/28335803
tags question: http://stackoverflow.com/q/28405410

http://stackoverflow.com/comment/44972373
score: 1
comment on: http://stackoverflow.com/q/28310729
type: Comment
has text: Will it pop up at the same time every month? Or would it pop-up one month after the user accessed the page and provided a valid answer?
type: QuestionComment

http://stackoverflow.com/q/28421727
has comment: http://stackoverflow.com/comment/45177117
has comment: http://stackoverflow.com/comment/45176935
has comment: http://stackoverflow.com/comment/45177025
has comment: http://stackoverflow.com/comment/45176829
has comment: http://stackoverflow.com/comment/45176724
has title: MVC 5 Bootstrap.v3.Datetimepicker.CSS Error: Object doesn't support property or method 'datetimepicker'
tagged with: css
has body: I am building an MVC 5 application and i am trying to use Bootstrap.v3.Datetimepicker.CSS. I have a Javascript file with $(document).ready( function () { $('.datetimepicker').datetimepicker({ changeMonth: true, changeYear: true, dateFormat: "dd/mm/yyyy" }); }); This is how my bundle looks like public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/bundles/jquery").Include( "~/Scripts/jquery-{version}.js")); bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( "~/Scripts/jquery.validate*")); // Use the development version of Modernizr to develop with and learn from. Then, when you're // ready for production, use the build tool at http://modernizr.com to pick only the tests you need. bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( "~/Scripts/modernizr-*")); bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( "~/Scripts/bootstrap.js", "~/Scripts/bootstrap-datepicker.js", "~/Scripts/DatePickerReady.js", "~/Scripts/respond.js")); bundles.Add(new ScriptBundle("~/bundles/moment").Include( "~/Scripts/moment.js")); bundles.Add(new StyleBundle("~/Content/css").Include( "~/Content/bootstrap.css", "~/Content/bootstrap-datetimepicker.min.css", "~/Content/site.css")); // Set EnableOptimizations to false for debugging. For more information, // visit http://go.microsoft.com/fwlink/?LinkId=301862 BundleTable.EnableOptimizations = true; This is the view Create @using (Html.BeginForm()) { @Html.AntiForgeryToken() CreateEditSeasonViewModel @Html.ValidationSummary(true, "", new { @class = "text-danger" }) @Html.LabelFor(model => model.StartDate, htmlAttributes: new { @class = "control-label col-md-2" }) @Html.EditorFor(model => model.StartDate, new { htmlAttributes = new { @class = "form-control datetimepicker", placeholder = "Enter start date here..." } }) @Html.ValidationMessageFor(model => model.StartDate, "", new { @class = "text-danger" }) @Html.LabelFor(model => model.EndDate, htmlAttributes: new { @class = "con…
tagged with: twitter-bootstrap
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28422223
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45176670
score: 0
tagged with: asp.net-mvc-5
answer count: 1

http://stackoverflow.com/q/28373007
accepted answer: http://stackoverflow.com/a/28373008
score: 0
has body: After being created, the slider seems not to have a way to be resized, which is really bad for a responsive layout. Is there a way to actually resize the Coin Slider plugin according to Twitter Bootstrap 3's media queries? You might consider Coin Slider's demo as a fiddle.
answer count: 1
tagged with: jquery
tagged with: css
type: AnsweredQuestion
tagged with: twitter-bootstrap-3
type: Question
has title: How to make Coin Slider responsive?
tagged with: responsive-design
tagged with: javascript
has answer: http://stackoverflow.com/a/28373008

http://stackoverflow.com/a/29399568
type: Answer
score: 0
has body: I cant see a closing figure tag. So it should be like: Test Test Test
answers question: http://stackoverflow.com/q/28377352

http://stackoverflow.com/q/28299593
has body: I am trying to develop application like Match the following(Image To Image) using below code, MyJSp.jsp Question Images Answer Images Upload Image Questions Upload Image Answers MyJS.js : $(function(){ document.querySelector('#files1').addEventListener('change', handleFileSelect, false); document.querySelector('#files2').addEventListener('change', handleFileSelect2, false); function handleFileSelect(evt) { // alert(); var files = evt.target.files; // FileList object // alert("1"); // Loop through the FileList and render image files as thumbnails. for (var i = 0, f; f = files[i]; i++) { // Only process image files. if (!f.type.match('image.*')) { continue; } var reader = new FileReader(); reader.onload = (function(theFile, count) { return function(e) { if (count > 5) { alert("You can upload only 5 images."); } else{ $('#Image'+count).prop("src",e.target.result); make_visible_ADDDB_Count=make_visible_ADDDB_Count+1; } }; })(f,i+1); // Read in the image file as a data URL. reader.readAsDataURL(f); } // $('.imgclass').draggable(); } //************ Answer Images Here function handleFileSelect2(evt) { var files = evt.target.files; // FileList object // alert("1"); // Loop through the FileList and render image files as thumbnails. for (var i = 0, f; f = files[i]; i++) { // Only process image files. if (!f.type.match('image.*')) { continue; } var reader = new FileReader(); reader.onload = (function(theFile, count) { return function(e) { if (count > 5) { alert("You can upload only 5 images."); } else{ count=count+5; $('#Image'+count).prop("src",e.target.result); } }; })(f,i+1); // Read in the image file as a data URL. reader.readAsDataURL(f); } // $('.imgclass').draggable(); } }); From the above code user can upload 5 images at a time but they feel difficult to add images from separate folder at a time. Same time if they add one by one then all images replaces in first image tag only. Note : that file count is very important to insert to DB using ServletFileUpload.isMultipart…
answer count: 1
tagged with: jquery
tagged with: file-upload
accepted answer: http://stackoverflow.com/a/28302226
has title: How to upload multiple images from separate folder in single button
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28302226
tagged with: javascript
score: 0

http://stackoverflow.com/comment/45929853
comment on: http://stackoverflow.com/q/28349746
score: 0
type: Comment
has text: @MarkusMüller second which is Login unsuccessful, Please try again...
type: QuestionComment

http://stackoverflow.com/a/28408474
score: 0
answers question: http://stackoverflow.com/q/28408163
type: Answer
has body: Add the script below to scroll smoothly 1. How to log out? 1. How to log out? Answer...

http://stackoverflow.com/a/28290392
accepted answer of: http://stackoverflow.com/q/28289690
score: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44934630
answers question: http://stackoverflow.com/q/28289690
type: Answer
has body: From the info you provided the reason it is failing is because you dont have a cross domain access policy setup. Because you are using different ports to host the website and the API you are running into this issue. You can either setup a crossdomain.xml with the proper security settings or you can move both the API and the webserver to the same port. Have a look at this for more info: http://en.wikipedia.org/wiki/Same-origin_policy
upvote count: 1

http://stackoverflow.com/q/28430580
downvote count: 1
type: Question
answer count: 2
tagged with: javascript
tagged with: jspdf
has answer: http://stackoverflow.com/a/29962583
has body: I need to print my html contet and text together, I tried with the below code, but the text that am added is not printing in the PDF. Its only print the html contents. Please help me to solve this issue.... pdf = new jsPDF('l', 'mm', 'ledger'), specialElementHandlers = { '#editor': function( element, renderer ) { return true; } }; pdf.fromHTML( $('#customers').get(0) // HTML element , 15 // x coord , 0.5 // y coord , { 'width': 3000 // was 7.5, max width of content on PDF , elementHandlers: specialElementHandlers } ); pdf.text(35, 25, "test"); pdf.save( filename ); });
favorite count: 0
has answer: http://stackoverflow.com/a/28431118
upvote count: 2
possible better answer: http://stackoverflow.com/a/29962583
type: AnsweredQuestion
score: 1
has title: How can i create pdf with jspdf from html and text?
accepted answer: http://stackoverflow.com/a/28431118

http://stackoverflow.com/a/28332379
answers question: http://stackoverflow.com/q/28332315
has body: You could use delete: delete data[300]; This sets the value of the index to be undefined, but doesn't modify the element index itself. See more about the delete operator here.
score: 5
type: AcceptedAnswer
upvote count: 5
type: Answer
accepted answer of: http://stackoverflow.com/q/28332315
downvote count: 0

http://stackoverflow.com/a/28426729
type: Answer
accepted answer of: http://stackoverflow.com/q/28426375
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28426375
score: 0
has body: Take a look at this Jsfiddle. You need to define your fields as input type="number". Then read the input, calculate them and based on what the result is, pass a different color string to your animate function, which now takes a parameter color. You also need to really learn to get your function and property names right. You were using fillstylebut it is called fillStyle. function animate(color){ var canvas = document.getElementById("myCanvas"); var ctx = canvas.getContext("2d"); ctx.clearRect(0,0, canvas.width, canvas.height); ctx.fillstyle = color; ctx.beginPath(); ctx.arc(10, 10, 30, 0, Math.PI * 2); ctx.closePath(); ctx.fill(); }

http://stackoverflow.com/a/28299038
answers question: http://stackoverflow.com/q/28298746
has body: You should not be sending "post" as "type", rather as "method" And like pointed above, the data type should be json and not jsonp. $.ajax({ method: "post", data: JSON.stringify(beacon), contentType: "application/json", dataType: "json", url: "myurl"}).done(function(response) { alert("success"); //if in chrome //console.log(response); }).fail(function(error) { //if using Chrome //console.log(error); alert(error); });
has comment: http://stackoverflow.com/comment/44956658
has comment: http://stackoverflow.com/comment/44956733
has comment: http://stackoverflow.com/comment/44957920
score: 0
has comment: http://stackoverflow.com/comment/44958167
type: Answer
has comment: http://stackoverflow.com/comment/44954924
has comment: http://stackoverflow.com/comment/44954960
has comment: http://stackoverflow.com/comment/44953665
has comment: http://stackoverflow.com/comment/44956077
has comment: http://stackoverflow.com/comment/44958194

http://stackoverflow.com/a/28370026
has comment: http://stackoverflow.com/comment/45081969
score: 5
accepted answer of: http://stackoverflow.com/q/28369936
answers question: http://stackoverflow.com/q/28369936
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45081263
has comment: http://stackoverflow.com/comment/45081743
upvote count: 5
has comment: http://stackoverflow.com/comment/45082288
has comment: http://stackoverflow.com/comment/45081868
has comment: http://stackoverflow.com/comment/45081205
type: Answer
has comment: http://stackoverflow.com/comment/45081798
downvote count: 0
has comment: http://stackoverflow.com/comment/45081599
has body: In your browser, right click the page, click view source (or however you do it for your browser). Notice that the ID's have changed? That makes it not find your elements to enable them. &lt;script type="text/javascript"&gt; function EnableSubmit() { if (document.getElementById('&lt;%= tick.ClientId %&gt;').checked == true) { document.getElementById('&lt;%= uxSubmit.ClientId %&gt;').enabled = true; } else { document.getElementById('&lt;%= uxSubmit.ClientId %&gt;').enabled = false; } } &lt;/script&gt; One solution is to embed the client ID into your script with an inline server side expression. Another is to change the ClientIDMode. Setting the ClientIdMode to static will make the client side use the same ID on the client and server, avoiding the need for an inline expression.
has comment: http://stackoverflow.com/comment/45081761

http://stackoverflow.com/comment/45170885
score: 0
type: AnswerComment
type: Comment
has text: to make myself clear, i am looking to create a section of box like asked 5 min ago which is being displayed below my question.
comment on: http://stackoverflow.com/a/28418675

http://stackoverflow.com/a/28421091
type: Answer
has comment: http://stackoverflow.com/comment/45187659
has comment: http://stackoverflow.com/comment/95972418
has comment: http://stackoverflow.com/comment/45187756
upvote count: 1
has comment: http://stackoverflow.com/comment/45180656
has body: Quick and dirty solution? Use JSON.stringify to deep-compare objects. console.group('map'); a=[{x:1,y:2},{x:2,y:4}]; b = _.map( a, _.clone ); // https://stackoverflow.com/questions/21003059/how-do-you-clone-an-array-of-objects-using-underscore console.log( 'diff', _.difference(b,a) ); // all different b[0].x=5; console.log( 'a[0]', a[0] ); // a[0] does not change with b[0] console.log( 'b[0]', b[0] ); console.log( 'diff', _.difference(b,a) ); // all different console.groupEnd('map'); console.log(_.difference(_.map(a, JSON.stringify), _.map(b, JSON.stringify))) console.log(_.map(_.difference(_.map(a, JSON.stringify), _.map(b, JSON.stringify)), JSON.parse)) console.log(_.difference(_.map(b, JSON.stringify), _.map(a, JSON.stringify))) console.log(_.map(_.difference(_.map(b, JSON.stringify), _.map(a, JSON.stringify)), JSON.parse)) Correct solution? Implement something like the uniqArrays discussed in this question: Finding nested duplicate arrays in JavaScript. (Nested Array uniq in lodash/underscore)
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28391816

http://stackoverflow.com/comment/44986168
comment on: http://stackoverflow.com/a/28315804
score: 0
type: Comment
has text: i want mixed combination of password. like EX: dere@12
type: AnswerComment

http://stackoverflow.com/a/28378630
answers question: http://stackoverflow.com/q/28378494
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45098091
downvote count: 0
type: Answer
has body: Try following plugin https://github.com/mathiasbynens/jquery-placeholder or http://jamesallardice.github.io/Placeholders.js/ or if($.browser.msie){ $('input[placeholder]').each(function(){ var input = $(this); $(input).val(input.attr('placeholder')); $(input).focus(function(){ if (input.val() == input.attr('placeholder')) { input.val(''); } }); $(input).blur(function(){ if (input.val() == '' || input.val() == input.attr('placeholder')) { input.val(input.attr('placeholder')); } }); }); }; Its helpful for you

http://stackoverflow.com/a/28418016
type: Answer
answers question: http://stackoverflow.com/q/28413880
has body: You can look at smaz or shoco, which are designed for the compression of short strings. Most compression methods don't really get rolling until well after your URL length limit, so you need a specialized compressor for this case if you expect to get any gain. You can then encode the binary result using a scheme like Base 64 or a more efficient coding that uses all of the URI-safe characters.
score: 3
upvote count: 3
downvote count: 0

http://stackoverflow.com/comment/45178561
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28422482
has text: Or change the function to take that max count as a parameter. e.g. countChars( input, counter, maxcount )

http://stackoverflow.com/comment/44921619
type: Comment
comment on: http://stackoverflow.com/q/28280823
has text: i have gone more specific in this post if you may assist. thank you http://stackoverflow.com/questions/28283795/counting-how-many-times-a-option-is-selected-in-multiple-drop-down-boxes-with-sa
score: 0
type: QuestionComment

http://stackoverflow.com/comment/44977478
score: 3
has text: I don't think you can compose those two functions like that.
comment on: http://stackoverflow.com/q/28313793
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45128335
comment on: http://stackoverflow.com/a/28393614
score: 0
type: AnswerComment
has text: The switcher won't redraw the fieldsets based on the options array since the fieldsets, as for now, are "hardcoded" in the html. To make this work you need to use ng-repeat that will put the fieldsets in html while iterating over options.
type: Comment

http://stackoverflow.com/q/28282135
score: 0
has comment: http://stackoverflow.com/comment/44918711
tagged with: arrays
tagged with: jquery
has comment: http://stackoverflow.com/comment/44918750
tagged with: rest
has body: i want a global function in an object for the REST communication. I think this is the right way, but something is wrong. Can someone help? var REST = new Object(); REST.url = "http://xxx/REST/"; REST.GetFromRest = function (request, parameter) { var strName, strValue; $.getJSON(this.url + request, { for(strName in parameter) { strName: parameter[strName], } }, function(responseREST) { var arr = jQuery.makeArray(responseREST.data); return arr; }); } How i send parameters when i never know how much and which parameters maybe send.
type: UnansweredQuestion
has title: Global Function for getJSON function
answer count: 0
type: Question
tagged with: object
has comment: http://stackoverflow.com/comment/44918497
has comment: http://stackoverflow.com/comment/44918643
tagged with: javascript

http://stackoverflow.com/comment/65614806
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28437456
has text: @jeremy-danyow what is the difference between propertyObserver and expressionObserver?
type: Comment

http://stackoverflow.com/comment/44949728
has text: A -> B-> C -> back button switch to B, but need A
comment on: http://stackoverflow.com/q/28298769
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45036901
comment on: http://stackoverflow.com/a/28345324
score: 0
type: Comment
has text: @JimPeeters - I've included a snippet to make things more clear.
type: AnswerComment

http://stackoverflow.com/q/28420968
has comment: http://stackoverflow.com/comment/45175060
has comment: http://stackoverflow.com/comment/45175170
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28421113
has answer: http://stackoverflow.com/a/28421113
has body: I don't know the proper place to post this question but I was reading the Marionette docs and saw the following code when describing Marionette.Behaviors: var MyView = Marionette.ItemView.extend({ ui: { "destroy": ".destroy-btn" }, events: { "click @ui.destroy": "warnBeforeDestroy" } I have never seen an @ symbol in an object key before. Does the @ mean anything or is it just part of the string and does nothing special?
upvote count: 7
has title: @ symbol in object key
type: Question
score: 7
tagged with: javascript
answer count: 3
downvote count: 0
has answer: http://stackoverflow.com/a/28421859
favorite count: 0
tagged with: backbone.js
has comment: http://stackoverflow.com/comment/45175145
has comment: http://stackoverflow.com/comment/45175020
accepted answer: http://stackoverflow.com/a/28421859
has answer: http://stackoverflow.com/a/28421365
tagged with: marionette

http://stackoverflow.com/a/29372312
accepted answer of: http://stackoverflow.com/q/28371650
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28371650
has body: I don't see any simple solution, but this way is a little bit clean: var fun = function () { var flex = $(".container"); var cw = flex.width(); // container width var ch = flex.height(); // container height var tl = $(".ui-widget:visible:first"); var tr = $(".ui-widget:visible").closestToOffset({left: cw-20, top: -20}); var bl = $(".ui-widget:visible").closestToOffset({left: 0+20, top: ch+20}); // those '20's are to to throw away from the others elements var br = $(".ui-widget:visible:last"); $(".ui-widget").removeClass(function (index, css) { return (css.match(/\ui-corner-\S+/g) || []).join(' '); }); tl.addClass("ui-corner-tl"); tr.addClass("ui-corner-tr"); bl.addClass("ui-corner-bl"); br.addClass("ui-corner-br");
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/44948430
type: AnswerComment
comment on: http://stackoverflow.com/a/28297850
has text: No i did change my input id to id="file".
score: 0
type: Comment

http://stackoverflow.com/a/28332782
type: Answer
has body: Based on konkked's answer, this is what I came up with. Note that this only requires underscore-min.js, not underscore-min.map. /** The number of milliseconds to ignore clicks on the *same* like button, after a button *that was not ignored* was clicked. Used by `$(document).ready()`. Equal to 500. The disabling and re-enabling is logged to the console. */ var MILLS_TO_IGNORE_LIKES = 500; Continued: Processor function /** Executes a like click. Triggered by clicks on the various yes/no links. The disabling and re-enabling is logged to the console. See */ var processLike = function() { //In this scope, "this" is the button just clicked on. //The "this" in processServerResponse is *not* the button just clicked //on. var $button_just_clicked_on = $(this); //The value of the "data-color_id" attribute. var color_id = $button_just_clicked_on.data('color_id'); var processServerResponse = function(sersverResponse_data, textStatus_ignored, jqXHR_ignored) { //alert("sf sersverResponse_data='" + sersverResponse_data + "', textStatus_ignored='" + textStatus_ignored + "', jqXHR_ignored='" + jqXHR_ignored + "', color_id='" + color_id + "'"); $('#toggle_color_like_cell_' + color_id).html(sersverResponse_data); } var config = { url: LIKE_URL_PRE_ID + color_id + '/', dataType: 'html', success: processServerResponse //Should probably include a "fail" call, too. }; $.ajax(config); }; Continued: Main function: /** The Ajax "main" function. Attaches the listeners to the elements on page load. */ $(document).ready(function() { /* There are many buttons having the class td__toggle_color_like_button This attaches a listener to *every one*. Calling this again would attach a *second* listener to every button, meaning each click would be processed twice. --- Warning: Placing the true parameter outside of the debounce call: $('#color_search_text').keyup(_.debounce(processSearch, MILLS_TO_IGNORE_SEARCH), true); results in "TypeError: e.handler.apply is not a function" - https://stackoverflow.com…
answers question: http://stackoverflow.com/q/28309850
score: 0

http://stackoverflow.com/a/28332902
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28332245
has body: I would use local storage. It is very easy, you just need to write the measured time in the first file as localStorage.setItem("measuredTime",measuredTime+"") (you can place only strings in the local storage). First parameter is the identifier, second parameter is the value. To retrieve the value in the second file, you have to use localStorage.getItem("measuredTime"). The value will be acessible from the whole domain. You can store up to 5MB Also, I think you will need to measure the time it takes the user to press the button. Probably the easiest way is to use somevariable = new Date().getTime(), as it returns the number of miliseconds from the beginning of the unix epoch (1/1/1970). You can use this once when displaying the figures and then the second time when the user presses the button. The difference between the two numbers is the reaction time. Also, the random() function and setTimeout() will be useful for displaying the figures at a random time.

http://stackoverflow.com/a/28386558
answers question: http://stackoverflow.com/q/28386502
score: 0
has comment: http://stackoverflow.com/comment/45112281
type: Answer
has body: You should call setInterval() only once and outside the draw function. The way you do it, you are starting an increasing number of timers that cause the draw() function to be called an infinitely growing number of times. Alternatively: "To execute a function only once, after a specified number of milliseconds, use the setTimeout() method". Reference: Window setInterval. setTimeout() could be used inside your draw() function.

http://stackoverflow.com/a/28391186
score: 0
type: Answer
has body: You can play it with flash. If you decide to go that route, check out this article. If by "local" you mean "on the user's computer", then that's a whole different ballgame, though.
answers question: http://stackoverflow.com/q/28391161
has comment: http://stackoverflow.com/comment/45151218

http://stackoverflow.com/comment/45044831
score: 2
comment on: http://stackoverflow.com/q/28350323
has text: Duplicate of: http://stackoverflow.com/questions/16296670/angular-ng-repeat-error-duplicates-in-a-repeater-are-not-allowed/17246507
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45104309
comment on: http://stackoverflow.com/q/28382972
has text: Isn't there a MySQL function for: `mysql_num_rows($result)`. On a side note: STOP using MySQL PHP functions they're deprecated and will be removed in the future. Use MySQLi or PDO.
score: 1
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28403584
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28403329
has body: I have checked link give by you-(above) It's nothing any special effect - But, they used just sticky Menu with Scrollable Div. For More information you can visit below link: sticky Menu - JSFIDDLE OR Stick-to-top Navigation

http://stackoverflow.com/a/28318339
has body: Given that you've outlined that it should call 1 of 2 possible functions there's really no alternative but to use an if/else statement. If you wanted to do away with the two function calls and instead use a for loop either forwards or in reverse then you'd still need an if (and arguably else) statement of some description to tie it all together. if(rangeStart &lt;= rangeStop) { printRange(rangeStart, rangeStop); } else { printReverseRange(rangeStart, rangeStop); } or var start = rangeStart; var stop = rangeStop; var inc = 1; if(rangeStart &gt; rangeStop) { var start = rangeStop; var stop = rangeStart; var inc = -1; } for(var i = start; inc == 1 ? start &lt;= stop : start &gt;= stop; i += inc) { console.log(i); }
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28318113

http://stackoverflow.com/comment/52899404
type: Comment
comment on: http://stackoverflow.com/q/28284765
has text: @SecularKid man, I read your answer and I can assure you that these are **different** domains, for the rule I specified in my linked answer. If you have subdimain.domain.com and domain.com they are indeed different domains because the hostname, as you can see, is different.
score: 0
type: QuestionComment

requirejs
tags question: http://stackoverflow.com/q/28421915
tag name: requirejs
type: Tag
tags question: http://stackoverflow.com/q/28292677
tags question: http://stackoverflow.com/q/28335502
tags question: http://stackoverflow.com/q/28343487
tags question: http://stackoverflow.com/q/28303035
tags question: http://stackoverflow.com/q/28284703
tags question: http://stackoverflow.com/q/28293159
tags question: http://stackoverflow.com/q/28341390
tags question: http://stackoverflow.com/q/28398866
tags question: http://stackoverflow.com/q/28299238
tags question: http://stackoverflow.com/q/28389216
tags question: http://stackoverflow.com/q/28297862
tags question: http://stackoverflow.com/q/28399014
tags question: http://stackoverflow.com/q/28399265
tags question: http://stackoverflow.com/q/28342002
tags question: http://stackoverflow.com/q/28306780
tags question: http://stackoverflow.com/q/28318474
tags question: http://stackoverflow.com/q/28298971
tags question: http://stackoverflow.com/q/28331502
tags question: http://stackoverflow.com/q/28301733
tags question: http://stackoverflow.com/q/28423159

http://stackoverflow.com/q/28375494
upvote count: 0
tagged with: javascript
has body: I have a simple var with some strings that I convert to a json object. I would like to have an input field for the persons name and then add the text. Currently I have this var text = '{"students":[' + '{"firstName": "Brendan","lastName":"Skousen" },' + '{"firstName":"Scooby","lastName":"Doo" },' + '{"firstName":"Your","lastName":"Mom" }]}'; and I have a var for my input var first = document.getElementById('first').value; So I would like to have the var text work like this: var text = '{"students":[' + '{"firstName": first,"lastName":"Skousen" },' + '{"firstName": first,"lastName":"Norman" },' + '{"firstName": first,"lastName":"Coatney" }]}'; You can see the full code at: http://codepen.io/bskousen/pen/xbPLew
has title: Passing a variable inside json string
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/28375538
answer count: 2
downvote count: 3
has comment: http://stackoverflow.com/comment/45091370
has answer: http://stackoverflow.com/a/28375554
linked to: http://stackoverflow.com/q/4253367
tagged with: http://stackoverflow.com/tag/json
type: UnansweredQuestion
score: -3

http://stackoverflow.com/a/28397950
answers question: http://stackoverflow.com/q/28397783
score: 0
has body: This one was tricky. You are calling change function with the value stored in the stock.table.apple, not the actual path. Your function call is change(5, -2). You can pass an object reference + path as a string: change(stock, "table.apple", -2) // look for attributes of the stock object or the whole path as a string, like: change("stock.table.apple", -2) // look for attributes of the window object
type: Answer

event-handling
tag name: event-handling
tags question: http://stackoverflow.com/q/28432702
tags question: http://stackoverflow.com/q/28376310
tags question: http://stackoverflow.com/q/28423324
tags question: http://stackoverflow.com/q/28395476
type: Tag
tags question: http://stackoverflow.com/q/28364043
tags question: http://stackoverflow.com/q/28315485
tags question: http://stackoverflow.com/q/28386665

http://stackoverflow.com/q/28407444
favorite count: 0
type: UnansweredQuestion
score: -4
downvote count: 4
upvote count: 0
tagged with: handsontable
has title: Assessment on SpreadJs and Handsontable.
type: Question
has body: I am trying to implement dashboard where i need to have HTML 5 spreadsheet ,which will be dynamic in nature, into my webpage/dashboard, i was looking into Spreads and Handsontable. I still need to decide which one i will go with... If some has already used any of these, can you please tell me what are the pros and cons and which one should i go with? Thanks for your help in advance.
answer count: 2
has answer: http://stackoverflow.com/a/28436156
tagged with: javascript
has answer: http://stackoverflow.com/a/28480065
tagged with: wijmo

http://stackoverflow.com/q/28411653
has answer: http://stackoverflow.com/a/28412146
has body: Consider I have controller and input with ngModel . I want to get this ngModel in the controller and execute $setViewValue on it . The snippet is attach . The trying to execute - $setViewValue gives error - TypeError: Cannot set property '$setViewValue' of undefined var myAppModule = angular.module('myApp', []); myAppModule.controller('myCtrl',function ($scope) { $scope.entityMail.$setViewValue("blabla@aaa.com"); }); Mail How to get this ngModel correctly and execute $setViewValue on it ? Edit: I edited my code . I must use it with $setViewValue.
score: 0
has answer: http://stackoverflow.com/a/28411709
has comment: http://stackoverflow.com/comment/45156992
has comment: http://stackoverflow.com/comment/45157469
tagged with: angularjs
answer count: 3
has comment: http://stackoverflow.com/comment/45156796
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45157050
has comment: http://stackoverflow.com/comment/45157073
has comment: http://stackoverflow.com/comment/45157735
has title: How to get ngModel of input in the controller?
type: Question
tagged with: angular-ngmodel
has answer: http://stackoverflow.com/a/28412154
tagged with: javascript

http://stackoverflow.com/comment/45092532
comment on: http://stackoverflow.com/a/28299762
score: 0
type: Comment
has text: I could not include it first due to this very specific wordpress plugin setup situation. Thanks!
type: AnswerComment

http://stackoverflow.com/q/28400187
has answer: http://stackoverflow.com/a/28400257
upvote count: 0
has title: How do I fade text in and out with jQuery?
answer count: 1
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45136098
has body: Here is my code: I want to have the var text crossfade basically. JS: var text = ["ease your mind.", "focus.", "sleep better."]; var counter = 0; var elem = document.getElementById("changeText"); setInterval(change, 2000); function change() { elem.innerHTML = text[counter]; counter++; if(counter >= text.length) { counter = 0; } } HTML: ease your mind.
score: -1
has comment: http://stackoverflow.com/comment/45136070
duplicate of: http://stackoverflow.com/q/11384834
downvote count: 1
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45136133

http://stackoverflow.com/comment/45086870
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28372873
has text: Hello, welcome to StackOverflow! Could you please show us what you have tried so far?
score: 0

php
tags question: http://stackoverflow.com/q/28294481
tags question: http://stackoverflow.com/q/28377424
tags question: http://stackoverflow.com/q/28333648
tags question: http://stackoverflow.com/q/28391820
tags question: http://stackoverflow.com/q/28307015
tags question: http://stackoverflow.com/q/28291183
tags question: http://stackoverflow.com/q/28283958
tags question: http://stackoverflow.com/q/28340255
tags question: http://stackoverflow.com/q/28315584
tags question: http://stackoverflow.com/q/28418395
tags question: http://stackoverflow.com/q/28366078
tags question: http://stackoverflow.com/q/28345628
tags question: http://stackoverflow.com/q/28361701
tags question: http://stackoverflow.com/q/28372639
tags question: http://stackoverflow.com/q/28291152
tags question: http://stackoverflow.com/q/28364405
tags question: http://stackoverflow.com/q/28379939
tags question: http://stackoverflow.com/q/28320979
tags question: http://stackoverflow.com/q/28412373
tags question: http://stackoverflow.com/q/28281282
tags question: http://stackoverflow.com/q/28361353
tags question: http://stackoverflow.com/q/28331252
tags question: http://stackoverflow.com/q/28338638
tags question: http://stackoverflow.com/q/28290422
tags question: http://stackoverflow.com/q/28295123
tags question: http://stackoverflow.com/q/28417246
tags question: http://stackoverflow.com/q/28405677
tags question: http://stackoverflow.com/q/28392064
tags question: http://stackoverflow.com/q/28414937
tags question: http://stackoverflow.com/q/28388919
tags question: http://stackoverflow.com/q/28423064
tags question: http://stackoverflow.com/q/28423105
tags question: http://stackoverflow.com/q/28380382
tags question: http://stackoverflow.com/q/28433292
tags question: http://stackoverflow.com/q/28305625
tags question: http://stackoverflow.com/q/28376477
tags question: http://stackoverflow.com/q/28308101
tags question: http://stackoverflow.com/q/28365859
tags question: http://stackoverflow.com/q/28281442
tags question: http://stackoverflow.com/q/28330736
tags question: http://stackoverflow.com/q/28338518
tags question: http://stackoverflow.com/q/28434841
tags question: http://stackoverflow.com/q/28330752
tags question: http://stackoverflow.com/q/28350473
tags question: http://stackoverflow.com/q/28337099
tags question: http://stackoverflow.com/q/28401265
tags question: http://stackoverflow.com/q/28436577
tags question: http://stackoverflow.com/q/28365756
tags question: http://stackoverflow.com/q/28338211
tags question: http://stackoverflow.com/q/28323906
tags question: http://stackoverflow.com/q/28356938
tags question: http://stackoverflow.com/q/28361098
tags question: http://stackoverflow.com/q/28299576
tags question: http://stackoverflow.com/q/28356299
tags question: http://stackoverflow.com/q/28395443
tags question: http://stackoverflow.com/q/28353124
tags question: http://stackoverflow.com/q/28348614
tags question: http://stackoverflow.com/q/28338338
tags question: http://stackoverflow.com/q/28319377
tags question: http://stackoverflow.com/q/28290067
tags question: http://stackoverflow.com/q/28375965
tags question: http://stackoverflow.com/q/28425273
tags question: http://stackoverflow.com/q/28371835
tags question: http://stackoverflow.com/q/28386910
tags question: http://stackoverflow.com/q/28344102
tags question: http://stackoverflow.com/q/28408551
tags question: http://stackoverflow.com/q/28365753
tags question: http://stackoverflow.com/q/28322478
tags question: http://stackoverflow.com/q/28409554
tags question: http://stackoverflow.com/q/28280287
tags question: http://stackoverflow.com/q/28362802
tags question: http://stackoverflow.com/q/28410200
tags question: http://stackoverflow.com/q/28351868
tags question: http://stackoverflow.com/q/28424374
tags question: http://stackoverflow.com/q/28391227
tags question: http://stackoverflow.com/q/28346986
tags question: http://stackoverflow.com/q/28349095
tags question: http://stackoverflow.com/q/28297011
tags question: http://stackoverflow.com/q/28307247
tags question: http://stackoverflow.com/q/28380313

http://stackoverflow.com/comment/45194539
comment on: http://stackoverflow.com/q/28431036
score: 1
has text: Haha oops sorry, wrong paste :) Here's the right one http://jsfiddle.net/4155jyn3/ , and also try with plugins like Qtip : http://jsfiddle.net/79xqxesc/1/
type: Comment
type: QuestionComment

webbrowser-control
type: Tag
tags question: http://stackoverflow.com/q/28408585
tag name: webbrowser-control
tags question: http://stackoverflow.com/q/28397974

http://stackoverflow.com/comment/45162511
comment on: http://stackoverflow.com/q/28414185
score: 0
has text: http://www.wbotelhos.com/raty
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45196362
score: 0
type: AnswerComment
type: Comment
has text: I forgot to mention, I don't want to affect other elements with the same class, is there any way to affect only this one?
comment on: http://stackoverflow.com/a/28433130

http://stackoverflow.com/comment/45036764
has text: So where are we typing?
type: Comment
comment on: http://stackoverflow.com/q/28346196
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45051594
comment on: http://stackoverflow.com/a/28349633
score: 0
type: AnswerComment
type: Comment
has text: Please correct me: Every time we enter a new iteration in the event loop the callstack is zero (otherwise we cannot enter the next iteration). Every asynchronous function defers its callback execution to the next iteration. So the callback resides in memory and is waiting for an event. If that event is triggered, the callback execution is put on the current stack. Otherwise the callback (and its scope) is passed to the next itaration in memory. Is that right?

http://stackoverflow.com/comment/44982238
has text: You could also just remove the space between `>` and `{`. So ` { ` instead of ` { `, and the same with the closing `>` and `}`. The reason for this is mostly because `foo bar` shouldn't render as foo**bar**.
type: Comment
comment on: http://stackoverflow.com/q/28307091
score: 0
type: QuestionComment

http://stackoverflow.com/q/28341716
tagged with: javascript
tagged with: openlayers-3
score: 0
has body: my problem is that i can draw a point or points if this is differents variables in a map in javascript, but when i use a {{mission_template}} that is a list of objects from database i cant iterate in this !!... my function in javascript is this : function AddMakers(){ for (var i=0; i&lt;50; i++){ var x={{mission_template.GPSlongitude}}; var y={{mission_template.GPSlatitude}}; var iconFeature = new ol.Feature({ geometry: new ol.geom.Point(ol.proj.transform([x,y], 'EPSG:4326', 'EPSG:3857')), name: 'Marker ' + i }); markers[i]= [x,y]; vectorSource.addFeature(iconFeature); } } .... rest scripts.... And use Django and Python for programming. I can iterating in this only in my template, but cant use that data for iterate for using in map . i Use : {% for mission_template in mission_template %} ...rows and cols for html... {{mission_template.GPSlongitude}} {{mission_template.GPSlongitude}} {%endfor%} All the information is in this variable. I want iterate in javascript in this variable {{mission_template}} Thanks!! Regards ^^
accepted answer: http://stackoverflow.com/a/28341916
answer count: 1
has title: How i can doing for introducing a list objects from database's values in a function of javascript for draw points in map openlayer?
tagged with: django
tagged with: python
type: AnsweredQuestion
tagged with: django-templates
has answer: http://stackoverflow.com/a/28341916
type: Question

http://stackoverflow.com/q/28284855
has answer: http://stackoverflow.com/a/28286016
type: Question
has comment: http://stackoverflow.com/comment/44923738
tagged with: javascript
has answer: http://stackoverflow.com/a/28285047
score: 0
has comment: http://stackoverflow.com/comment/44923665
answer count: 3
possible better answer: http://stackoverflow.com/a/28285513
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28285513
has title: Retrieve ancestor element with a certain data attribute
accepted answer: http://stackoverflow.com/a/28285047
has body: How can I retrieve an ancestor element with a certain data attribute by clicking one of its children elements? I need to get the data-cell attribute when clicking either a or a . I tried to use node.parentElement, but when I click a span it returns me the div, and it's clear. Is there something like node.parentElement.dataset.dataCell to get what I need? Number one Number two Number three
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44923706

http://stackoverflow.com/comment/45096979
score: 0
has text: @AlexanderO'Mara: i replaced .. but still stays same.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28378494

http://stackoverflow.com/q/28365948
has body: i´m playing arround with three.js i want to render objects on specific geocoordinates on a bigger sphere, i´m pretty near to the solution, but i dont get the correct xyz position from lat lon i have set up a test case on jsfiddle, there are two coordinates latlons = [[40.7142700,-74.0059700], [52.5243700,13.4105300]]; its New York and Berlin and this is my function to calc xyz from lat lon and radius function calcPosFromLatLonRad(lat,lon,radius){ // Attempt1 var cosLat = Math.cos(lat * Math.PI / 180.0); var sinLat = Math.sin(lat * Math.PI / 180.0); var cosLon = Math.cos(lon * Math.PI / 180.0); var sinLon = Math.sin(lon * Math.PI / 180.0); var rad = radius; y = rad * cosLat * sinLon; x = rad * cosLat * cosLon; z = rad * sinLat; // Attempt2 // x = radius * Math.sin(lat) * Math.cos(lon) // y = radius * Math.sin(lat) * Math.sin(lon) // z = radius * Math.cos(lat) // Attempt3 // latitude = lat * Math.PI/180 // longitude = lon * Math.PI/180 // x = -radius * Math.cos(latitude) * Math.cos(longitude) // y = radius * Math.sin(latitude) // z = radius * Math.cos(latitude) * Math.sin(longitude) // Attempt4 // var phi = (90-lat)*(Math.PI/180); // var theta = (lng+180)*(Math.PI/180); // x = ((rad) * Math.sin(phi)*Math.cos(theta)); // z = ((rad) * Math.sin(phi)*Math.sin(theta)); // y = ((rad) * Math.cos(phi)); console.log([x,y,z]); return [x,y,z]; } but all attempts return different xy, and they are all not correct ( z is always correct). could someone pleas guide me to the right way ? i have no idea what could be wrong heres the fiddle to play with UPDATE: working jsfiddle
tagged with: three.js
has title: javascript Latitude Longitude to xyz position on earth (threejs)
upvote count: 13
possible better answer: http://stackoverflow.com/a/51864924
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45075163
has answer: http://stackoverflow.com/a/28367325
has answer: http://stackoverflow.com/a/51864924
has comment: http://stackoverflow.com/comment/61755630
tagged with: geolocation
has answer: http://stackoverflow.com/a/76312733
downvote count: 1
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28367325
score: 12
answer count: 3
favorite count: 0

http://stackoverflow.com/q/28288896
answer count: 2
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28289462
has comment: http://stackoverflow.com/comment/52772619
has body: I am using the node.js request module to post a large POST request (~150MB) to a REST service. For any request bigger than about 30MB, it seems to hang. My guess is that it is doing some naive JSON.stringify()ing to the data instead of streaming it, and once it gets large enough to hit swap, it just becomes very slow. This is what my request looks like: request({ uri: url method: 'post', json: args, // args is a 150MB json object }, function(err, resp, body) { // do something }); The same request made using angularjs's $http from within a browser works in less than a minute, so I know it's the cilent and not the server. Is there an easy way to fix this?
tagged with: node.js
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28289432
upvote count: 1
tagged with: request
has title: Node.js posting a large request using request module hangs
score: 1
tagged with: post
type: Question

http://stackoverflow.com/a/28415118
downvote count: 0
answers question: http://stackoverflow.com/q/28413446
type: Answer
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/45174511
has body: Sounds like you have an array of queries you want to execute sequentially. try this: var queries = ..., // an array of breeze EntityQuery objects entityManager = ..., // a breeze EntityManager promise = Q.resolve(); // chain the queries together. queries.forEach(function(query) { promise = promise.then(function() { return entityManager.executeQuery(query); }); }); promise.then(function() { console.log('all queries executed!'); });

http://stackoverflow.com/a/28313011
type: Answer
upvote count: 1
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28312468
has comment: http://stackoverflow.com/comment/44976427
has body: Try splitting it at the hash instead, like this (demo): var url = [ "http://www.myurl.com/abcs/der/er/.../asdsad/hrllo1.shtml#header?query=whatever&amp;....", "http://www.myurl.com/abcs/der/er/.../asdsad/hrllo2.shtml?query=whatever", "http://www.myurl.com/abcs/der/er/..../asdsad/hrllo3.shtml", "http://myurl.com/index3.html#query=twitter.com/search" ], i, left, index, page = []; for (i = 0; i &lt; url.length; i++) { left = url[i].split(/[#?]/g)[0]; index = left.lastIndexOf('/') + 1; page.push(left.slice(index)); } // result: page = [ 'hrllo1.shtml', 'hrllo2.shtml', 'hrllo3.shtml' ];

http://stackoverflow.com/q/28302943
upvote count: 1
answer count: 1
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
type: AnsweredQuestion
score: 1
tagged with: http://stackoverflow.com/tag/json
has body: I am having CORS issues using a csv file to populate a sankey diagram, so I would like to replace it with embedded json for testing purposes. I have reformatted the csv data to get it into the format needed by the d3 sankey plugin, but I can't figure out how to get the javascript to read the json input in place of the csv. The code I was using to load the csv is as follows: / load the data with d3.csv d3.csv("testinput.csv", function(error, data) { graph = {"nodes" : [], "links" : []}; data.forEach(function (d, i) { var item = { source: d.source, target: d.target, values: [] }; for (var j=0; j &lt; 101; j++) { item.values.push(d['value'+j.toString()]); } portfolioValues.push(item); graph.nodes.push({ "name": d.source }); graph.nodes.push({ "name": d.target }); graph.links.push({ source: portfolioValues[i].source, target: portfolioValues[i].target, value: portfolioValues[i].values[startingAllocation] }); }); //this handy little function returns only the distinct / unique nodes graph.nodes = d3.keys(d3.nest() .key(function (d) { return d.name; }) .map(graph.nodes)); //it appears d3 with force layout wants a numeric source and target //so loop through each link replacing the text with its index from node graph.links.forEach(function (d, i) { graph.links[i].source = graph.nodes.indexOf(graph.links[i].source); graph.links[i].target = graph.nodes.indexOf(graph.links[i].target); portfolioValues[i].source = graph.links[i].source; portfolioValues[i].target = graph.links[i].target; }); //now loop through each nodes to make nodes an array of objects rather than an array of strings graph.nodes.forEach(function (d, i) { graph.nodes[i] = { "name": d }; }); The json I would like to use is: { "nodes": [ {"node":1,"name":"AA"}, {"node":2,"name":"BB"}, {"node":3,"name":"XX"}, {"node":4,"name":"YY"} ], "links": [ {"target":3,"source":1,"value":300}, {"target":4,"source":2,"value":0}, {"target":3,"source":2,"value":0}, {"target":4,"source":2,"value":200} ]}
type: Question
has answer: http://stackoverflow.com/a/28399992
accepted answer: http://stackoverflow.com/a/28399992
downvote count: 0
tagged with: javascript
has title: embedding json in sankey d3 javascript file
tagged with: sankey-diagram

http://stackoverflow.com/q/28359128
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/21292142
tagged with: cryptojs
tagged with: node.js
upvote count: 3
linked to: http://stackoverflow.com/q/32038267
has answer: http://stackoverflow.com/a/28361216
type: Question
score: 3
has body: My client-side code: data.username = CryptoJS.AES.encrypt(user.username, "password"); data.password = CryptoJS.AES.encrypt(user.password, "password"); When I send 'data' to the express.js server, like so: var user = req.body; var decipher = crypto.createDecipher('aes256', "password"); var decrypted = decipher.update(user.username, 'hex', 'utf-8'); decrypted += decipher.final('utf-8'); I am getting the following error: Error: DecipherInit error at new Decipher (crypto.js:368:17) at Object.Decipher (crypto.js:365:12)
tagged with: javascript
tagged with: express
has title: How to decipher a string in NodeJS that is encrypted in CryptoJS
linked to: http://stackoverflow.com/q/23111388
answer count: 1
has comment: http://stackoverflow.com/comment/75959636
downvote count: 0
linked to: http://stackoverflow.com/q/44482151
favorite count: 0
linked to: http://stackoverflow.com/q/39637388
linked to: http://stackoverflow.com/q/12219499

object-literal
tag name: object-literal
tags question: http://stackoverflow.com/q/28306084
tags question: http://stackoverflow.com/q/28393742
type: Tag

http://stackoverflow.com/comment/44942289
has text: Your code helped me a lot.Thanks a lot Vikas.The code you gave me needed little modification which I did and it worked perfectly.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28293122

http://stackoverflow.com/comment/45097095
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28378332
type: AnswerComment
has text: I tried to make a simple example, let me know if you have any questions

http://stackoverflow.com/q/28334664
has answer: http://stackoverflow.com/a/28334703
accepted answer: http://stackoverflow.com/a/28334703
favorite count: 0
has body: I need a "Move Up" button and a "Move Down" button that will move list items (that contain checkboxes that are checked) up in the list by 1 place or down by 1 place depending on which button they click. I've seen several posts that deal with similar situations but none of them seem to cover exactly what I need. I would like to stick with the primary jquery.js file. Checkbox 1 Checkbox 2 Checkbox 3 Move Up Move Down jQuery Code: $('#moveUp').click(function() { return !$('#theList li :checked').closest('li').insertBefore(this.prev()); }); $('#moveDown').click(function() { return !$('#theList li :checked').closest('li').insertAfter(this.next()); });
has title: jQuery Click on an outside element to move unordered list items up or down that contain checked checkboxes
tagged with: http://stackoverflow.com/tag/html
tagged with: checkbox
type: AnsweredQuestion
downvote count: 0
score: 1
possible better answer: http://stackoverflow.com/a/28334734
type: Question
tagged with: checked
tagged with: javascript
tagged with: jquery
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/28334734

http://stackoverflow.com/a/28702747
has body: chart.data('value')[0].values[0].value c3 documentation here check out this fiddle
type: Answer
downvote count: 0
score: 5
answers question: http://stackoverflow.com/q/28291656
upvote count: 5

http://stackoverflow.com/comment/44984159
type: QuestionComment
comment on: http://stackoverflow.com/q/28317182
score: 0
type: Comment
has text: thanks, well how to it? `@if ($(this).width() > 100) { ... }`

http://stackoverflow.com/a/28487709
has body: If I understand the question correctly, then you have two services clients connect to: Firebase and a back-end server that you manage. Your back-end server certainly shouldn't trust anything the user sends, even if it is delivered via HTTPS. One simple answer is to send the server the auth token and let it validate the user using this (since the token can't be forged). A more elegant solution is to cut out the whole process of circumnavigating Firebase and connecting to a REST API. Instead, utilize a queue strategy and have the client write to Firebase. With security rules in place, the server no longer needs to worry about authentication. If the user can write to a secured path, they are already authenticated and the problem is resolved. Then the server can process the queued request and respond by writing back to Firebase in a secure manner. In this way, there is no REST API to maintain, no double-authentication, and no overhead. Just let Firebase be the authority and turn every other process--privileged or customer--into a consumer.
type: AcceptedAnswer
score: 0
accepted answer of: http://stackoverflow.com/q/28408287
type: Answer
answers question: http://stackoverflow.com/q/28408287

http://stackoverflow.com/a/28370587
score: 1
answers question: http://stackoverflow.com/q/28369522
upvote count: 1
has body: More than likely, the root of your issue is with using the same id for your submit buttons. &lt;form name="wish" method="post" action="javascript:void(0);"&gt; &lt;?php $i = 1; foreach($result1 as $res1) { $user_id = 5; ?&gt; &lt;input type="submit" class="submit_wish1" id="calButton_&lt;?php echo $i; ?&gt;" data-wid="&lt;?php echo $res1-&gt;user_id; ?&gt;" data-uid="&lt;?php echo $user_id; ?&gt;" value="" onclick="favfunction(this)"/&gt; &lt;?php $i += 1; } ?&gt; &lt;/form&gt; there should only be 1 form tag in an html document. elements should not have the same ids, so we're appending a number to the id, that correlates to the iteration of the foreach loop. &lt;script&gt; function favfunction(elm) { var wid = $(elm).data('wid'), uid = $(elm).data('uid'); alert('wid: ' + wid + ' - uid: ' + uid); } &lt;/script&gt; Code Snippet Sample with Sample Php output. function favfunction(elm) { var wid = $(elm).data('wid'), uid = $(elm).data('uid'); alert('wid: ' + wid + ' - uid: ' + uid); } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;form name="wish" method="post" action="javascript:void(0);"&gt; &lt;input type="submit" class="submit_wish1" id="calButton_1" data-wid="1" data-uid="5" value="Submit" onclick="favfunction(this)" /&gt; &lt;input type="submit" class="submit_wish1" id="calButton_2" data-wid="2" data-uid="5" value="Submit" onclick="favfunction(this)" /&gt; &lt;input type="submit" class="submit_wish1" id="calButton_3" data-wid="3" data-uid="5" value="Submit" onclick="favfunction(this)" /&gt; &lt;input type="submit" class="submit_wish1" id="calButton_4" data-wid="4" data-uid="5" value="Submit" onclick="favfunction(this)" /&gt; &lt;input type="submit" class="submit_wish1" id="calButton_5" data-wid="5" data-uid="5" value="Submit" onclick="favfunction(this)" /&gt; &lt;/form&gt;
downvote count: 0
type: Answer

http://stackoverflow.com/comment/45177438
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28377951
has text: Is this what you are using? [Google Documentation - Google Picker](https://developers.google.com/picker/docs/index)
score: 0

http://stackoverflow.com/a/28351281
answers question: http://stackoverflow.com/q/28350841
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28350841
has body: You could try something like this : The point is to add a random/unique value at the end of the url so the request is never the same
type: Answer

http://stackoverflow.com/a/28422594
answers question: http://stackoverflow.com/q/28422388
has body: Fixed it by downloading Node.js and installing it directly to my C: Drive!
type: Answer
upvote count: 1
score: 1
downvote count: 0

http://stackoverflow.com/comment/45219329
type: Comment
comment on: http://stackoverflow.com/q/28435383
has text: What database are you using?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45080618
comment on: http://stackoverflow.com/q/28369836
score: 2
has text: Here you go - http://jsfiddle.net/hhvrjnr3/1/ No need for id's :-)
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28369409
has title: Owl carousel's .destroy() removes unrelated divs
has answer: http://stackoverflow.com/a/29654692
has body: I want to switch between a carousel view and a different layout depending on the width of the viewport. Setting up the carousel works fine. I run into problems when I want to remove it. I use $owlTeam.destroy(); which according to the documentation should recreate the state of the markup before the carousel was initialized, but for some reason removes two unexpected and crucial divs. One is a wrapper div that is a parent of the div containing the carousel the other is the carousel div itself. This is my markup: This is the JS I use: var $owlTeam; if( $window.width() < 680 ) { $('.team .owlCarousel').owlCarousel({ autoPlay: false , singleItem:true , transitionStyle : "fade" , pagination : true }); $owlTeam = $('.team .owlCarousel').data('owlCarousel'); } $window.resize(function() { if( $window.width() < 680 ) { $('.team .owlCarousel').owlCarousel({ autoPlay: false , singleItem:true , transitionStyle : "fade" , pagination : true }); $owlTeam = $('.team .owlCarousel').data('owlCarousel'); } else { if( typeof $owlTeam != 'undefined' ) { $owlTeam.destroy(); } } }); I tried using an ID to directly select the div that's supposed to contain the carousel but this didn't change the behaviour at all. I could reinsert the missing markup with JS but that seems to be more of a bandaid than a proper solution. What is causing this behaviour and how can I fix it? jQuery Version: 1.11.1 owl Version: 1.3.2 Browsers I tested: FF 35, Chrome 40
score: 2
type: Question
tagged with: owl-carousel
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 1
favorite count: 0
upvote count: 2
type: UnansweredQuestion

http://stackoverflow.com/q/28390013
favorite count: 0
upvote count: 2
has body: I want to create a graph where every node is connected to its childs function Node (value) { this.value = value; this.childs = []; this.mark = false; } This is my graph var nodes = [new Node (0), new Node (1), new Node (2), new Node (3), new Node (4)]; nodes[0].childs.push (nodes[1]); nodes[1].childs.push (nodes[0]); nodes[1].childs.push (nodes[2]); nodes[2].childs.push (nodes[1]); nodes[1].childs.push (nodes[4]); nodes[4].childs.push (nodes[1]); nodes[2].childs.push (nodes[3]); nodes[3].childs.push (nodes[2]); Should look like this Now I want to visit every node function visit (node) { node.mark = true; for (i=0; i&lt;node.childs.length; i++) if (!node.childs[i].mark) visit (node.childs[i]); } But node 4 never gets visited what I don't unterstand. See in action: http://jsfiddle.net/jhdLhz44/ Would be nice if someone can help. Thx in advance
has title: JavaScript visit every node in graph
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/28390043
type: Question
tagged with: graph
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/28390101
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28390101
accepted answer: http://stackoverflow.com/a/28390043

http://stackoverflow.com/comment/44955136
type: QuestionComment
has text: The value (attribute/property) of a checkbox does not (should not) change with the state of the checkbox. Can you clarify what you're trying to do? Why is the value important to you? Why is the state (checked/unchecked) not sufficient for you?
score: 0
comment on: http://stackoverflow.com/q/28301848
type: Comment

http://stackoverflow.com/comment/44994930
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28323526
has text: Paste us in another code box the final javascript code after the PHP has executed (use your browsers built in Inspector tool)

http://stackoverflow.com/a/28389043
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28388960
downvote count: 0
has body: You only need pure JavaScript for this: function closestTo(arr, key, direction) { var keyIndex = arr.indexOf(key), indexToReturn; if (direction === 'prev') { indexToReturn = keyIndex &gt; 0 ? keyIndex - 1 : arr.length -1; } else if (direction === 'next') { indexToReturn = keyIndex &lt; arr.length - 1 ? keyIndex + 1 : 0; } return arr[indexToReturn]; }
type: Answer

http://stackoverflow.com/comment/45024703
has text: thanks for this, I wouldn't have been able to figure this out at all. This is something we haven't gone over yet. Kinda just grazed the top of this in class.. thanks for the help.
comment on: http://stackoverflow.com/a/28339619
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/28390683
answer count: 1
has comment: http://stackoverflow.com/comment/45118727
has comment: http://stackoverflow.com/comment/45118824
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45118918
has title: logging me out?
has comment: http://stackoverflow.com/comment/45118768
has comment: http://stackoverflow.com/comment/45118834
has comment: http://stackoverflow.com/comment/45118906
has comment: http://stackoverflow.com/comment/45118750
type: Question
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/45118912
tagged with: jquery
has answer: http://stackoverflow.com/a/28390708
score: 0
has body: var account; var users = ["minibluerhino"]; var password = "killer224"; var gameId = 126945035 //Put your game ID here for (account = 0; account &lt; users.length; account++) { window.location.assign('www.roblox.com'); $(document).ready(function(){ document.getElementById("LoginUsername").value = users[account]; document.getElementById("LoginPassword").value = password; document.getElementById('LoginButton').click(); $(document).ready(function(){ window.location.assign('http://www.roblox.com/---place?id=' + gameId); }); }); }; Whenever I run that code, it brings me to the target location, but I am notlogged in, If I remove the target location, it logs me in perfectly fine.

http://stackoverflow.com/comment/45127985
type: Comment
type: QuestionComment
has text: Have you read: http://stackoverflow.com/questions/14028959/why-does-jquery-or-a-dom-method-such-as-getelementbyid-not-find-the-element
comment on: http://stackoverflow.com/q/28395931
score: 0

http://stackoverflow.com/comment/45196757
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28427407
has text: @Bergi yeah we both know that's impossible :) OP asks "I want to figure out whether that error was thrown. Notice, in the loadDataSet function implementation, I did not utilize the .done() function." - his try/catch example was just to illustrate an attempt to solve the problem for a particular case. I don't mind addressing this in particular in the answer if you think it's important.
score: 0

http://stackoverflow.com/q/28365287
has comment: http://stackoverflow.com/comment/45080168
tagged with: javascript
has comment: http://stackoverflow.com/comment/45072187
has body: I'm using Facebook's Javascript SDK, but it's returning the error: API calls from the server require an appsecret_proof argument I'm familiar with why it would return this error server-side through PHP - but this is client-side javascript, and can't see why it would ever return this error. Stripped-down code as follows: window.fbAsyncInit = function () { FB.init({ appId: [my app id], xfbml: true, version: 'v2.2' }); }; (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')); FB.login(function (res) { if (res.authResponse) { if (res.authResponse.grantedScopes.indexOf("manage_pages") &gt;= 0) { FB.api('/me/accounts', function (res) { if (res &amp;&amp; !res.error) { /* * Should show pages available for * the facebook user to manage ... * (code removed) */ } else { /* * Instead, shows 'API calls from the * server require an appsecret_proof * argument" error here */ console.log("Error /me/accounts: " + JSON.stringify(res.error)); } }); } } }); This works fine if I turn off the 'App Secret Proof for Server API calls' in the Facebook App settings, but for security reasons I want this on. This shouldn't fail through a javascript call - it's a client-side API call, not a server API call that the error message describes it as. Is this a bug with Facebook, or something I'm missing somewhere?
downvote count: 0
answer count: 1
tagged with: facebook-javascript-sdk
tagged with: facebook-graph-api
favorite count: 0
type: UnansweredQuestion
tagged with: facebook
score: 3
upvote count: 3
has answer: http://stackoverflow.com/a/49160620
has title: Facebook Javascript API call returns error requiring appsecret_proof argument - but this is client side
type: Question
linked to: http://stackoverflow.com/q/22359611

http://stackoverflow.com/q/28426562
tagged with: javascript
has comment: http://stackoverflow.com/comment/45185705
score: 0
has body: I am trying to combine 2 separate series in one chart and I am using Highcharts. The requirement is as shown in the attached picture I tried the option as shown in http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/plotoptions/column-grouping-false/ $(function () { // First, let's make the colors transparent Highcharts.getOptions().colors = Highcharts.map(Highcharts.getOptions().colors, function (color) { return Highcharts.Color(color) .setOpacity(0.5) .get('rgba'); }); $('#container').highcharts({ chart: { type: 'column' }, title: { text: 'Monthly Average Rainfall' }, subtitle: { text: 'Source: WorldClimate.com' }, xAxis: { categories: [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ] }, yAxis: { min: 0, title: { text: 'Rainfall (mm)' } }, legend: { layout: 'vertical', backgroundColor: '#FFFFFF', align: 'left', verticalAlign: 'top', x: 100, y: 70, floating: true, shadow: true }, tooltip: { shared: true, valueSuffix: ' mm' }, plotOptions: { column: { grouping: false, shadow: false } }, series: [{ name: 'Tokyo', data: [49.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4], pointPadding: 0 }, { name: 'New York', data: [83.6, 78.8, 98.5, 93.4, 106.0, 84.5, 105.0, 104.3, 91.2, 83.5, 106.6, 92.3], pointPadding: 0.1 }, { name: 'London', data: [48.9, 38.8, 39.3, 41.4, 47.0, 48.3, 59.0, 59.6, 52.4, 65.2, 59.3, 51.2], pointPadding: 0.2 }, { name: 'Berlin', data: [42.4, 33.2, 34.5, 39.7, 52.6, 75.5, 57.4, 60.4, 47.6, 39.1, 46.8, 51.1], pointPadding: 0.3 }] }); }); I have tried other options as well but could not reach the solution.My question is : Can we at all get this functionality in highchart ? Thanks.
has title: Combine 2 series in one Chart (not stacked)
has comment: http://stackoverflow.com/comment/45202731
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28428114
type: Question
tagged with: highcharts
answer count: 1
has comment: http://stackoverflow.com/comment/45219067

http://stackoverflow.com/a/28396056
type: Answer
answers question: http://stackoverflow.com/q/28395931
score: 0
has body: Show all your HTML code The identifier id="topbar" exist? id="topbar" is unique in the HTML? You are declaring the script after loading the HTML? Go Go2

geojson
tags question: http://stackoverflow.com/q/28393062
tag name: geojson
tags question: http://stackoverflow.com/q/28365969
type: Tag

http://stackoverflow.com/a/28364449
has body: none of the below answers worked. Then I found something amazing trick which solved my problem --- Here it is --- JUST REMOVE "input" word from that line in if block - WORKED CODE : function myfun(status){ if(status=='Yes'){ $('[id$="txtareaID"]').attr('disabled','disabled'); } Previous CODE : function myfun(status){ if(status=='Yes'){ $('input[id$="txtareaID"]').attr('disabled','disabled'); $('input[id$="txtareaID"]').prop('disabled',true); //Didn't worked either }
score: 0
answers question: http://stackoverflow.com/q/28362818
type: Answer

http://stackoverflow.com/q/28301358
tagged with: jquery
has answer: http://stackoverflow.com/a/28301707
has comment: http://stackoverflow.com/comment/44954147
score: 0
tagged with: events
has title: Dropdown option "change" not working if change event is unbound and then rebound
possible better answer: http://stackoverflow.com/a/28301707
type: Question
type: AnsweredQuestion
has body: I'm facing this weird issue with off() and on() event binding to a select dropdown: If I unbind and then rebind the change event to the select dropdown I won't be able to change the dropdown shown value. In other words, the selected value is not updated properly in the dropdown, even if the change event is triggered. If I remove the off() part, leaving only the event bounding with on(), everything works fine but obviously I'm not able to prevent the binding of the same event more than once. See a live example here http://jsfiddle.net/z7o11exs/ Test case: use the dropdown (it works! the selected value is correctly show in the dropdown) refresh page. click on the first button (off/on) and then use the dropdown. It does not work properly as the selected value does not change refresh page. click on the second button (only on) and then use the dropdown. It does work as expected. side effect: clicking n times on the 2nd button bounds n times the change event to the dropdown element Here's the code: //--- This binds the event to the element function bindEvent(){ $("#myselect").on("change", function(){ console.log("change"); }); } //--- remove any change event previously added, then rebind it function rebindEvent(){ $("#myselect").off("change").on("change", function(){ console.log("change"); }); } Thanks in advance
has comment: http://stackoverflow.com/comment/44954055
has comment: http://stackoverflow.com/comment/44954132
has answer: http://stackoverflow.com/a/28301398
accepted answer: http://stackoverflow.com/a/28301398
answer count: 2
has comment: http://stackoverflow.com/comment/44954104
tagged with: jquery-mobile
tagged with: javascript

http://stackoverflow.com/comment/45148404
type: Comment
type: QuestionComment
has text: `$(this).prop('required', true/false);` to set required as true or false
comment on: http://stackoverflow.com/q/28407091
score: 0

http://stackoverflow.com/a/28358933
accepted answer of: http://stackoverflow.com/q/28358904
upvote count: 3
answers question: http://stackoverflow.com/q/28358904
has body: use below code selector.attr('src', 'localhost/product/image1.jpg'); //show loader code here var loadImage = new Image(); loadImage.src = selector.attr('src'); loadImage.onload = function(){ // hide loader code here }
type: AcceptedAnswer
downvote count: 0
score: 3
type: Answer

http://stackoverflow.com/comment/44938837
comment on: http://stackoverflow.com/a/28291047
score: 1
type: AnswerComment
type: Comment
has text: I like @Jack's solution, because it is very clean/a best practice for this use case: it doesn't pollute global scope, while accomplishing precisely what you are looking to achieve, nothing more nothing less, with no side effects. [PubSub](http://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern) is a very common pattern. [Here's it is in a separate gist](https://gist.github.com/addyosmani/1321768#option-2-custom-events-using-on-and-off), which lists some other variations of implementing this same pattern.

http://stackoverflow.com/comment/49900427
comment on: http://stackoverflow.com/a/28433113
type: AnswerComment
has text: Good Answer i apply it and its working fine... Good Mr. Aidiakapi
score: 0
type: Comment

http://stackoverflow.com/comment/45053357
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28354808
score: 0
has text: thanks much better than ```_.toArray(_.mapValues(users, 'id'))```

http://stackoverflow.com/q/28284002
favorite count: 0
has body: I am developing an application which uses a common Fuseki dataset with other developers. A Javascript function calls AJAX (jQuery $.ajax()) and sends to the Python script three variables via POST request. Javascript: $.ajax({ url: 'py/registerUser.py', data: {firstname: registerFirstName, lastname: registerLastName, email: registerEmail}, dataType: 'json', type: 'post', success: function(data) { if(data["result"] == "ok") { validSPARQL = true; } else { validSPARQL = false; } }, error: function(data) { validSPARQL = false; } }); The Python script retrieves the POST variables and manipulates them to create the query string. Then it sets the method to POST and executes the query on the given address. Python #!/usr/bin/python # -*- coding: utf-8 -*- import cgi, cgitb, json, re from SPARQLWrapper import SPARQLWrapper, JSON arguments = cgi.FieldStorage() firstname = arguments.getvalue('firstname') lastname = arguments.getvalue('lastname') email = arguments.getvalue('email') queryString = """PREFIX aop:&lt;http://vitali.web.cs.unibo.it/AnnOtaria/person/&gt; PREFIX rdf:&lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt; PREFIX foaf:&lt;http://xmlns.com/foaf/0.1/&gt; INSERT DATA { aop:""" + firstname + lastname + """ a foaf:Person ; foaf:name \"""" + firstname + """ """ + lastname + """\" ; foaf:mbox &lt;mailto:""" + email + """&gt; . } """ sparql = SPARQLWrapper("http://linktodataset.com:8181/data/update") sparql.setQuery(queryString) sparql.setReturnFormat(JSON) sparql.setMethod('POST') sparql.query() print "Content-type: text/json\n" print "{ \"result\": \"ok\" }" My problem: each time I send the query, I get back a Internal Server Error 500. I tried manipulating the code in many ways, I followed the instructions on this page and had a look on this other one, and many others among which the SPARQLWrapper documentation, but nothing happened. I tried writing the query string in other ways, imported other libraries. Nothing worked. Note 1: commenting the line sparql.query() …
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/45208090
tagged with: sparqlwrapper
linked to: http://stackoverflow.com/q/26236780
linked to: http://stackoverflow.com/q/14160437
has comment: http://stackoverflow.com/comment/45238949
type: Question
has answer: http://stackoverflow.com/a/28415698
answer count: 2
has comment: http://stackoverflow.com/comment/45414022
has title: INSERT DATA to Fuseki via Python SPARQLWrapper
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45155871
has comment: http://stackoverflow.com/comment/45155578
tagged with: semantic-web
has answer: http://stackoverflow.com/a/31619833
has comment: http://stackoverflow.com/comment/45216454
has comment: http://stackoverflow.com/comment/45208166
tagged with: fuseki
tagged with: python
has comment: http://stackoverflow.com/comment/45034516
has comment: http://stackoverflow.com/comment/45164651
score: 1

http://stackoverflow.com/q/28293405
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28293761
downvote count: 0
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28293731
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28293731
has comment: http://stackoverflow.com/comment/44940394
type: Question
has comment: http://stackoverflow.com/comment/44939915
upvote count: 2
answer count: 2
has comment: http://stackoverflow.com/comment/44939885
has body: Let say I have function to get templates, if template was never before use it should send request by AJAX and after that return template, if template was used it should be return from cache. Sample code: var getTemplate = (function(jQuery){ //full template obj = {url: '', html: ''} var templates = {test: {url: '/templates/test.html'}}; function getTemplate(templateId){ if(templates[templateId].html){ return templates[templateId]; } jQuery.ajax({ method: "get", url: templates[templateId].url }).success(function(respond){ templates[templateId].html = respond; }); //no idea what next... return getTemplate } })(jQuery); Sample use: var template = getTemplate('test') should always return /templates/test.html content I don't wont use async: false and any framework. I wont learn how to do that ;)
has title: Memoizing Javascript function that gets its data using asynchronous Ajax
has answer: http://stackoverflow.com/a/28293761
tagged with: caching
score: 2

http://stackoverflow.com/a/28351354
has comment: http://stackoverflow.com/comment/45046438
score: 0
has comment: http://stackoverflow.com/comment/45046829
type: Answer
has body: document.getElementsByTagName("body")[0].style.overflow = "hidden";
answers question: http://stackoverflow.com/q/28351258
has comment: http://stackoverflow.com/comment/45047383

http://stackoverflow.com/comment/101121939
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28333805
type: AnswerComment
has text: @Greg the only way I can think of for regular pages is via service workers - a very convoluted way at that. But thank you!

http://stackoverflow.com/comment/45008544
type: Comment
type: QuestionComment
has text: Format your code please. It makes it easier to read and answer.
score: 0
comment on: http://stackoverflow.com/q/28330563

http://stackoverflow.com/q/28352047
has title: Overlapping circles blocking mouseover event - Google maps v3
score: 1
has answer: http://stackoverflow.com/a/28356512
upvote count: 1
type: Question
type: AnsweredQuestion
has body: I have in my code an overlapping circles where within a larger circle have four other smaller circles and within these four other circles have countless other smaller circles yet. The method that creates such circles read a different array for each of the three types, thus created a method for the mouseover and mouseout event of the circles, call in the creation thereof. My problem: The event running only in the smaller circles. When I comment on the call of the creation of others and perform the creation of a for individulamente they work, but not together. Simple Map
has comment: http://stackoverflow.com/comment/45049113
tagged with: google-maps
accepted answer: http://stackoverflow.com/a/28356512
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: dom-events
favorite count: 0
tagged with: mouseover
tagged with: google-maps-api-3
has comment: http://stackoverflow.com/comment/45054080

http://stackoverflow.com/q/28402257
has answer: http://stackoverflow.com/a/28402429
type: Question
possible better answer: http://stackoverflow.com/a/28402322
has answer: http://stackoverflow.com/a/28402322
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28402429
has title: Is it possible to get a reference to the setter function of a "setter"?
answer count: 2
tagged with: getter-setter
downvote count: 0
favorite count: 0
has body: For example, in this code var o = { set a(value) {this.b = value}, get a() {return this.b} } is it possible to get a reference to that setter function for o.a so that if the reference is assign to f then I can do f.call(other, value) to use it on another object?
score: 11
upvote count: 11
type: AnsweredQuestion

http://stackoverflow.com/comment/45129137
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28396511
has text: Uncaught ReferenceError: send_reply is not defined(index):55 onclick
score: 0

http://stackoverflow.com/q/28316318
accepted answer: http://stackoverflow.com/a/28322820
score: 2
type: AnsweredQuestion
type: Question
tagged with: google-maps
tagged with: javascript
tagged with: kml
has body: I'm working on an intranet project, so my KML files can't be externally available. This means I'm dependent on the geoXML3 library to parse my XML on to my Google map. However the lack of documentation around event listeners is frustrating. I want to call a click listener and have the geoXML3 placemark passed in. I'm trying to do the following, however clickListener always receives the last polygon processed in the afterParse loop as p. kml = new geoXML3.parser({ suppressInfoWindows: true, map: map, afterParse: function (doc) { for (var i = 0; i &lt; doc[0].placemarks.length; i++) { var p = doc[0].placemarks[i]; google.maps.event.addListener( p.polygon, "click", function () { clickListener(p); } ); } } }); kml.parse(mapSettings.kmlLocation); If I was using the Google Maps API's KML support, I could do this and have the polygon passed in to the listener. kml = new google.maps.KmlLayer(mapSettings.kmlLocation, { suppressInfoWindows: true, preserveViewport: false, map: map }); google.maps.event.addListener( kml, "click", clickListener }; Is there any way to either (more preferable) pass the correct geoXML3 placemark reliably in to clickListener, or (less preferable) a property in the geoXML3.parser I can bind a click event to and receive a kmlMouseEvent the way I would using the Google Maps API kml parser? Ultimately I need to be able to change the style of the polygon and track that in an array it's been selected/deselected.
answer count: 1
downvote count: 0
tagged with: geoxml3
favorite count: 0
has answer: http://stackoverflow.com/a/28322820
has title: Google Maps geoXML3: passing a placemark into it's own event listener?
upvote count: 2

http://stackoverflow.com/a/28322729
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28322384
type: Answer
score: 2
answers question: http://stackoverflow.com/q/28322384
upvote count: 2
has body: The code below deletes all rows with similar values: function removeDuplicateRows($table){ function getVisibleRowText($row){ return $row.find('td:visible').text().toLowerCase(); } $table.find('tr').each(function(index, row){ var $row = $(row); $row.nextAll('tr').each(function(index, next){ var $next = $(next); if(getVisibleRowText($next) == getVisibleRowText($row)) $next.remove(); }) }); } removeDuplicateRows($('table')); Fiddle
type: AcceptedAnswer

http://stackoverflow.com/a/50694001
answers question: http://stackoverflow.com/q/28297941
score: 0
has body: Use browser.waitForAngular() before calling browser.actions().mouseMove("mouseoverelement").perform();... because you need to wait till angular load. it('mouseover test', function() { .... .... browser.waitForAngular(); browser.actions().mouseMove(element(by.css('#mouseoverelement'))).perform(); expect(element(by.css('#mouseoverelement')).isDisplayed()).toBeTruthy(); });
type: Answer

http://stackoverflow.com/comment/45117503
has text: but i think this will not work in general,, because on the same form i will have two buttons one of type .btn-default while the other of type .btn-primary
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28389911

http://stackoverflow.com/comment/45142984
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28404210
score: 0
has text: Are the rules independent or do both have to be satisfied for `passed`?

http://stackoverflow.com/a/28304977
has comment: http://stackoverflow.com/comment/45149645
has comment: http://stackoverflow.com/comment/60063283
has comment: http://stackoverflow.com/comment/92790113
has comment: http://stackoverflow.com/comment/45077980
has comment: http://stackoverflow.com/comment/60070743
type: Answer
has body: So the way i went about this was to add a new option called labelLength which, if passed a number greater than 0, will trim the labels on the x axis to that length. It happens in the scale class of the chart and will only apply to the axis label and not the tool tip. If you wanted you could extract the relevant bits and just override the scale class and also the build scale function in the bar chart to include the new option. In the scale class here is what was added Chart.Scale = Chart.Element.extend({ initialize: function() { //truncate the labels if option is grater than 0 this.xLabels = this.labelLength &gt; 0 ? this.xLabels.map(this.truncateLabel, this) : this.xLabels; this.fit(); }, truncateLabel: function(label) { return label.substring(0, this.labelLength); }, addXLabel: function(label) { //also added here for when adding single items of data to a graph this.xLabels.push(this.labelLength &gt; 0 ? this.truncateLabel(label) : label); this.valuesCount++; this.fit(); }, } then in the bar buildscale function you would need to pass the option to the scale. Or i have included this in my fork of chart js (https://github.com/leighquince/Chart.js) to use just pass the option labelLength with your desired labels length, example below var randomScalingFactor = function() { return Math.round(Math.random() * 100) }; var barChartData = { labels: ["January a really long label", "February a really long label", "March a really long label", "April a really long label", "May a really long label", "June a really long label", "July a really long label"], 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: "rg…
upvote count: 2
has comment: http://stackoverflow.com/comment/45278978
downvote count: 1
has comment: http://stackoverflow.com/comment/66389042
score: 1
has comment: http://stackoverflow.com/comment/60063023
has comment: http://stackoverflow.com/comment/68409177
answers question: http://stackoverflow.com/q/28296994

http://stackoverflow.com/a/28392484
has comment: http://stackoverflow.com/comment/45153207
upvote count: 8
answers question: http://stackoverflow.com/q/28388129
type: Answer
score: 8
has body: Ok, so I've once again taken a deep dive into the IndexedDB, the DOM and the HTML specification. I really need to get this right for SyncedDB since it relies heavily on promises inside transactions. The crux of the problem is whether or not the delayed execution of the onFulfilled and the onRejected callbacks to then that Promises/A+ compliant must exhibit will trigger an IndexedDB transaction commit. The IndexedDB rules for a transactions lifetime are actually pretty straight forward when you extract them from the specification and line them up: Request can only made against a transaction when its active flag is set to true (as specified here). When a transaction is created it is initially active until control is returned to the the browsers event loop (this is specified in the transaction creation steps). Every time a success or error event is fired, the transactions active flag is set to true before as the last step before the event is dispatched. After the event dispatch the transaction is flagged as inactive again (this is specified in the steps for firing a success/error event. When a transaction can no longer become active it will automatically be committed (as specified here). This roughly translates to: When you create a transaction you can place as many request against it as you wish. From then on new request can only be made inside event handlers for another requests success or error event listener. When all requests has been executed and no new requests placed the transaction will commit. The question then becomes: If a promise is fulfilled inside a request's success or error event listener will its onFulfilled callbacks be invoked before the IndexedDB sets the transaction as inactive again? I.e. will onFullfilled callbacks be called as part of step 3 in firing a success event? The step dispatches an event and IndexedDB uses DOM events so the actual operation performed is beyond the IndexedDB specification. The steps for dispatching an event is, instead,…
has comment: http://stackoverflow.com/comment/45154176
downvote count: 0

http://stackoverflow.com/comment/45100243
score: 0
type: AnswerComment
has text: Downvoting without commenting, great.
type: Comment
comment on: http://stackoverflow.com/a/28380372

http://stackoverflow.com/comment/45135256
comment on: http://stackoverflow.com/a/28399719
type: AnswerComment
score: 0
type: Comment
has text: Regarding your second code snippet: It's better to generate all HTML for the choices in memory and after the loop add it to the DOM. Otherwise you'll trigger a reflow on every iteration which is highly unperformant.

http://stackoverflow.com/comment/45158876
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28411966
has text: Try to put `$scope.filteredStores = [];` right at the beginning of your `init()` function
type: Comment

http://stackoverflow.com/q/28290072
answer count: 1
favorite count: 0
has body: I'm unable to push objects to an array and i can't figure out why. At the moment, the result (records) repeats the last instance of the each loop. JSFiddle HTML Javascript (w/ jQuery) (function(){ var sort = $(".sort select"); var provider = $("[data-provider]"); var rating = $("[data-rating]"); var price = $("[data-price]"); var records = []; var record = {}; $(provider).each(function(index, value){ record.provider = $(provider).eq(index).data("provider"); record.rating = $(rating).eq(index).data("rating"); record.price = $(price).eq(index).data("price"); records[index] = record; }); })();
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28290144
upvote count: 1
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28290144
has title: Javascript Pushing Objects to Array

http://stackoverflow.com/q/28289394
answer count: 2
has comment: http://stackoverflow.com/comment/44932616
downvote count: 0
has body: Hi I'm trying to learn Javascript and I was trying to make window pop-up but I tried to do it with a function. Is there a rule where you can't name a function click? &lt;script type="text/javascript"&gt; function click() { alert("boom!!!"); } &lt;/script&gt; &lt;form&gt; &lt;input type="button" value="touch me" onclick="click()" /&gt; &lt;/form&gt; I'm wondering why it does not work because even if click is a word that already exist in javascript, I thought that the "" would tell the browser that it is the function click that I just created.
duplicate of: http://stackoverflow.com/q/4388443
favorite count: 0
has comment: http://stackoverflow.com/comment/44932588
type: UnansweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/44932524
linked to: http://stackoverflow.com/q/4388443
type: Question
has answer: http://stackoverflow.com/a/28289455
tagged with: javascript
has answer: http://stackoverflow.com/a/28289412
has title: Can you name a funciton click in javascript?
upvote count: 2

http://stackoverflow.com/comment/44920772
comment on: http://stackoverflow.com/q/28283304
type: QuestionComment
type: Comment
has text: There is no such limit.
score: 9

http://stackoverflow.com/a/28339657
has body: The keyup attribute is calling the validator with the wrong id: numberValidation('no_of_promoters'). The name of the element is no_of_promoters but the id is number_of_promoters: &lt;input type="number" name="no_of_promoters" id="number_of_promoters" ... Your code could also use a clean up since it contains duplicate code in the if and else. &lt;div class="row" id="divtypeofb"&gt; &lt;div class="col-xs-12"&gt; &lt;div class ="col-md-6"&gt; &lt;div class="form-group"&gt; &lt;label&gt;&lt;li class="hide"&gt;&lt;/li&gt;No of partners&lt;span style="color: red;"&gt;&amp;nbsp;*&lt;/span&gt;&lt;/label&gt; &lt;input type="number" name="no_of_promoters" id="number_of_promoters" min="2" value="&lt;?=$business_info_details['no_of_promoters'];?&gt;" class="form-control" placeholder="No of Partners involved" onkeyup="numberValidation('number_of_promoters')" &gt; &lt;span class="help-block hide"&gt;&lt;li class="hide"&gt;&lt;/li&gt;Select the number of partners involved.&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;script type="text/javascript"&gt; $(function() { $('#company_type_id').change(function(){ if($('#company_type_id').val()!=1){ $("#divtypeofb").show(1000).removeClass("hide"); } else { $("#divtypeofb").hide(1000).addClass("hide"); $("#number_of_promoters").val(''); } }); }); function numberValidation(id){ var input = $("#" + id); var value = input.val(); var div = input.closest('div'); var label = div.find('label'); var span = div.find('span'); var li = label.find('li'); if(value == null || $.trim(value) == "" || !$.isNumeric(value)){ div.removeClass("has-success") .addClass("has-error"); li.removeClass('fa fa-check hide') .addClass('fa fa-times-circle-o'); span.removeClass("hide"); input.focus(); //input.scrollTo($(this),1000); return false; } else{ div.removeClass("has-error") .addClass("has-success"); li.removeClass('fa fa-times-circle-o hide') .addClass('fa fa-check'); span.addClass("hide"); return true; } } &lt;/script&gt;
answers question: http://stackoverflow.com/q/28338632
has comment: http://stackoverflow.com/comment/45027060
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45028130
has comment: http://stackoverflow.com/comment/45026574

http://stackoverflow.com/comment/45032442
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28340239
has text: Worth mentioning that the above will fail. cross origin request. Unless the OP works at google

http://stackoverflow.com/q/28354094
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45055424
type: Question
has comment: http://stackoverflow.com/comment/45054780
tagged with: javascript
has comment: http://stackoverflow.com/comment/45052668
has title: Best way to pass JSON from PHP controller to AngularJS controller?
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28355046
tagged with: angularjs
has body: I am working with Angular JS and Yii2. In one of my PHP controllers I need to pass an array of data from backend to front end, so I am json encoding my php array and setting a var in the view like so: $script = "var projects = '".json_encode($projects)."';"; $this-&gt;view-&gt;registerJs($script, View::POS_END); Then in my Angular controller I am getting the JSON data like so: app.controller('ProjectsController', ['$scope', function($scope, args){ $scope.projects; $scope.init = function(){ $scope.projects = angular.fromJson(projects); }; $scope.init(); }]); My question is, is this good form? Is there a right/wrong way to process data like this on page load with Angular? Cheers Ash
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/45052018
has comment: http://stackoverflow.com/comment/45054747

http://stackoverflow.com/comment/45136560
type: Comment
comment on: http://stackoverflow.com/q/28400437
type: QuestionComment
score: 0
has text: This sounds like an issue more with Chrome's handling of your sound setup. "Aw, Snap!"s like these are bugs in Chrome and treated seriously, so file a bug report in the Chromium bug tracker.

http://stackoverflow.com/q/28422752
has comment: http://stackoverflow.com/comment/45179155
has comment: http://stackoverflow.com/comment/45179036
has answer: http://stackoverflow.com/a/28423111
upvote count: 4
has title: DOM is not ready in a directive's link function. Is hacky Timeout the only solution?
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/24744311
has comment: http://stackoverflow.com/comment/45179395
favorite count: 0
tagged with: angularjs
type: Question
has comment: http://stackoverflow.com/comment/45179092
has comment: http://stackoverflow.com/comment/45178966
has body: I'm using an ng-repeat inside a directive's template. myApp.directive("test", function () { return { restrict: 'C', scope: { bindVar: '=' }, template: '&lt;div&gt;\ &lt;div class="item" ng-repeat="sel in bindVar"&gt;{{sel.display}}&lt;/div&gt;\ &lt;/div&gt;', link: function ($scope, element, attrs) { // setTimeout(function() { alert($('.item').length); // &lt;--- RETURNS 0, IF I ADD TIMEOUT RETURNS 3 // },0); } // of link } // of return }); http://jsfiddle.net/foreyez/t4590zbr/ However, when the link() function is called I don't seem to get access to the items that have been created. In order to do this I need to set a timeout of 0 (after that it works). I read this in the following article: http://lorenzmerdian.blogspot.com/2013/03/how-to-handle-dom-updates-in-angularjs.html I also saw a similar Stack Overflow answer where the OP marked Timeout as the answer: DOM elements not ready in AngularJS Directive&#39;s link() function But c'mon, there's got to be another way! I'm crossing my fingers that this hacky solution is wrong, and there's some way that angular provides a callback when the DOM has been created via a directive. Or do I really rely on .. timeouts? (really? :/)
has comment: http://stackoverflow.com/comment/45179028
has comment: http://stackoverflow.com/comment/45178948
score: 4
has answer: http://stackoverflow.com/a/28424726
has answer: http://stackoverflow.com/a/28439671
answer count: 3
has comment: http://stackoverflow.com/comment/45178673
linked to: http://stackoverflow.com/q/9779113
has comment: http://stackoverflow.com/comment/45178593
has comment: http://stackoverflow.com/comment/45179050
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/45179429
has comment: http://stackoverflow.com/comment/45179672

http://stackoverflow.com/a/28335384
has body: var sendData = new Array(); async.each(mails, function(item,callback) { var mail = item.trim(); console.log(mail); User.find({mail: mail},function(err, user){ if (user.length &gt; 0) { sendMail(mail); var reg = new REG({mail: mail, resp:"Send Mail"}); reg.save(function(err){ if(!err){ var dat ={success: true,msg: "Seccess!"}; sendData.push(dat); } }); }else{ var dat ={success: false,msg: "Error!"}; sendData.push(dat); } callback(); }); }, function(err) { if (err) { console.log("ERROR"); console.log(err); } console.log("sendResp"); console.log(sendData); res.send(sendData); }); wish this can help u!
answers question: http://stackoverflow.com/q/28335245
type: Answer
score: 0

http://stackoverflow.com/q/28335245
answer count: 1
tagged with: javascript
has body: I have an array and i need process them. While task is running i need to save some information to send through ajax. I use async module, but don't do what i need. Example: var sendData = new Array(); async.each(mails, function(item) { var mail = item.trim(); console.log(mail); User.find({mail: mail},function(err, user){ if (user.length &gt; 0) { sendMail(mail); var reg = new REG({mail: mail, resp:"Send Mail"}); reg.save(function(err){ if(!err){ var dat ={success: true,msg: "Seccess!"}; sendData.push(dat); } }); }else{ var dat ={success: false,msg: "Error!"}; sendData.push(dat); } }); }, function(err) { if (err) { console.log("ERROR"); console.log(err); } console.log("sendResp"); console.log(sendData); res.send(sendData); });
score: 0
tagged with: node.js
type: UnansweredQuestion
has title: save data while procces array in nodejs
type: Question
has answer: http://stackoverflow.com/a/28335384

http://stackoverflow.com/comment/45190271
type: QuestionComment
comment on: http://stackoverflow.com/q/28416551
has text: @j_buckley, $templateCache is used by the angular boostrap library, so will look into that and feedback.
score: 0
type: Comment

http://stackoverflow.com/q/28401138
has body: When you creating a Chrome browser extension, you may suggest keyboard shortcuts by implementing the chrome.commands API. Is there a documented list of allowed key combinations? Chrome seems to reject virtually every combination I offer despite the fact that I know they are not used by any of the systems I'm targeting. I'm aware of the keyboard shortcuts listed here, but shortcuts not appearing on this list still do not work.
score: 3
type: Question
has comment: http://stackoverflow.com/comment/45137949
has title: Allowed Keyboard Shortcuts for Chrome Extensions
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: google-chrome-extension
has comment: http://stackoverflow.com/comment/45137993
has answer: http://stackoverflow.com/a/28410213
upvote count: 3
type: UnansweredQuestion
tagged with: google-chrome

http://stackoverflow.com/comment/112559664
type: Comment
comment on: http://stackoverflow.com/a/60158342
has text: @Lacek Because is really useful in some cases to get basic data that you need from the array. Useful link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45093795
type: Comment
comment on: http://stackoverflow.com/a/28376779
has text: Yes I mistyped, and now it works. But I just simplified the problem, my real problem is that I have an object inside of which there is a method in which I make an xhr request, and I'm using var xhr, but I get only one executed. What the problem could be there?
score: 0
type: AnswerComment

infobright
type: Tag
tag name: infobright
tags question: http://stackoverflow.com/q/28301077

http://stackoverflow.com/q/28321985
favorite count: 0
score: -1
tagged with: localization
has answer: http://stackoverflow.com/a/28322991
downvote count: 1
upvote count: 0
tagged with: linkedin-api
answer count: 1
accepted answer: http://stackoverflow.com/a/28322991
tagged with: javascript
has body: I'm trying to get the LinkedIn "follow" button to display in other languages on my site, which already does a lot of localization based on the browser settings, and I've noticed that the LinkedIn API seems to not accept language codes that are "simple", i.e. 2 letters like "fr". It seems to only want codes like "fr_FR". with "fr" i see an error like: 'fr' is not a supported language, defaulting to 'en_US' This is not acceptable, since many users may just pick a language without a specific country variant, because many (all?) browsers allow this. What's an easy way around this?
type: Question
type: AnsweredQuestion
has title: LinkedIn follow button language issue

http://stackoverflow.com/comment/44926154
type: Comment
has text: Yes, there should be another way, because you can abort requests in PhantomJS. I thought that injecting a script from `page.onInitialized` doesn't work in this case, so I added a version with `page.onLoadStarted`. See my updated answer.
type: AnswerComment
comment on: http://stackoverflow.com/a/28284507
score: 0

http://stackoverflow.com/comment/45101716
comment on: http://stackoverflow.com/q/28381424
score: 0
has text: At a guess, they're stuck inside. Reposition them outside when they collide.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44968257
comment on: http://stackoverflow.com/q/28308505
type: Comment
type: QuestionComment
score: 2
has text: What is `getQueryVariable` and where is it defined?

http://stackoverflow.com/q/28335524
tagged with: javascript
has body: I am trying to make a program that automatically changes the person's elo rating. I ran into a problem that I can't seem to solve. Here's the code: Liam=1000; Stefan=1000; Dylan=1000; Dennis=1000; Daniel=1000; K=32; //eloX is the player who won var ratingChange = function(PlayerX,PlayerY){ //Expected Winning percentage of player X var EWP_X = 1/(1+10^((PlayerY-PLayerX)/400)); //WP=Winning Percentage WP=1; //Player X rating change PlayerX = PlayerX+K*(WP-EWP_X); console.log(PLayerX) }; ratingChange(Liam,Dylan) Whenever I test this Javascript I get the error "PlayerX is not defined". I'm rusty in Javascript so I'm sure it's an obvious problem that I over looked. Thanks for your help!
accepted answer: http://stackoverflow.com/a/28335572
score: 0
answer count: 1
has title: What is wrong with this code for an Elo rating system
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28335572
has comment: http://stackoverflow.com/comment/45017401
type: Question

http://stackoverflow.com/q/28378885
upvote count: 1
has comment: http://stackoverflow.com/comment/45097537
type: Question
has title: Calculating if user is over 16 years old with JavaScript
tagged with: javascript
tagged with: date
has comment: http://stackoverflow.com/comment/45097533
accepted answer: http://stackoverflow.com/a/28379016
tagged with: validation
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/45097712
has comment: http://stackoverflow.com/comment/45097545
has body: I'm making a form with a date input and a following textbox. I want the text box to become enabled if the user has selected a birthday that is less than 16 years old. So far I have: function checkAge() { var birthDate = document.getElementById("DoB"); var today = new Date(); if (today &gt;= new Date(birthDate.getFullYear() + 16, birthDate.getMonth(), birthDate.getDate())) { // Member over 16, keep parent/guardian textbox disabled. document.getElementById("parentConsent").disable = true; } else { // Require Parent/Guardian permission document.getElementById("parentConsent").disable = false; document.getElementById("parentConsent").setAttribute('required'); } } Here's my current JsFiddle - http://jsfiddle.net/n3d9mLey/
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28379016
score: 1
has comment: http://stackoverflow.com/comment/45097518

http://stackoverflow.com/q/28428746
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45188819
score: 0
has body: I am pretty new in JavaScript development and I have the following situation. Into a JSP page I have the following JavaScript: function chiamaservizio() { alert("INTO chiamaservizio()") &lt;%if(l.size() == 1) { %&gt; alert("l.size == 1"); if (form1.item.checked == true) { alert("form1.item.checked == true"); var pagina = "href=edi.do?serv=3.7"; form1.action = pagina; document.form1.submit(); return true; } else { alert("&lt;fmt:message key="nessun_doc_sel" /&gt;"); return; } &lt;% } else { %&gt; alert("l.size != 1") if (GetCkValue(form1.item) == "") { alert("&lt;fmt:message key="nessun_doc_sel" /&gt;"); return; } else { alert("INTO l.size != 1 &amp;&amp; GetCkValue(form1.item) != stringa vuota"); alert(form1.item); var pagina = "edi.do?serv=3.7"; form1.action = pagina; document.form1.submit(); } &lt;%} %&gt; } I state that I don't know why it is mixes JSP code and JavaScript code, this is very old web application and contains some orrible stuff... Ok, my problem is that, as you can see in the previous code, whe I try to perform alert(form1.item); where form1 is the name of a form into my JSP page: &lt;form name="form1" action="edi.do?serv=3.4" method=post onsubmit="javascript:return controllack()"&gt; this alert show the following message: [object HTML Collection] So I think that it is something like an array but I am absolutly not sure of it. So I want to know what it contains. What contains the form1.item? Is a specific content? How can I discover it? Can I convert it in a string or something like it? Tnx
has comment: http://stackoverflow.com/comment/45189409
upvote count: 1
downvote count: 1
tagged with: jsp
favorite count: 0
has comment: http://stackoverflow.com/comment/45345103
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: What represent this form item object and how can I discover its content using JavaScript?
answer count: 0
has comment: http://stackoverflow.com/comment/45189469
type: Question
tagged with: http://stackoverflow.com/tag/xhtml

http://stackoverflow.com/comment/45055405
comment on: http://stackoverflow.com/q/28355753
has text: Too much i n f o r m a t i o n
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28309199
accepted answer of: http://stackoverflow.com/q/28308578
score: 50
answers question: http://stackoverflow.com/q/28308578
upvote count: 52
type: Answer
has body: ES6 will almost certainly not cover syntax for defining class variables. Only methods and getters/setters can be defined using the class syntax. This means you'll still have to go the MyClass.classVariable = 42; route for class variables. If you just want to initialize a class with some defaults, there is a rich new syntax set for function argument and destructuring defaults you can use. To give a simple example: class Foo { constructor(foo = 123) { this.foo = foo; } } new Foo().foo == 123 new Foo(42).foo == 42
has comment: http://stackoverflow.com/comment/74957592
downvote count: 2
has comment: http://stackoverflow.com/comment/54712664
has comment: http://stackoverflow.com/comment/54735286
type: AcceptedAnswer

http://stackoverflow.com/a/28325654
upvote count: 1
has comment: http://stackoverflow.com/comment/45003461
has comment: http://stackoverflow.com/comment/45003870
accepted answer of: http://stackoverflow.com/q/28325140
has comment: http://stackoverflow.com/comment/44999389
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28325140
score: 1
has body: You could try this method to resize your textarea. If this does not work you should probably set some properties to the container of the textarea.

http://stackoverflow.com/comment/45172210
comment on: http://stackoverflow.com/a/28419200
score: 0
type: AnswerComment
type: Comment
has text: Not getting the desired result

http://stackoverflow.com/a/28300409
has comment: http://stackoverflow.com/comment/44953666
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: You nearly nailed it. What you need is recursion: function appendDom(container, jsonData) { for (var i = 0; i &lt;jsonData.length; i++) { var $divParent = $("&lt;div&gt;&lt;/div&gt;"); $divParent.text(jsonData[i].label).attr('id',jsonData[i].id); if (jsonData[i].children) { appendDom($divParent, jsonData[i].children); } container.append($divParent); } } Here is a fiddle: http://jsfiddle.net/robbyn/x15h2g6v/
upvote count: 6
has comment: http://stackoverflow.com/comment/44953775
answers question: http://stackoverflow.com/q/28299901
score: 6
accepted answer of: http://stackoverflow.com/q/28299901
has comment: http://stackoverflow.com/comment/44953172
has comment: http://stackoverflow.com/comment/44954011
has comment: http://stackoverflow.com/comment/44953552

http://stackoverflow.com/q/28298678
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/1741933
answer count: 0
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44949148
score: 0
has title: application working like 32 bit IE, even if I start with 64 bit IE
has comment: http://stackoverflow.com/comment/44950676
tagged with: jquery
has body: I have a web product (Java) that is developed by another team. In the produce I use the below Javascript for checking the browser is 64 or 32 bit. if (navigator.userAgent.indexOf("WOW64") != -1) { alert("This is a 32 bit browser"); } else if (navigator.userAgent.indexOf("Win64") != -1) { alert("This is a 64 bit browser"); } else { alert("This is a 32 bit OS"); } Whenever I access that product using a 64-bit browser, it says that this browser is a 32-bit one. How can I fix this?

http://stackoverflow.com/q/28325453
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/13635448
tagged with: random
answer count: 3
downvote count: 0
has answer: http://stackoverflow.com/a/28325888
favorite count: 0
upvote count: 1
has title: Javascript function to generate random integers with nonuniform probabilities
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44998592
score: 1
tagged with: probability
has answer: http://stackoverflow.com/a/28326195
accepted answer: http://stackoverflow.com/a/28325888
linked to: http://stackoverflow.com/q/8877249
type: Question
possible better answer: http://stackoverflow.com/a/28326589
has answer: http://stackoverflow.com/a/28326589
has body: In javascript (or jquery) is there a simple function to have four integers with their probability values: 1|0.41, 2|0.29, 3|0.25, 4|0.05 how can I generate these four numbers taking into account their probabilities ? This question is very similar to the one posted here: generate random integers with probabilities HOWEVER the solution posted there: function randomWithProbability() { var notRandomNumbers = [1, 1, 1, 1, 2, 2, 2, 3, 3, 4]; var idx = Math.floor(Math.random() * notRandomNumbers.length); return notRandomNumbers[idx]; } states in the comment "create notRandomNumbers dynamically (given the numbers and their weight/probability)" This is insufficient for my needs. That works well when the probabilities are say 10%,20%, 60%,10%. In that case constructing notRandomNumbers with the required distribution is easy and the array size is small. But in the general case where probabilities can be something like 20.354%,30.254% etc , the array size would be huge to correctly model the situation. Is there a clean solution to this more general problem? EDIT: Thanks Georg, solution accepted, here is my final version, which may be useful for others. I have split the calculation of the cumulative into a separate function in order to avoid extra additions at each call to get a new random number. function getRandomBinFromCumulative(cumulative) { var r = Math.random(); for (var i = 0; i &lt; cumulative.length; i++) { if (r &lt;= cumulative[i]) return i; } } function getCummulativeDistribution(probs) { var cumulative = []; var sum = probs[0]; probs.forEach(function (p) { cumulative.push(sum); sum += p; }); // the next 2 lines are optional cumulative[cumulative.length - 1] = 1; //force to 1 (if input total was &lt;&gt;1) cumulative.shift(); //remove the first 0 return cumulative; } function testRand() { var probs = [0.1, 0.3, 0.3, 0.3]; var c = getCummulativeDistribution(probs); console.log(c); for (var i = 0; i &lt; 100; i++) { console.log(getRandomBinFromCumulative(c)); } }

http://stackoverflow.com/comment/45052976
comment on: http://stackoverflow.com/a/28354191
type: AnswerComment
type: Comment
has text: Cheers for using the Fisher-Yates shuffle. (Although I think the implementation is missing?)
score: 0

http://stackoverflow.com/comment/44975353
type: QuestionComment
comment on: http://stackoverflow.com/q/28312489
has text: Greatest two values thats the condition .. please provide code example of ur idea
score: 0
type: Comment

typeahead
type: Tag
tags question: http://stackoverflow.com/q/28331532
tag name: typeahead

http://stackoverflow.com/a/28533808
downvote count: 0
answers question: http://stackoverflow.com/q/28421505
score: 4
type: Answer
upvote count: 4
has body: I read your comment/use-case. So I update my answer. I suggest to change the design as per this article: MongoDB Many-To-Many The design approach is different and you might want to remodel your approach to this. I'll try to give you an idea to start with. I make the assumption that a User and a Follower are basically the same entities here. I think the point you might find interesting is that in MongoDB you can store array fields and this is what I will use to simplify/correct your design for MongoDB. The two entities I would omit are: Followers and ItemGroups Followers: It is simply a User who can follow Groups. I would add an array of group ids to have a list of Groups that the User follows. So instead of having an entity Follower, I would only have User with an array field that has a list of Group Ids. ItemGroups: I would remove this entity too. Instead I would use an array of Item Ids in the Group entity and an array of Group Ids in the Item entity. This is basically it. You will be able to do what you described in your use case. The design is simpler and more accurate in the sense that it reflects the design decisions of a document based database. Notes: You can define indexes on array fields in MongoDB. See Multikey Indexes for example. Be wary about using indexes on array fields though. You need to understand your use case in order to decide whether it is reasonable or not. See this article. Since you only reference ObjectIds I thought you could try it, but there might be other cases where it is better to change the design. Also note that the ID field _id is a MongoDB specific field type of ObjectID used as primary key. To access the ids you can refer to it e.g. as user.id, group.id, etc. You can use an index to ensure uniqueness as per this question. Your schema design could look like this: As to your other question/concerns Is there a recommended maximum for array lengths before hitting performance issues anyway? the answer is in MongoDB the document size i…

http://stackoverflow.com/a/28346638
score: 1
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28346196
has body: http://jsfiddle.net/mc5q4efz/2/ Simplified : $("#searcher").on("keyup", function (e) { var input = $(this).val(); if (input.length &gt; 0){ $('div.entryDiv &gt; input').hide(); $( "input[id*="+input+"]" ).show(); }else{ $('div.entryDiv &gt; input').show(); } });
type: Answer

http://stackoverflow.com/q/28326632
linked to: http://stackoverflow.com/q/9680215
score: 1
tagged with: web-frontend
has title: URL Preview with tagline and logo in angularjs
type: Question
has body: I have an assignment to implement a preview of an URL which means it will display the logo and tagline just like facebook. I know that we have urLive library in jQuery but i have to implement in angularjs.I have tried following code but it doesn't work. &lt;body ng-app="myapp"&gt; &lt;div ng-controller="AppCtrl"&gt; &lt;iframe ng-src="{{currentUrl}}"&gt; &lt;/iframe&gt; &lt;/div&gt; &lt;script&gt; var app=angular.module('myapp',[]); app.controller('AppCtrl',function($scope,$sce){ $scope.currentUrl = $sce.trustAsResourceUrl("http://facebook.com"); }); &lt;/script&gt; Do we have any such thing in angularjs?`
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 1
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28328565
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/28051061
upvote count: 1

http://stackoverflow.com/a/28322832
upvote count: 2
downvote count: 0
type: Answer
score: 2
answers question: http://stackoverflow.com/q/28322447
has body: Reactjs brings a lot of good features to your application, but you probably already know the big differences between angular and react. So back to your question. One problem with react that are relevant to your question is that it is a new way of thinking. This means that it, for some people, are a little harder to learn than other frameworks. Your UX guy may struggle to get into the react-spirit due to that it also works as a templating-framework. This means that you have to write HTML through the JavaScript code. If you use JSX, the UX guy can at least recognise the HTML tags and do alterations. If you are not using JSX, the UX guy have to learn Reactjs, how to create elements, adding classes etc. CSS is the same in both react and angular so that will not make a difference. My personal experience from a project I am working on is that it is not a big problem to use react with UX developers/consultants. This is because it is often me or other developers that actually changes the HTML-elements. Alone or in coherence with a JavaScript alterations. So my conclusion is: If you are on a hard deadline I would stay with angular since its less to learn and the UX guy can help you more directly. If your focus is performance and the deadline is not so hard (and both of you are eager to learn) I would definitely go for react. Good luck.

http://stackoverflow.com/comment/44960795
type: Comment
comment on: http://stackoverflow.com/q/28300302
score: 0
type: QuestionComment
has text: I am using ember-cli, this is only for jsbin purposes

http://stackoverflow.com/q/28363460
has title: How to add an image's size to the image URL using javascript? Using resize on the fly: w=400&h=153
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28364211
tagged with: image
score: 0
answer count: 1
has body: I have a CMS that I am developing, and I would like it to be dead easy to use it. The next hurdle is the image use: I'd like for the not tech savvy users to just upload their image via TinyMCE's Moximanager and then just add the image whereever they'd like. Then set the image size in the dialogue box (thay can even drag the size bigger or smaller in the TinyMCE interface) Is there an easy way to add a javascript that rewrites all images' HTML on the site like this: &lt;img src="web_images/dscf7280.jpg" alt="" width="400" height="300" /&gt; to: &lt;img src="web_images/dscf7280.jpg?w=400&amp;h=300" alt="" style="max-width:400px;" /&gt; Then I can add a script to resize and cache the image with the user's wanted size, and also add a style max-width that will allow the image to be responsive when forced smaller. Using a resize.php or may be this script I then can add an image resizer and image cacher. (Or is it another solution I should look at to make this more easy?)
tagged with: jquery
has answer: http://stackoverflow.com/a/28364211
type: AnsweredQuestion
type: Question

http://stackoverflow.com/q/28334886
favorite count: 0
has body: Using the node.js framework Meteor - how come the currentUser variable is defined in a template such as here: {{#if currentUser}} {{> add_player_form_template}} {{/if}} but when I call currentUser from the console, it's undefined: however, Meteor.userId is defined: why is this?
has answer: http://stackoverflow.com/a/28335335
tagged with: meteor
upvote count: 11
type: AnsweredQuestion
has title: Meteor currentUser
score: 11
accepted answer: http://stackoverflow.com/a/28335335
type: Question
linked to: http://stackoverflow.com/q/27962532
answer count: 2
possible better answer: http://stackoverflow.com/a/28334916
downvote count: 0
has answer: http://stackoverflow.com/a/28334916
tagged with: javascript

datetimepicker
type: Tag
tags question: http://stackoverflow.com/q/28320074
tag name: datetimepicker
tags question: http://stackoverflow.com/q/28282326

media-queries
tags question: http://stackoverflow.com/q/28380195
tag name: media-queries
type: Tag
tags question: http://stackoverflow.com/q/28392090

http://stackoverflow.com/a/28383567
accepted answer of: http://stackoverflow.com/q/28383542
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/28383542
has body: id must be only one for page, you can add event to class, like this $(".btn").on("click", function (event) { var uid = $(this).data("uid"); // $(this) will be refer to button which was clicked console.log(uid) });

http://stackoverflow.com/comment/45201060
type: Comment
has text: Older IE browsers won't automatically recognize the new tag, and it's a bad habit to keep creating new tags out of the blue. Other developers won't know what it means, for a start. There's no reason not to use `...` instead.
type: AnswerComment
comment on: http://stackoverflow.com/a/28435461
score: 0

http://stackoverflow.com/a/28335042
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45016545
upvote count: 2
has comment: http://stackoverflow.com/comment/45016575
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28334910
type: Answer
has comment: http://stackoverflow.com/comment/45046136
answers question: http://stackoverflow.com/q/28334910
has body: The problem is that the CSS display property of the input-group-addon is set to table-cell by Bootstrap. When your animation is finished, the input is hidden which makes the flag icon expand to take all remaining space. You can fix this in various ways, one simple option is to add an empty span after the input. For example: Example plunker here: http://plnkr.co/edit/qPvbXtEUzvWfsZPkmVRq?p=preview

http://stackoverflow.com/q/28407591
tagged with: controllers
favorite count: 0
tagged with: angularjs
answer count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: dynamic
score: 1
has title: Dynamic controller inject into AngularJS
tagged with: code-injection
type: Question
tagged with: javascript
has body: I need to create dynamic controllers and inject it in my application. This is my structure: I have directives for my dynamic HTML code that call a function that create dynamic controller I inject the dynamic controller into the page I inject the HTML code into the page and connect the dynamic controller with the HTML code HTML PAGE: &lt;html id="ng-app" ng-app"myapp"&gt; &lt;hp:entity mode="onview" name="VIEWS_PhaseOrderSellClose" codeUnique="PhaseOrderSellClose"&gt; ... other html code ... &lt;/openentity&gt; &lt;/html&gt; APP.JS directive .directive('hpEntity', function(Artemide){ /* * Non ha mai logica di disegno. * * &lt;hp:Entity name="" mode="" codeUnique="true/false"&gt;&lt;/hp:Entity&gt; * * default: * interface: false * */ return { restrict: 'E', scope: false, transclude: true, replace: true, template: function(elem, attr){ //TODO: LUCA, mettere tutti i controlli sui parametri obbligatori var _entityObj = { name: attr.name, mode: attr.mode, codeUnique: attr.codeunique, interface: false } var entityControllerName = Artemide.openEntity(_entityObj.name, _entityObj.mode, _entityObj.interface, null, null, null, null, null, null, 'false', false, false, _entityObj.codeUnique); var newTag = "&lt;div ng-init='initEntity(null,null,\""+entityControllerName+"\")' ng-controller='" + entityControllerName + "'&gt;&lt;replace&gt;&lt;/replace&gt;&lt;/div&gt;"; return newTag; }, link: function(scope, element, attrs, ctrl, transclude){ element.find('replace').replaceWith(transclude()); } } }) ARTEMIDE.JS openEntity function function openEntit(...) { var _entityKEY = openEntity(_parEntityID, _parMode, _parInterface, _parUseGroupKEY, _parFormPanelKEYForPreview, _parEntityKEYCaller, _parXMLOpenEntity, _parMakerKey, _parMakerFather, _parSelectionType, _parExclusive, _parVerifyUnique, _parCodeUnique); var _jsCompiled = function($scope, $rootScope, $controller, Artemide, $log) { $scope.initEntity = function(_parFSName, _parPanelKEY, _parEntityKEY) { $log.debug('Artemide da dentro '…
downvote count: 0

http://stackoverflow.com/q/28357187
score: 0
has comment: http://stackoverflow.com/comment/45057798
has comment: http://stackoverflow.com/comment/45057863
answer count: 1
has comment: http://stackoverflow.com/comment/45059176
favorite count: 0
has answer: http://stackoverflow.com/a/28357814
type: UnansweredQuestion
has title: Google Maps JS just showing a gray box?
has comment: http://stackoverflow.com/comment/45057854
has comment: http://stackoverflow.com/comment/45057870
has comment: http://stackoverflow.com/comment/45057819
has comment: http://stackoverflow.com/comment/45059283
upvote count: 1
downvote count: 1
type: Question
tagged with: google-maps
linked to: http://stackoverflow.com/q/16349476
has comment: http://stackoverflow.com/comment/45057900
has body: I'm having trouble with the Google Maps JS library just showing a gray box. I'm not doing anything other than the code that Google has given in their own tutorial so I'm not sure what's wrong here. You can see my code here: https://gist.github.com/anonymous/e0b6fa81a57ce082eb5d I've looked over a bunch of other questions and still don't know exactly why this is happening. Any thoughts?
tagged with: javascript
tagged with: google-maps-api-3
has comment: http://stackoverflow.com/comment/45057841

http://stackoverflow.com/a/28352057
has body: The simplest solution, that avoids rewriting properties on the parent &lt;div&gt; would be to add a single, further, rule to your CSS for the inner-&lt;div&gt;: .content-inner { /* other CSS */ box-sizing: border-box; } This causes the browser to include the borders (and padding) in the assigned width of the elements of that class. Failing that, of course, you could use the CSS calc() function: .content-inner { /* other CSS */ width: calc(100% - 20px); } I do feel it worth reiterating, though, that by default a &lt;div&gt;, set to display: block; will take the full-width of its parent element and its borders contained within. This question feels like you're trying to solve a problem that exists because of a deliberate (though unexplained) choice. Simply put: if you don't float the &lt;div&gt;, and leave, or set, its display as block, then you won't need to use the somewhat experimental (as defined by MDN, in the references below) CSS and will have CSS that's functional back to the days of IE 6 (if not earlier). References: box-sizingspecifications, compatibility. calc()specifications, compatibility.
upvote count: 4
score: 4
downvote count: 0
answers question: http://stackoverflow.com/q/28351980
type: Answer

http://stackoverflow.com/q/28423019
upvote count: 1
has body: I have an email submit form using a javascript and contact.php code Here is the javascript function createRequestObject() { var ro; var browser = navigator.appName; if(browser == "Microsoft Internet Explorer"){ ro = new ActiveXObject("Microsoft.XMLHTTP"); }else{ ro = new XMLHttpRequest(); } return ro; } var http = createRequestObject(); function sendemail() { var email = document.contactform.email.value; document.contactform.send.disabled=true; http.open('get', '/contact.php?email='+email+'&action=send'); http.onreadystatechange = handleResponse; http.send(null); } function handleResponse() { if(http.readyState == 4){ var response = http.responseText; var update = new Array(); if(response.indexOf('|' != -1)) { update = response.split('|'); document.getElementById(update[0]).innerHTML = update[1]; } } } and here is a section of the contact.php <?php $to = ""; //This is the email address you want to send the email to $subject_prefix = ""; //Use this if you want to have a prefix before the subject if(!isset($_GET['action'])) { die("You must not access this page directly!"); //Just to stop people from visiting contact.php normally } $subject = "Newsletter Sign Up"; //The senders subject $message = trim($_GET['email']); //The senders subject $email = ""; //The senders email address mail($to,$subject,$message,"From: ".$email.""); //a very simple send echo 'contactarea| thank you '; //now lets update the "contactarea" div on the contact.html page. The contactarea| tell's the javascript which div to update. ?> and the HTML I am trying to fade the "Thank You" after 5 seconds but I am having some trouble. If I set it to fade on the click of the submit button it doesn't seem to work because it it is not there until the button is clicked. If I set it to fade on load, it only works if the button is clicked before the fade time IS there a way to fade out not on the load of the page, but on the load of the div itself?
has comment: http://stackoverflow.com/comment/45179147
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45179532
has comment: http://stackoverflow.com/comment/45179196
tagged with: forms
has answer: http://stackoverflow.com/a/28423325
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28423191
has title: Fade Contact Form "Thank You" Div
accepted answer: http://stackoverflow.com/a/28423325
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45179118
score: 0
possible better answer: http://stackoverflow.com/a/28423191
favorite count: 0

http://stackoverflow.com/comment/45019632
has text: Sorry it doesnt what I want. What I want is the floating div will be hide first. Then if the user scroll the page the floating div will be displayed at the bottom of the browser not by the page itself. Then when scrolling the floating div is stick at the bottom of the browser then until it reaches the top part of the footer then it will stay at the top of the footer. Then if the user scroll up the page the floating div will be at the bottom of the page again.
score: 0
comment on: http://stackoverflow.com/a/28335854
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28367196
answers question: http://stackoverflow.com/q/28367124
has comment: http://stackoverflow.com/comment/45076035
has body: First you need to change your ajax call to be a 'GET' request. This: type: "POST", Needs to be this: type: "GET", You also need to set the content type to json with: contentType: 'application/json', Update The following line will error: if(data[i].bookId &amp;&amp; data[i].bookName){ I'm guessing you may want that to be something like: if(data[i].bookId != null &amp;&amp; data[i].bookName != null){
upvote count: 2
has comment: http://stackoverflow.com/comment/45076327
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/a/28305099
upvote count: 7
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47711719
type: Answer
accepted answer of: http://stackoverflow.com/q/28295670
answers question: http://stackoverflow.com/q/28295670
downvote count: 0
score: 7
has comment: http://stackoverflow.com/comment/47697083
has body: Use Element.getBoundingClientRect() to get the element coordinates Here's just a small example that retrieves the .left Rect property from a CSS3 translated (animated) element: const box = document.getElementById('box'); const printer = document.getElementById('printer'); const printBoxRectLeft = () =&gt; { printer.textContent = box.getBoundingClientRect().left; requestAnimationFrame(printBoxRectLeft); }; printBoxRectLeft(); #box{ width:30px; height:30px; background:red; animation: animX 3s infinite alternate; } @keyframes animX { to{ transform:translateX(300px); }} &lt;div id="printer"&gt;&lt;/div&gt; &lt;div id="box"&gt;&lt;/div&gt;
has comment: http://stackoverflow.com/comment/44984176
has comment: http://stackoverflow.com/comment/47696986
has comment: http://stackoverflow.com/comment/95506815
has comment: http://stackoverflow.com/comment/95509688
has comment: http://stackoverflow.com/comment/47697241
has comment: http://stackoverflow.com/comment/47695436

http://stackoverflow.com/a/28325308
downvote count: 0
score: 1
has body: I'd opt for a single timer that loops through all images. Then when the timer isn't needed anymore I can just discard the single timer. var timer = setInterval(swapImages, 2000); function swapImages() { $(.div-id option:selected).each(function(){ $(.div-id img).attr("src", "new-source-path"); }); } // some time later clearInterval(timer); PS. I assume that your code is some pseudo code so I copied your namings
accepted answer of: http://stackoverflow.com/q/28325172
answers question: http://stackoverflow.com/q/28325172
upvote count: 1
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/45118027
type: Comment
type: QuestionComment
has text: Can you put that as an answer please? Another thing. I read the documentation of `unshift`, `shift`, `push` and `pop` and what I want is to push at the end and pop at the front (as a Queue should behave) so I need to use `push` and `shift` respectively here! *(I need FIFO and not LIFO behavior)*
comment on: http://stackoverflow.com/q/28390118
score: 0

http://stackoverflow.com/comment/45150414
comment on: http://stackoverflow.com/q/28408189
score: 0
type: Comment
type: QuestionComment
has text: So, my question is what can I use instead of FileReader that would work the same way in IE8 and IE9, or if users are using Opera Mini, or have old Firefox, Chrome and etc... there might have been new libraries or scripts that handle that kind of thing. Are you sure my question is duplicate?

http://stackoverflow.com/comment/45087549
has text: see note added to answer above
type: Comment
comment on: http://stackoverflow.com/a/28373495
score: 0
type: AnswerComment

http://stackoverflow.com/q/28429537
has comment: http://stackoverflow.com/comment/45190155
has comment: http://stackoverflow.com/comment/45190243
tagged with: javascript
has title: TypeError: Cannot read property 'name' of undefined in angularJS
score: 0
has comment: http://stackoverflow.com/comment/45190205
has body: I want to display a error message when some one forget to enter the group name. So i have created a group.name model for the input tag. Condition is checked when createGroup function is called(on submitting the form). But it is giving "TypeError: Cannot read property 'name' of undefined" while reading name property. Name Save Cancel Controller $scope.createGroup = function(group) { selectedRows = $scope.gridApi.selection.getSelectedRows(); $scope.emptyName = false $scope.selectServer = false; if (!group.name || !group) { console.log("group", group); $scope.emptyName = true; $scope.selectServer = false; } }
answer count: 1
has answer: http://stackoverflow.com/a/28429775
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45190361
type: Question

http://stackoverflow.com/comment/45033564
comment on: http://stackoverflow.com/a/28344515
score: 0
type: Comment
has text: Dang, can't believe I missed it... Thank you very much! :)
type: AnswerComment

http://stackoverflow.com/comment/44945179
comment on: http://stackoverflow.com/q/28295072
type: QuestionComment
type: Comment
score: 1
has text: [Just get the width of your screen in JS](http://tripleodeon.com/2011/12/first-understand-your-screen) they said. gl;hf

http://stackoverflow.com/comment/45102791
comment on: http://stackoverflow.com/a/28381992
type: Comment
has text: @lightnguyen the updated answer works. When I input `15-02-2015` and `18-02-2015` the price is `300`, which is three days, which is correct.
score: 1
type: AnswerComment

http://stackoverflow.com/comment/45161491
score: 0
type: Comment
has text: @Liondancer `url: ""` will cause it to request the current page again, which presumably exists and responds with a success status code.
comment on: http://stackoverflow.com/a/28413821
type: AnswerComment

http://stackoverflow.com/q/28396919
accepted answer: http://stackoverflow.com/a/28397227
has comment: http://stackoverflow.com/comment/45129818
has answer: http://stackoverflow.com/a/28397011
has answer: http://stackoverflow.com/a/28396949
has answer: http://stackoverflow.com/a/28396947
score: 0
has body: I'm looking for a way to define javascript function arguments by array so that, for example, the following code would work. Is it possible? args = ["foo", "bar"] func = function(???) { //not sure what (if anything) could go here to make it work console.log(foo) console.log(bar) } func (5, "good times") // logs "5" and "good times" EDIT: The offered solutions are good but don't address the problem because retention of the specific name is important. I have a function with an extremely long list of arguments, and I'd rather define them as an array then in the actual function definition.
has comment: http://stackoverflow.com/comment/45132645
answer count: 5
linked to: http://stackoverflow.com/q/8862665
has comment: http://stackoverflow.com/comment/45148419
has comment: http://stackoverflow.com/comment/45130350
possible better answer: http://stackoverflow.com/a/28396949
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45129828
has title: Define Javascript Argument Names With An Array
type: Question
has answer: http://stackoverflow.com/a/28397044
tagged with: javascript
has answer: http://stackoverflow.com/a/28397227

http://stackoverflow.com/q/28318004
has body: I have a few DimpleJS graphs (line, pie, bar etc.). How do I: Animate the graph draw - Most of the D3 examples I've seen appear before the user's eyes i.e. you can see the bar chart's height increasing, the timeline getting drawn etc. How do I do that in DimpleJS? I tried storyboard but that doesn't seem to be working. How do I give the user an option to download the graph (as jpg/png/excel etc.) ? Thanks-in-advance!
tagged with: dimple.js
tagged with: d3.js
accepted answer: http://stackoverflow.com/a/28327879
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28327879
type: Question
has title: DimpleJS - how to animate graph and download the graph
answer count: 1
tagged with: javascript
score: 0

http://stackoverflow.com/q/28330160
answer count: 1
has answer: http://stackoverflow.com/a/28331071
accepted answer: http://stackoverflow.com/a/28331071
has comment: http://stackoverflow.com/comment/45008687
tagged with: dojo
type: AnsweredQuestion
score: 0
has body: As a newbie in Javascript I have a question regarding public method overriden. It is about Dojo copyState method, check the doc here. By default dojo allows copy nodes, but I would like to turn it off, so that i create following Dojo.Dnd object: var order_list = dojo.dnd.Source("order_list"); then how to override the public method? dojo.byId("order_list").copyState:function( keyPressed, self ){return false;}; seems does not work, FireBug gives: SyntaxError: missing ; before statement dojo.byId("order_list").copyState:function( keyPressed, self ){return false;}; ---------------------------------|
type: Question
tagged with: javascript
has title: How to override public method within Javascript instance

http://stackoverflow.com/a/28379995
downvote count: 0
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28379939
has body: You have to initialize click even once document is loaded. Also you have syntax error in your code. Try this one: $(document).ready(function() { var get=3; $('#edit').click(function(event){ alert('You are getting:' + get); }); });

http://stackoverflow.com/a/28323495
answers question: http://stackoverflow.com/q/28322601
has body: A reliable way to do this would be to use jQuery animation queues and a deferred object in a recursive loop. The advantage of this method is the ease you can add animations into the fade function. It is also much easier to read than a bunch of nested callbacks. // Get all the div elements var divs = $('div'); /** * Fade in a specific indexed div element * @param {integer} i * @return {object} $.promise */ function fade(i) { return divs.eq(i) .fadeIn(3000) .delay(6000) .fadeOut(3000) .promise(); } /** * Recursive sequence runner * @param {integer} i */ function runSequence(i) { // If i is null/false set it to 0 i = ! i ? 0 : i; // Run animation on item i var promise = fade(i); // Use the promise to queue up the next item // by calling this function again when the // animation is complete promise.then(function() { if (i &gt; divs.length) { i = 0; } runSequence(++i); }); } // Run the sequence for the first time runSequence(); JSFiddle example
type: Answer
score: 0

http://stackoverflow.com/a/28374035
upvote count: 1
downvote count: 0
has body: You could change the position to fixed on .black_overlay and .white_content so that the body is the parent element. I updated your fiddle: http://jsfiddle.net/vmsfyqz2/1/
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/28373849
accepted answer of: http://stackoverflow.com/q/28373849
score: 1

http://stackoverflow.com/comment/52900135
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28284765
has text: Still, browsers allowed me to rewrite support.domain.com to domain.com on my iframe side without moaning. So I'm kinda lost.

http://stackoverflow.com/comment/44977369
comment on: http://stackoverflow.com/q/28313235
score: 0
type: Comment
type: QuestionComment
has text: Certainly is strange. If you type in a valid email, password and confirmed password on the first try, it allows you to pass to the next tab... Which is what it is supposed to do. However, if you cause a validation error, it does not let you proceed despite having fixed the error(s)... Which is the problem.

http://stackoverflow.com/a/28352719
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28352572
answers question: http://stackoverflow.com/q/28352572
score: 4
type: AcceptedAnswer
has body: setState shallowly merges current state with the new state you pass to it. If you merge { flags: { loading: false, visible: true } } with { flags: { loading: true } } the entire flags property will be overwritten and replaced. But if you had another property called say flags2 in the initial state (at the same level with flags), that would not be affected.
type: Answer
upvote count: 4

http://stackoverflow.com/comment/45023086
type: QuestionComment
has text: Could you edit where you have this code? It seems that there is something with the scope
comment on: http://stackoverflow.com/q/28338832
score: 0
type: Comment

http://stackoverflow.com/comment/44932481
type: AnswerComment
has text: I also did not see a reason to down vote this answer. Thank you for your reply.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28289310

http://stackoverflow.com/q/28369700
tagged with: jquery
tagged with: asp.net
favorite count: 0
has answer: http://stackoverflow.com/a/28370336
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/28019793
downvote count: 0
score: 1
has title: dynamically creating a full one to many relationship on a single page
type: Question
has body: I'm new to MVC, but have done a bunch of reading the past few months, and I've ran into some issues when trying to build a one to many relationship dynamically on the page. I've set up the logic and can accomplish this through multiple page loads but I want the form to be more dynamic, so I'm not sure what the correct way to do this is. For testing purposes I scaled down my Model just to see if I can get the interaction I want before I apply it to my project and what I have is this: Generated models from my Db. public partial class TestIncident { public TestIncident() { this.TestGeoKits = new HashSet&lt;TestGeoKit&gt;(); } public int RecordID { get; set; } public string OwnerFirstName { get; set; } public string OwnerMiddleName { get; set; } public string OwnerLastName { get; set; } public virtual ICollection&lt;TestGeoKit&gt; TestGeoKits { get; set; } } RecordID being my PKey for the class above public partial class TestGeoKit { public int RecordID { get; set; } public int KitID { get; set; } public bool SubmittedForTestingFlag { get; set; } public string SubmissionLocation{ get; set; } public Nullable&lt;System.DateTime&gt; SubmissionDate { get; set; } public bool Processed { get; set; } public Nullable&lt;System.DateTime&gt; ReturnDate { get; set; } public string Notes { get; set; } public virtual TestIncident TestIncident { get; set; } } RecordID being my FKey relation and KitID being my PKey for this table. Now, I need to set up a Create View that contains both the Form associated with the TestIncident AND has the option to click an ADD button to populate Partials containing the Form associated with my TestGeoKits on the same page, instead of after a postback and redirect (How I currently have it). I've tried piecing information from multiple posts together to accomplish this, but one way or another I run into a bunch of problems and even more questions.. Logically I would think, being MVC uses Entity Framework, that on my Create TestIncident page I can have an…
tagged with: asp.net-mvc
tagged with: javascript
has comment: http://stackoverflow.com/comment/45080319
upvote count: 1
answer count: 1

http://stackoverflow.com/q/28284765
answer count: 2
has answer: http://stackoverflow.com/a/71644387
has comment: http://stackoverflow.com/comment/44923531
score: 4
has answer: http://stackoverflow.com/a/28374604
has comment: http://stackoverflow.com/comment/52900069
has comment: http://stackoverflow.com/comment/44923562
upvote count: 4
has title: Uncaught SecurityError: Blocked a frame with origin ... from accessing a frame with origin
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44923959
accepted answer: http://stackoverflow.com/a/28374604
linked to: http://stackoverflow.com/q/14892556
tagged with: security
tagged with: same-origin-policy
has comment: http://stackoverflow.com/comment/52896559
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/52900135
has comment: http://stackoverflow.com/comment/44948418
has body: I've made a component for an SAP solution (whatever) that is embedded into a report through an iframe. After I deployed the report on an SAP plateform (BO), I got this error (on Chrome, but does not work on IE or FF either): Uncaught SecurityError: Blocked a frame with origin "http://support.domain.com" from accessing a frame with origin "http://support.domain.com". The frame requesting access set "document.domain" to "domain.com", but the frame being accessed did not. Both must set "document.domain" to the same value to allow access. The iframe is embedded into my component so it's suppose to run on the same domain with same port than report. I found this post on SO and this one, but it does not really helped me to understand what I need to do. Is there a way to get rid of this, or at least work around this ? Thanks :). EDIT: Host Page URL : http://support.domain.com/BOE/OpenDocument/opendoc/openDocument.jsp?sIDType=CUID&amp;iDocID=AbmffWLjCAlFsLj14TjuDWg URL of the file calling a property on the iframe (and generating the error) : http://support.domain.com/BOE/OpenDocument/1411281523/zenwebclient/zen/mimes/sdk_include/com.domain.ds.extension/res/cmp/js/component.js URL of the frame : http://support.domain.com/BOE/OpenDocument/1411281523/zenwebclient/zen/mimes/sdk_include/com.domain.ds.extension/res/cmp/js/map/js/map.html The iframe embed itself some script tag, I can see everything loading fine in the Network tag of the console. Maybe it can help. EDIT 2 : I just realized SAP report is itself embedded into an iframe. That means my iframe is within an iframe, that might be the issue. Still, when lauching the report from Eclipse, everything is working.
has comment: http://stackoverflow.com/comment/52899404
linked to: http://stackoverflow.com/q/17308330
favorite count: 0
has comment: http://stackoverflow.com/comment/44923685
linked to: http://stackoverflow.com/q/25098021
has comment: http://stackoverflow.com/comment/52055437
possible better answer: http://stackoverflow.com/a/71644387
type: Question
tagged with: iframe

http://stackoverflow.com/comment/44970639
type: AnswerComment
score: 0
type: Comment
has text: But I don't see the specific part that takes a string and converts it to a list of location objects? Also do I even need an api key, I was using google map api v3 (with jquery plugin) without using a key and I could see the map...
comment on: http://stackoverflow.com/a/28309610

http://stackoverflow.com/q/28362207
has answer: http://stackoverflow.com/a/28363096
has body: While calling the below function from HTML form tag (&lt;form method="post" onsubmit="ajacxpost(this.form)"&gt;) then, getting an error like: "NS_ERROR_NOT_AVAILABLE: prompt aborted by user" Please help me to solve this.. function ajacxpost(form){ var password=$("#password").val(); var userId=$("#userId").val(); var json={"userId":userId,"password":password}; $.ajax({ type:"Post", url:"login/login.html", data:JSON.stringify(json), success: function(response){ if(response.status=="success"){ alert("You are Registered"); } else{ alert("Something went Wrong"); } }, error:function(e){ alert("error"+e.status); } }); }
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45066707
answer count: 1
tagged with: javascript
has title: getting "NS_ERROR_NOT_AVAILABLE: prompt aborted by user" in javascript
score: 0

http://stackoverflow.com/comment/45131975
type: Comment
comment on: http://stackoverflow.com/a/28397840
score: 0
type: AnswerComment
has text: It doesn't work. I click on the rectangle and it doesn't animate unless I click on it. I want it to 'reanimate' when the same function is called. Basically, resetting the value of cube.width.

http://stackoverflow.com/comment/45161906
type: Comment
comment on: http://stackoverflow.com/a/28404537
has text: tried that too. I actually looked at the marty code and it allows for either an array or a single mixin there. I've added a live version here http://jsbin.com/lekegicumo/2/edit?html,js,console,output so others can see what I'm doing
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45141143
score: 0
comment on: http://stackoverflow.com/q/28402931
has text: @PHPglue oh..yeah i have done this wrongly. Thank you.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45034277
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28331069
has text: Thanks (again) @JFlox. I found that the `margin` was cutting off the smaller value on the right since it applies that value to all sides. So I took it a step further and just dealt with the top and bottom margins. My final **solution [here](http://jsfiddle.net/Grandizer/ngxe5o5x/2/)**

http://stackoverflow.com/q/28280235
has comment: http://stackoverflow.com/comment/44944637
has comment: http://stackoverflow.com/comment/44944368
has body: The error's appearing at line 1631 in the THREE.js library file itself. Here's the code I'm running: var cube_geo = new THREE.BoxGeometry(.1, .1, .1, 10, 10, 10); var smooth = cube_geo.clone(); smooth.mergeVertices; var modifier = new THREE.SubdivisionModifier(2); modifier.modify(smooth); var cube_mat = new THREE.MeshPhongMaterial( {color: 0x000000, specular: 0x222222} ); var cube = new THREE.Mesh(smooth, cube_mat); scene.add(cube);
type: Question
tagged with: javascript
has title: "Uncaught TypeError: cannot read property 'x' of undefined" in the THREE.js library file when I try to implement THREE.SubdivisionModifier()?
has comment: http://stackoverflow.com/comment/44933468
score: 0
has comment: http://stackoverflow.com/comment/44914639
type: UnansweredQuestion
tagged with: three.js
answer count: 0

http://stackoverflow.com/q/28421307
tagged with: javascript
tagged with: while-loop
answer count: 1
favorite count: 0
tagged with: casperjs
has title: How to tell CasperJS to loop through a series of pages
has body: I try to make CasperJS achieve the following: Go through a series of pages that are named sequentially by date. On each page, locate a PDF link. Download the PDF. I got some working code, but I don't understand how CasperJS is going through the sequence of events. For instance, in the code sample below, CasperJS tries to process step 2, and throws a "ReferenceError: Can't find variable: formDate", while step 1 isn't executed at all for some reason. What's wrong with my reasoning? It seems to me that the while loop is executed at a different speed than the casper.then methods. casper.start(); casper.thenOpen('http://www.example.com', function() { this.echo(this.getTitle()); }); casper.then(function() { var start = new Date('2013-01-01T00:00:00'); var end = new Date('2013-01-31T00:00:00'); while(start &lt; end) { // step 1: define formDate casper.then(function() { var formDate = start.getFullYear()+"-"+("0" + (start.getMonth() + 1)).slice(-2) +"-"+("0" + start.getDate()).slice(-2) ; casper.echo(formDate); }); // Step 2: open the page and download the file casper.thenOpen('http://www.example.com/' + formDate, function() { var url = this.getElementAttribute('div#pdffulllink a.pdf', 'href'); this.echo(url); this.download(url, 'Downloaded_' + formDate + '.pdf'); }); casper.then(function() { // Step 3: redefine start var newDate = start.setDate(start.getDate() + 1); start = new Date(newDate); }); } }); casper.run(function() { this.echo('Done.').exit(); });
has answer: http://stackoverflow.com/a/28552021
linked to: http://stackoverflow.com/q/11488014
type: AnsweredQuestion
type: Question
score: 12
upvote count: 12
accepted answer: http://stackoverflow.com/a/28552021
downvote count: 0

http://stackoverflow.com/comment/45146643
has text: I have updated my answer and reading text area value using `.val()` instead of `.text()` (which was causing problem). See demo link also.
comment on: http://stackoverflow.com/a/28404445
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28317986
type: Answer
answers question: http://stackoverflow.com/q/28316478
has body: It turned out that I overlooked one of the sub-objects within my object, this class indeed only had a constructor with parameters. Everything works now. BTW: It would be way more helpful if the error messages would cleary state which object it is talking about. The same applies for error messages concerning uninitialized objects.
score: 0

http://stackoverflow.com/q/28326283
has title: Invoke a jQuery function on div clicking on different div
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45000181
has body: I've a jQuery validation function. function validationCheck() { if($(this).val()==''){ $(this).addClass('validation-error'); return false; } } I need to invoke this function when I click on a button. $('#stepbutton1').click(function(){ $("#geocomplete").validationCheck(); //Call the function (this wont work) }); How can I invoke this function to check the validation on the id stepbutton1 ?
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28326329
has answer: http://stackoverflow.com/a/28326363
answer count: 3
has answer: http://stackoverflow.com/a/28326329
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/28326363
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28326590

http://stackoverflow.com/a/28352400
has body: I think the other answers are more interesting, but as an alternative. consider these three Css Declarations. width: auto; margin: 0; display:block; the auto width of the element should fill it's parent container, when the margin is set to 0 on margin-left and margin-right, the display is set to block. I removed float and the percentage widths.. Sample Code Snippet .content { /* width: 90%; float: left; */ position:relative; left:0; top:0; display:block; margin:0; padding:0; width: auto; /*margin is 0, so with width set to auto, and display being block.. width auto should go to 100%*/ } .content-inner { /* float: left; width: 100%; */ position:relative; left:0;top:0; background: #6DA249; border: 10px solid #333333; display:block; width:auto; margin:0; padding:0; overflow:auto; } body { position:relative; left:0;top:0; display: block; padding: 0; margin: 0; width:auto; overflow:auto; } &lt;div class="content"&gt; &lt;div class="content-inner"&gt; dfg &lt;/div&gt; &lt;/div&gt; when you set float on an element, and don't specify clear on the parent element (Container), the properties (width and height) of the parent don't pickup and/or account for the size of the floated child element.. which will mess up the auto width. Additionally, you will want to explicitly set the overflow style declaration on the parent/containers..
answers question: http://stackoverflow.com/q/28351980
score: 0
type: Answer

http://stackoverflow.com/comment/44968235
type: Comment
has text: Thanks, i have pasted to code into my js file, but nothing happens when i select the 'other' option. It should show up isn't it? This is the live site: http://thewedsiteof.com/natandryan/#rsvp
comment on: http://stackoverflow.com/a/28308474
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45067024
comment on: http://stackoverflow.com/q/28358108
score: 0
type: QuestionComment
type: Comment
has text: maybe in the second one, when you put attr('d', line).attr("d', line); the second 'd' overwrites the first. where as in the first way you did it, it added it. Try splitting them up and see if it works

http://stackoverflow.com/q/28390200
has answer: http://stackoverflow.com/a/28390303
tagged with: datatables
has comment: http://stackoverflow.com/comment/45117899
has comment: http://stackoverflow.com/comment/45118221
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/6654864
has comment: http://stackoverflow.com/comment/45117858
has title: plugin DataTables jquery : how display formated Date?
type: Question
accepted answer: http://stackoverflow.com/a/28390303
has body: Among my source properties , I have a column created by doing javascript code var col_date = new Date(timestamp) It display me a column with text formated like this : Sun Feb 08 2015 00:00:00 GMT+0100 (Paris, Madrid) I would like to display it in MM/DD/YYYY or YYYY/MM/DD formar ( whatever , I want it short and easily readable) Do you know how to do it please?
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/a/28301167
type: AcceptedAnswer
has body: Just use the required attribute: First Name: Last Name: http://html5doctor.com/html5-forms-introduction-and-new-attributes/#required Work smart, not hard ;) Since this isn't useful... First Name: Last Name:
type: Answer
has comment: http://stackoverflow.com/comment/44954172
answers question: http://stackoverflow.com/q/28301060
accepted answer of: http://stackoverflow.com/q/28301060
has comment: http://stackoverflow.com/comment/44954407
has comment: http://stackoverflow.com/comment/44953715
has comment: http://stackoverflow.com/comment/44954481
has comment: http://stackoverflow.com/comment/44955104
score: 0

http://stackoverflow.com/comment/45161296
type: Comment
score: 0
has text: rather looks like timestamp, which is what I did not want.
type: AnswerComment
comment on: http://stackoverflow.com/a/28413899

http://stackoverflow.com/q/28315652
has title: attach event handler for dynamic element
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44981120
has body: I try to attach event handler for dynamic element but failed. Here's some of my code. I want event can be called by dynamic element. Maybe javascript provide function to support attach event for dynamic element automatically without bind it again such as jQuery live or on method. I want to add functionality to load city data while state or province selected to Magento Sales > Order > Create New Order Page without have to search a correct javascript file and try to bind event on it again. window.addEventListener('load', function(){ function getCity(){ id= this.selectedIndex; name= this.name; getKota(id, name); } billing_address_region_id= document.getElementsByName('order[billing_address][region_id]'); shipping_address_region_id= document.getElementsByName('order[shipping_address][region_id]'); var event = new Event('change'); billing_address_region_id[0].addEventListener('change', getCity, false); shipping_address_region_id[0].addEventListener('change', getCity, false); billing_address_region_id[0].dispatchEvent(event); shipping_address_region_id[0].dispatchEvent(event); }); Thanks a ton
accepted answer: http://stackoverflow.com/a/28336028
type: Question
possible better answer: http://stackoverflow.com/a/28315731
tagged with: magento
has answer: http://stackoverflow.com/a/28315731
tagged with: javascript
has comment: http://stackoverflow.com/comment/44980589
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/44980784
has comment: http://stackoverflow.com/comment/44980926
has comment: http://stackoverflow.com/comment/44980983
has comment: http://stackoverflow.com/comment/44980638
has answer: http://stackoverflow.com/a/28336028

http://stackoverflow.com/comment/45044915
has text: possible duplicate of [Focus on list item on down arrow press](http://stackoverflow.com/questions/15929117/focus-on-list-item-on-down-arrow-press)
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28350164

cart
tags question: http://stackoverflow.com/q/28398772
type: Tag
tags question: http://stackoverflow.com/q/28396981
tag name: cart

http://stackoverflow.com/q/28434790
type: UnansweredQuestion
tagged with: sockets
has answer: http://stackoverflow.com/a/33912622
has comment: http://stackoverflow.com/comment/45200400
tagged with: node.js
score: 3
upvote count: 3
type: Question
downvote count: 0
has comment: http://stackoverflow.com/comment/45202894
tagged with: javascript
linked to: http://stackoverflow.com/q/8970880
has comment: http://stackoverflow.com/comment/45199729
answer count: 2
has answer: http://stackoverflow.com/a/28435030
favorite count: 0
has body: How can I enable cross domain for express.io because I need for a cordova aplication, chrome says "No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin", this is my code. server var app = require('express.io')(); app.http().io() app.listen(2000); app.io.set('origins', '*:*'); app.io.set('transports', [ 'websocket' , 'flashsocket' , 'htmlfile' , 'xhr-polling' , 'jsonp-polling' ]); app.get('/', function (req, res) { res.setHeader('Access-Control-Allow-Origin','*'); res.send(200, 'Todo fino'); req.io.route('connection'); }); app.io.route('connection', function (req) { console.log('User connected'); }); client Document Probando Socket system
has title: express + socket.io cross domain

http://stackoverflow.com/comment/45141996
type: QuestionComment
comment on: http://stackoverflow.com/q/28403518
type: Comment
has text: D3.js check out d3js.org
score: 0

http://stackoverflow.com/q/28283158
type: UnansweredQuestion
tagged with: javascript
type: Question
has comment: http://stackoverflow.com/comment/44920728
score: 0
has comment: http://stackoverflow.com/comment/44920999
has comment: http://stackoverflow.com/comment/44921214
has title: D3 height attribute using a function
has body: I'm trying to use a function to use d3.scale() for my height and I keep getting an error: var heightScale = function(d) { console.log(d); return d3.scale.linear() .domain([d['clicks'], 0]) .range([270, 20]) }; var bars = vis.selectAll("rect") .data(clicks) .enter() .append("rect") .attr("width", 30) .attr("height", function(d) { return heightScale(d)}) .attr("fill", "red") .attr("x", function(d,i){return i * 60}) .attr("transform", "translate(" + (max_width + 20) + ", 20)"); Error: Invalid value for attribute height="function i(n){return o(n)}" Can you spot anything wrong with this?
answer count: 0
tagged with: d3.js

http://stackoverflow.com/a/28315804
type: Answer
has comment: http://stackoverflow.com/comment/44986168
has body: 8 to 15 characters which contain only characters, numeric digits, underscore and first character must be a letter function CheckPassword(input) { var pass= /^[A-Za-z]\w{8,15}$/; if(input.value.match(pass)) { return true; } else { alert('Password Is Not Valid') return false; } }
accepted answer of: http://stackoverflow.com/q/28315662
answers question: http://stackoverflow.com/q/28315662
score: 0
has comment: http://stackoverflow.com/comment/44980997
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44981301
has comment: http://stackoverflow.com/comment/44986904
has comment: http://stackoverflow.com/comment/44986674
has comment: http://stackoverflow.com/comment/44999344

http://stackoverflow.com/a/28312769
has comment: http://stackoverflow.com/comment/44975879
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28312702
type: Answer
has comment: http://stackoverflow.com/comment/44976066
score: 2
accepted answer of: http://stackoverflow.com/q/28312702
upvote count: 2
has comment: http://stackoverflow.com/comment/44976960
has comment: http://stackoverflow.com/comment/44976943
has body: You need to remove double quotes from title in the expression. fld_ID = $('tr[title="Grp2"] td[title="ID"]').text() ; working fiddle: http://jsfiddle.net/3y0t8y90/
has comment: http://stackoverflow.com/comment/44976174

http://stackoverflow.com/comment/44966960
score: 0
type: Comment
has text: Figured this out myself. If anyone wants the answer, feel free to let me know and I'll post what I did.
type: QuestionComment
comment on: http://stackoverflow.com/q/28287361

http://stackoverflow.com/comment/45108315
type: QuestionComment
has text: Can post `series.xml` ?
type: Comment
comment on: http://stackoverflow.com/q/28384459
score: 0

http://stackoverflow.com/comment/45104187
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28382772
has text: The first step I think is what I needed. I was looking for the global script search but couldn't work out how to get it up. I did try the second method, but it only displayed the jQuery functionality that was ready to accept the call.

http://stackoverflow.com/comment/45412696
comment on: http://stackoverflow.com/q/28337014
score: 0
type: Comment
type: QuestionComment
has text: Did these answers help you or answer your question? If not please let us know so we can help more. Otherwise, would you please mark the most helpful answer as "accepted"? Thanks!

http://stackoverflow.com/a/28432033
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/28431909
upvote count: 2
has body: read this you will get idea about it... http://api.jquery.com/jquery.noconflict/
type: Answer

http://stackoverflow.com/a/28407910
has body: I managed to do something that works, and could be useful for you. It's not perfect but is a good start. Here is the code: Parent page: Hello, parent page! Parent model: Parent result: {{ data.foo }} Child page: Hello, child page! Child result: {{ data.foo }} app.js var app = ng.module('myApp', []); app.factory('DataService', ['$rootScope', '$window', function ($rootScope, $window) { var // Variables dataScope, // Functions getScope; dataScope = $rootScope.$new(true); getScope = function () { return dataScope; }; $window.DataService = { getScope: getScope }; return { getScope: getScope }; }]); app.controller('ParentController', ['$scope', 'DataService', function ($scope, DataService) { $scope.data = DataService.getScope(); }]); app.controller('ChildController', ['$scope', '$window', '$interval', function ( $scope, $window, $interval ) { $scope.data = $window.parent.DataService.getScope(); // makes a $scope.$apply() every 500ms. Without it, data doesn't change $interval(ng.noop, 500); }]); All of this code leads to this: The important part is $scope.data = $window.parent.DataService.getScope(); in the child controller. That's where it fetches the shared $scope. Of course, all this works only if the parent & the iframe are under the same domain. Else, it becomes a whole other complicated story... Hope this will help you.
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28318633
upvote count: 7
score: 7

http://stackoverflow.com/comment/45146432
type: AnswerComment
score: 0
type: Comment
has text: yes that's fine but i can't scrap code of particular id information such as place_id how?
comment on: http://stackoverflow.com/a/28405864

http://stackoverflow.com/a/35053895
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28429116
score: 2
has body: var value = "68661-68662"; var pagina = "edi.do?serv=3.C&amp;ids=" + value; alert(pagina);
upvote count: 2

http://stackoverflow.com/comment/61191938
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/36808570
has text: prudhvi, how does this answer the question?

http://stackoverflow.com/comment/45159509
comment on: http://stackoverflow.com/a/28412806
score: 0
type: AnswerComment
type: Comment
has text: Although this may address the OP's particular bug, your answer promotes incorrect separation of concerns with the use of `$scope` inside the service. That makes the service less re-usable, or at any rate, less-testable.

http://stackoverflow.com/comment/110227318
has text: @CoryDanielson what should be the recommended way then?
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28314706
type: Comment

http://stackoverflow.com/q/28342608
linked to: http://stackoverflow.com/q/25512015
type: Question
has answer: http://stackoverflow.com/a/28343100
tagged with: javascript
has comment: http://stackoverflow.com/comment/45029784
answer count: 2
downvote count: 0
favorite count: 0
tagged with: promise
has body: Is there a way to pass a return value of one promise down the chain not to the next one but to the following ones? Currently we typically nest promises to keep the value in the function scope, like this: return getOrder() .then(function (order) { return getOrderlines(order) .then(function (orderLines) { //do something with order and orderlines processOrderAndOrderlines(order, orderLines); }); }) .then(function () { //do something else }); Is it possible to somehow pass the order object down the promise chain to get something similar to: return getOrder() .then(function (order) { return getOrderlines(order); }) .then(function (orderLines) { //do something with order and orderlines processOrderAndOrderlines(order, orderLines); }); .then(function () { //do something else });
linked to: http://stackoverflow.com/q/28250680
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45029676
type: UnansweredQuestion
tagged with: angular-promise
has answer: http://stackoverflow.com/a/28342972
has title: Flattening nested promises in AngularJS
duplicate of: http://stackoverflow.com/q/28250680
has comment: http://stackoverflow.com/comment/45029876
score: 1
has comment: http://stackoverflow.com/comment/45034084
upvote count: 1

http://stackoverflow.com/q/28356802
accepted answer: http://stackoverflow.com/a/28356972
tagged with: reactjs
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/35104909
upvote count: 4
has answer: http://stackoverflow.com/a/35104909
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/36491978
has body: I understand how to use it in simple situations: {(this.state.show) ? Show : null} But how to use it for big DOM? { if (this.state.show) { Hi {this.state.text} } else { {this.state.text} } } Of course, it doesn't work. How to do it correctly?
favorite count: 0
has title: How to use If-Else in JSX
has answer: http://stackoverflow.com/a/28356972
type: Question
score: 4
answer count: 3

http://stackoverflow.com/comment/45123010
comment on: http://stackoverflow.com/a/28392628
type: AnswerComment
has text: @KennethLigutom Should not happen unless your comparison (`y == x`) fails. Add some debugging output to test whether that comparison works.
score: 0
type: Comment

http://stackoverflow.com/comment/68811777
type: Comment
comment on: http://stackoverflow.com/a/28416221
has text: just found this old topic, I created the multiple date picker, it's angular based, open source and free ;)
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45059410
type: Comment
comment on: http://stackoverflow.com/a/28355465
has text: Thank you but I copy and paste your code but still doesn't work. I can read `temp` inside post function but not before `return temp` and `p_info` of course is still empty. I can really understand where is the problem...
type: AnswerComment
score: 0

http://stackoverflow.com/a/28301651
has comment: http://stackoverflow.com/comment/44961961
score: 2
answers question: http://stackoverflow.com/q/28301340
downvote count: 0
has comment: http://stackoverflow.com/comment/44963934
type: Answer
has comment: http://stackoverflow.com/comment/45041052
has comment: http://stackoverflow.com/comment/44971177
upvote count: 2
has comment: http://stackoverflow.com/comment/44962504
has body: I don't know how custom of a job you are trying, but a simple fix would be to make a second class with a filter, then add that class at the click event. &lt;img src='mug.png' id='mug' class='unfiltered-pic' onclick="changeColor(this)&gt; &lt;style&gt; .unfiltered-pic { width: 25% height: 25% } .filtered-pic { filter: hue-rotate(/*degree on color wheel*/deg) } &lt;/style&gt; &lt;script&gt; function changeColor(element) { element.setAttribute('class', 'filtered-pic'); } &lt;/script&gt; You can choose various filters through css-filters here. Use hue-rotate to change the hue(color). Use a color wheel to determine where you want to go. If you would like to switch to using class to change all of them at once, you can do this instead: &lt;img src='mug.png' id='mug' class='unfiltered-pic' onclick="changeColor()&gt; &lt;style&gt; .unfiltered-pic { width: 25% height: 25% } .filtered-pic { filter: filter function /*See Link*/ } &lt;/style&gt; &lt;script&gt; var pics = document.getElementByClassName('unfiltered-pic') function changeColor() { for(var i=0; i &lt; pics.length; i++) { pics[i].setAttribute('class', 'filtered-pic'); } } &lt;/script&gt; Let me know if you need any clarification or additional help.
has comment: http://stackoverflow.com/comment/45024874

http://stackoverflow.com/q/28312571
has comment: http://stackoverflow.com/comment/44975754
has body: I have a few buttons and a submit button. (Making simple) My idea is to receive the value of the clicked button using a php and display it only when submit. Here I face a problem that button click itself redirects to the page and displays the value (means it is not waiting for the submit button to press). I followed a javascript provided here. But didn’t work. Any method to achieve this? x1 y1 z1 php part is as simple as, $button = $_POST['btn']; echo $button;
type: UnansweredQuestion
tagged with: php
type: Question
linked to: http://stackoverflow.com/q/2635370
has answer: http://stackoverflow.com/a/28312598
tagged with: javascript
score: 0
has title: Prevent button to page redirect in html
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/44975987

http://stackoverflow.com/q/28307770
has body: I Have a file called authenticate.jsp : <%@page import=" java.sql.*, java.util.*,java.io.*" %> <% Connection con = null; Statement stmt = null; ResultSet fireman = null; try { Class.forName("com.mysql.jdbc.Driver").newInstance(); String connectionString = "jdbc:mysql://localhost:3306/firedept?" + "user=xxx&password=xxx"; con = DriverManager.getConnection(connectionString); stmt = con.createStatement(); fireman = stmt.executeQuery("SELECT username,password,first,last,user_type FROM fireman"); String user = request.getParameter("user"); String pass = request.getParameter("pass"); while (fireman.next()) { if (user.equals(fireman.getString("username")) && pass.equals(fireman.getString("password"))) { String first = fireman.getString("first"); String last = fireman.getString("last"); String user_type = fireman.getString("user_type"); session.setAttribute("fname", fireman.getString("first")); %> <% response.sendRedirect("home.jsp"); // remember to change to jsp break; } } response.sendRedirect("login.jsp"); // remember to change to jsp } catch (Exception ex) { out.write(ex.getMessage()); } finally { stmt.close(); con.close(); } %> And another file which is a header.jspf file and its used in other pages via <%@include file="header.jspf" %> You are logged in : When i try to get the "first" value from the sessionStorage in the header it just returns null, what is the problem here ? This is the same project and the files are in the same folder running on Apache server. Thanks :).
tagged with: http://stackoverflow.com/tag/html
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44972421
has comment: http://stackoverflow.com/comment/77571239
has answer: http://stackoverflow.com/a/28345337
has comment: http://stackoverflow.com/comment/44974743
linked to: http://stackoverflow.com/q/11936816
tagged with: jsp
tagged with: javascript
type: UnansweredQuestion
has title: Setting HTML5 Session storage <key,value> using JSP
type: Question

http://stackoverflow.com/comment/44977137
has text: if it's simple, you can use a regular xmlhttprequest instead of jQuery...
comment on: http://stackoverflow.com/q/28313550
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/28390783
answers question: http://stackoverflow.com/q/28390741
score: 1
upvote count: 1
downvote count: 0
has body: You have the idea right, but the context of this can change within the scope of another function (and it does in the context of jQuery callbacks), so if you want to ensure that this.loading() is always what you are pointing at, in JavaScript you want to assign this to a variable, so that you can call the function off of that specific version of this. Often referred to as self or that. Like so: function SectionHandler($appWrap) { var self = this; self.appWrap = $appWrap; self.loading = function() { self.appWrap.addClass('section-loading') .html("&lt;i class='fa fa-refresh fa-2x fa-spin'&gt;&lt;/i&gt;"); } self.setError = function($info) { self.appWrap.addClass('section-error').html($info); } self.load = function($section) { var $fileCheck = $.get($section).success(function(){ self.loading(); self.load($section); }).fail(function(){ self.setError('No se pudo cargar los datos especificados' + ' desde /[ ' + $section + ' ]\ ;'); }); } }
type: Answer

http://stackoverflow.com/comment/44952796
has text: Check the request result in your Browser Dev Tools' Network tab.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28300586
type: Comment

http://stackoverflow.com/comment/45092014
type: QuestionComment
has text: I added the css to the OP, it's positioned using fixed
score: 0
comment on: http://stackoverflow.com/q/28365643
type: Comment

http://stackoverflow.com/a/28434849
answers question: http://stackoverflow.com/q/28434755
has comment: http://stackoverflow.com/comment/45200180
type: Answer
score: 4
has comment: http://stackoverflow.com/comment/45199979
has comment: http://stackoverflow.com/comment/45200372
has comment: http://stackoverflow.com/comment/45200428
has comment: http://stackoverflow.com/comment/45200949
upvote count: 4
has comment: http://stackoverflow.com/comment/45200784
has body: If you wanted to narrow the selector down further for performance reasons you could use the following: $('div.form-group > div:first > div > input:first') This would become: $(function() { $('#inputMail1 ').click(function(){ $('div.form-group > div:first > div > input:first').focus(); }); });
downvote count: 0
has comment: http://stackoverflow.com/comment/45200574
has comment: http://stackoverflow.com/comment/45199825
has comment: http://stackoverflow.com/comment/45200898

http://stackoverflow.com/comment/44977887
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28312944
has text: @NicolásNistal, what are you actually trying to achieve? It *may* be that you are facing an XY problem.

http://stackoverflow.com/comment/44930429
has text: By doesn't work I mean that the freshScope variable stays current with the $scope. If I change the $scope then for some reason the variable changes as well.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28288155

http://stackoverflow.com/q/28313842
tagged with: node.js
has title: AWS Elastic Beanstalk - Express.js, update empties /uploads folder
accepted answer: http://stackoverflow.com/a/28313927
type: AnsweredQuestion
has body: When I update my my app eb push, my /uploads directory gets cleared. I'm using this folder to store images. I thought maybe it had to do with git and so I added this folder to the .gitignore, but it still clears the folder on update. Why does this happen? How do I fix this?
type: Question
tagged with: javascript
tagged with: express
score: 0
has answer: http://stackoverflow.com/a/28313927
answer count: 1
tagged with: amazon-web-services
tagged with: amazon-elastic-beanstalk
linked to: http://stackoverflow.com/q/23066972

http://stackoverflow.com/q/28395662
tagged with: tabris
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28404887
has title: Tabris.js facebook and twitter login
has body: I think tabrisjs is looking like a very good native solution for javascript developers. I am investigating this framework now. But I could not find any details for social login solution for tabris.js Is tabrisjs supportting facebookSDK for ios and android? Or do we need to implement a workaround for these kind of features?
type: Question
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/a/28340465
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28340367
score: 2
upvote count: 2
has body: Use a Regex: // yyyy-mm-dd var re = /^\d{4}-\d{1,2}-\d{1,2}$/; alert(re.test("2001-11-02"));

http://stackoverflow.com/q/28408173
favorite count: 0
has answer: http://stackoverflow.com/a/28415987
has comment: http://stackoverflow.com/comment/45150349
has comment: http://stackoverflow.com/comment/45150766
has comment: http://stackoverflow.com/comment/45151331
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45222708
has comment: http://stackoverflow.com/comment/45349619
has body: I am currently developing a website builder with javascript and html canvas. I am now puzzled on what my next step will be. I am done with the drag, drop, resize functions. But I want it to generate a code when I drop an element on a certain form(pretty much like how visual basic IDE works). How will I make the elements generate a code? index.html DnD initial This text is displayed if your browser does not support HTML5 Canvas. shapes.js function Shape(state, x, y, w, h, fill) { "use strict"; this.state = state; this.x = x || 0; this.y = y || 0; this.w = w || 1; this.h = h || 1; this.fill = fill || '#AAAAAA'; } // Draws this shape to a given context Shape.prototype.draw = function(ctx, optionalColor) { "use strict"; var i, cur, half; ctx.fillStyle = this.fill; ctx.fillRect(this.x, this.y, this.w, this.h); if (this.state.selection === this) { ctx.strokeStyle = this.state.selectionColor; ctx.lineWidth = this.state.selectionWidth; ctx.strokeRect(this.x,this.y,this.w,this.h); half = this.state.selectionBoxSize / 2; this.state.selectionHandles[0].x = this.x-half; this.state.selectionHandles[0].y = this.y-half; this.state.selectionHandles[1].x = this.x+this.w/2-half; this.state.selectionHandles[1].y = this.y-half; this.state.selectionHandles[2].x = this.x+this.w-half; this.state.selectionHandles[2].y = this.y-half; this.state.selectionHandles[3].x = this.x-half; this.state.selectionHandles[3].y = this.y+this.h/2-half; this.state.selectionHandles[4].x = this.x+this.w-half; this.state.selectionHandles[4].y = this.y+this.h/2-half; this.state.selectionHandles[6].x = this.x+this.w/2-half; this.state.selectionHandles[6].y = this.y+this.h-half; this.state.selectionHandles[5].x = this.x-half; this.state.selectionHandles[5].y = this.y+this.h-half; this.state.selectionHandles[7].x = this.x+this.w-half; this.state.selectionHandles[7].y = this.y+this.h-half; ctx.fillStyle = this.state.selectionBoxColor; for (i = 0; i < 8; i += 1) { cur = this.state.selectionHandles[i]; ctx.fillRect(c…
has comment: http://stackoverflow.com/comment/45152269
has comment: http://stackoverflow.com/comment/45175229
downvote count: 2
type: Question
has comment: http://stackoverflow.com/comment/45156062
type: AnsweredQuestion
score: -1
has comment: http://stackoverflow.com/comment/45152060
has comment: http://stackoverflow.com/comment/45220442
has title: How will I be able to make the elements generate a code for my website builder?
accepted answer: http://stackoverflow.com/a/28415987
has comment: http://stackoverflow.com/comment/45151437
has comment: http://stackoverflow.com/comment/45152117
has comment: http://stackoverflow.com/comment/45181574
tagged with: canvas
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/45160925
has comment: http://stackoverflow.com/comment/45150563
tagged with: javascript

angular-strap
tag name: angular-strap
type: Tag
tags question: http://stackoverflow.com/q/28386802

http://stackoverflow.com/comment/45055879
type: Comment
type: QuestionComment
score: 0
has text: Post the remaining code for the controller, it looks like you aren't injecting productFactory into the controller.
comment on: http://stackoverflow.com/q/28356091

http://stackoverflow.com/q/28321525
type: Question
score: 0
has comment: http://stackoverflow.com/comment/44991507
has title: Google Map: not change size in fullscreen
has body: I have a application using Google Maps API and I have developed a controller to set full screen when user click in a button using this: https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Using_full_screen_mode#Non-standard_methods But the problem is in full screen show more map than in normal screen. And the application must show excactly the same part of the map in both views. Is it possible to do this? Thanks in advance!
tagged with: google-maps
answer count: 0
tagged with: javascript
type: UnansweredQuestion
tagged with: google-maps-api-3
has comment: http://stackoverflow.com/comment/45208904
tagged with: css
has comment: http://stackoverflow.com/comment/44991061

http://stackoverflow.com/comment/45068810
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28363429
has text: @atmd..i dont know how it will work could u please give a short code description so that i could understand or use that.
score: 0

http://stackoverflow.com/q/28314942
has answer: http://stackoverflow.com/a/28314960
accepted answer: http://stackoverflow.com/a/28314960
type: Question
has comment: http://stackoverflow.com/comment/44979616
tagged with: javascript
has answer: http://stackoverflow.com/a/28315020
has body: I am using jQuery for a list and a div element click. HTML code is- Anything More thing Documents Music Videos And jQuery code is- $( document ).ready(function() { $(".list-group-item").click(function() { alert($("For list"); }); $("#image_click").click(function() { alert("for image"); }); }); When I click on a li item, only For list is alerted. But if I clicked on image, then for image and after that For list is alerted. What I want is if anyone click on li element, For list should be alerted, but if he clicks on the image, only for image should be alerted, for list should not be alerted.
score: 0
possible better answer: http://stackoverflow.com/a/28314963
tagged with: jquery
has answer: http://stackoverflow.com/a/28314963
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28315198
tagged with: css
answer count: 4
type: AnsweredQuestion
has title: How to prevent a click from triggering multiple click handler calls in jQuery

gmail
type: Tag
tag name: gmail
tags question: http://stackoverflow.com/q/28382105

http://stackoverflow.com/q/28389347
score: 5
accepted answer: http://stackoverflow.com/a/28390039
downvote count: 0
has comment: http://stackoverflow.com/comment/45116294
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/14101874
tagged with: html5-video
answer count: 3
has answer: http://stackoverflow.com/a/28389433
has comment: http://stackoverflow.com/comment/45116203
favorite count: 0
has title: Disable play/pause/full screen for HTML5 on click for YouTube
has comment: http://stackoverflow.com/comment/45116331
tagged with: youtube
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28389433
upvote count: 5
has comment: http://stackoverflow.com/comment/45116315
has comment: http://stackoverflow.com/comment/88737695
has body: Is there a way for us to disable the "play/pause/full screen on click" functionality for a HTML5 video through javascript and later put it back when we need it again?
type: Question
has answer: http://stackoverflow.com/a/49493535
has answer: http://stackoverflow.com/a/28390039

http://stackoverflow.com/q/28408551
tagged with: php
tagged with: regex
has answer: http://stackoverflow.com/a/28416756
score: 2
has comment: http://stackoverflow.com/comment/45156550
has title: Get id or class name in jquery selector use regex by PHP
type: Question
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/28413812
has comment: http://stackoverflow.com/comment/45158586
downvote count: 0
answer count: 1
has body: I'm trying to catch all the id and class name in the selector by PHP here's the regex which I'm using: /(?:\$|\$_|.(?:find|prependTo|closest|addClass|removeClass|toggleClass))+\(\'(.*?)\'\)/ it works for $('#test') $('#test .banana') it'll give me #test and #test .banana (I can use PHP to split them by space) but it couldn't use on the following selector $('.photo-preview[temp-id="' + Index + '"]') $('.photo-preview[temp-id="' + Index + '"] .hello') it'll just catch the whole content not class name only, is there any way to catch the class name? -- EDIT: has no answer yet, so I decide use this two regex until there's a really answer (?:\.|#)-?([_a-zA-Z]+[_a-zA-Z0-9-]*)(?=[^\(]*\)) explain: Find all the ids and classes (?:\$|\$_|.(?:addClass|removeClass|toggleClass))\(\'([_a-zA-Z]+[_a-zA-Z0-9-].*(?=[^\(]*\'\))) explain: Find those class names in addClass(), removeClass() .. blah blah because they have no dot or # symbols when use addClass() -- Now mix them together as one regex by "|" (OR) HERE'S THE TEMPORARY ANSWER (?:\.|#)-?([_a-zA-Z]+[_a-zA-Z0-9-]*)(?=[^\(]*\))|(?:\$|\$_|.(?:addClass|removeClass|toggleClass))\(\'([_a-zA-Z]+[_a-zA-Z0-9-].*(?=[^\(]*\'\))) BECAREFUL: this will catch . and # symbols, and even "addClass('" string, so you need to choose the right array, and split or the unnecessary symbols by PHP. HOLD ON: THIS WILL CATCH ".jpg" TOO, STILL EDITING ..
favorite count: 0
upvote count: 2
type: UnansweredQuestion

http://stackoverflow.com/comment/45104359
has text: @Mouser parseInt does the parsing and parsing is mostly done left-right and hence the behavior, I suppose.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28382802

http://stackoverflow.com/comment/45089817
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28374688
score: 1
has text: What errors do you get or what happens/doesn't happen that shouldn't/should?

http://stackoverflow.com/q/28424507
has body: I have seen so many examples how node works and how node listens to the request.But I always in a confusion in how can we do a complete application with node at server side and run in a server. Does anyone guide me how can i do a sample application with a login page (html )authenticates user at serverside(Node.js) and sends a response at client side.A complete flow to do a real time application.
tagged with: javascript
score: 0
possible better answer: http://stackoverflow.com/a/28424792
has answer: http://stackoverflow.com/a/28424792
has answer: http://stackoverflow.com/a/28491896
tagged with: node.js
has title: How to integerate client(html,js,css) with node and run in a server
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28491896
type: Question
answer count: 2

http://stackoverflow.com/a/28292461
has body: Another method is to use a version of inArray (taken from jQuery), then check each element and remove elements as necessary. I'm not sure how well this would perform compared to just doing the calculations though, it would be worth testing on jsPerf. For example: removeDuplicates([3, 4, 6, 4], [4, 7, 3, 2]); function removeDuplicates( array_1, array_2 ) { array_1.forEach(function(value, index) { var in_array = inArray( value, array_2 ); if ( in_array !== false ) { array_1.splice( index, 1 ); array_2.splice( in_array, 1 ); } }); console.log(array_1); // [4, 6] console.log(array_2); // [7, 2] } // from jQuery function inArray(needle, haystack) { var length = haystack.length; for(var i = 0; i &lt; length; i++) { if(haystack[i] == needle) return i; } return false; } jsFiddle: http://jsfiddle.net/tj6crcdt/
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28291765
downvote count: 0

http://stackoverflow.com/q/28332783
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28333028
has comment: http://stackoverflow.com/comment/45013102
answer count: 4
has comment: http://stackoverflow.com/comment/45076380
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28333129
has answer: http://stackoverflow.com/a/28332914
has title: jQuery .each() in a nested array
has comment: http://stackoverflow.com/comment/45012995
has body: My apologies for the long post but I'll give you the full story. I have a page that lists some products and below each has a little jQueryUI calendar to select a delivery date. I won't get into why, but I have to do what I'm doing with client side scripting. I'm using jQuery to loop through each product name. For each one, it checks an array of keywords and takes action if the product name is found anywhere in the array. The end action will be using a call to the associated calendar datepicker and apply a minimum and maximum date to it (that's easy). What I'm having trouble with now is that I've decided to use a nested array for the product names and the dates you're allowed to choose to have those delivered. So instead of just an array of keywords, I have: var keywordArray = [ //product name, start date, end date ["foo","2/1/2014","2/13/2014"], ["bar","2/7/2014","2/12/2014"] ]; So "foo" can only be delivered between 2/1 and 2/13. Given this, my inner loop to go through the array needs modified, but I haven't figure out how to do it. It worked great when the array was just a simple array of keywords, but now I need to test the first element of each array in the array of arrays (what a mouthful). function checkAllowedDates() { $("div[id^='delivery_product_name_']").each(function(index) { //outer loop (each product name) str = $("div#delivery_product_name_"+parseInt(index+1)).text(); //gets text inside 'delivery_product_name_1', _2, etc... $.each(keywordArray,function(index,value){ //test all array values to see if any are in the product name if (str.toLowerCase().indexOf(value) &gt;= 0) { //contains a keyword console.log(str+ " contains the special keyword " + value); } }); }); } I tried using value[0], no dice. I googled/binged how to use nested arrays, and found some great examples and I could probably do it using a normal for loop, but I really wanted to use jQuery on this. So short form: how do I use $.each() to loop through an array of arrays, and test the 0th i…
type: Question
has answer: http://stackoverflow.com/a/28332947
possible better answer: http://stackoverflow.com/a/28332914
has answer: http://stackoverflow.com/a/28333129
score: 0
tagged with: arrays

http://stackoverflow.com/comment/44925823
comment on: http://stackoverflow.com/q/28285561
score: 0
type: QuestionComment
has text: Yep I've done that and it is.
type: Comment

http://stackoverflow.com/a/28356931
score: 1
upvote count: 1
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28355992
answers question: http://stackoverflow.com/q/28355992
downvote count: 0
has body: You can use a directive to achieve this. .directive('box', function () { return { scope: { rgb: '=' }, link: function (scope, elem, attrs) { scope.$watch('rgb', function () { angular.element(elem).css('background-color', 'rgb(' + scope.rgb + ')'); }); } } } Here is an example of you to use the directive: http://jsfiddle.net/skriblez/dqfwvyso/4/

http://stackoverflow.com/comment/45081112
type: QuestionComment
has text: @ssube I have only upvote you once, so I'm making a comment to agree as well.
comment on: http://stackoverflow.com/q/28370076
score: 0
type: Comment

http://stackoverflow.com/a/28401421
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28401360
has body: Use Function.prototype.bind to bind the object to the global function you create: window.executeMyCB = programOne.execute.bind(programOne); Or try changing the call to access the method via the object. Not sure if this will work with your service or not: "http://whatever.com/the/script.js&amp;callback=programOne.execute" Since you have a jQuery tag, you could also use $.proxy instead of .bind() if you're supporting legacy browsers. window.executeMyCB = $.proxy(programOne, "execute");
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28401360
has comment: http://stackoverflow.com/comment/45203291

http://stackoverflow.com/a/58118990
answers question: http://stackoverflow.com/q/28283351
type: Answer
score: 11
upvote count: 11
has body: You can use moment().format('DD') to get the day of month. var date = +moment("12-25-1995", "MM-DD-YYYY").format('DD'); // notice the `+` which will convert // the returned string to a number. Good Luck...
downvote count: 0

http://stackoverflow.com/q/28292306
accepted answer: http://stackoverflow.com/a/28292881
has comment: http://stackoverflow.com/comment/44937960
has comment: http://stackoverflow.com/comment/44938583
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44937920
has body: I am going to maintain someone else's website, and I found a block of code like this (I have removed a lost of code to make example of code simpler) var Application = (function ($, global) { 'use strict'; global.site = global.site || {}; global.site.App = App; function App() { // code removed } App.getState = function () { return 'standard'; }; App.setState = function () { // Set current state on load site.App.currentState = site.App.getState(); }; //a lot of code was removed return { init:function(){ global.site.app = new global.site.App(); // Set browser sate on load site.App.setState(); console.log('Application: site.App.currentState', site.App.currentState); } } }(window.jQuery, window)); $(Application.init); var siteApp = angular.module('siteApp', []); siteApp.controller('AppController', function() { console.log('AppController: site.App.currentState', site.App.currentState); }); The problem is that even though I put var Application = (function ($, global) {...}(window.jQuery, window)); above angularjs module, the angularjs module run first. And I have to admit that I don't fully undenstand how the var Application ... design pattern work, so my questions are: How can I make $(Application.init); run first ?. What kind of design pattern is that (Application.init) , so I can googel it and try to understand it any helps are appreciated.
type: Question
has comment: http://stackoverflow.com/comment/44938300
tagged with: javascript
has title: javascript execution order with AngularJS
has answer: http://stackoverflow.com/a/28292881
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/28306597
tagged with: angularjs
has answer: http://stackoverflow.com/a/28306597

http://stackoverflow.com/q/28403085
tagged with: javascript
tagged with: data-structures
accepted answer: http://stackoverflow.com/a/28403134
score: 0
possible better answer: http://stackoverflow.com/a/28403121
answer count: 4
has answer: http://stackoverflow.com/a/28403134
has answer: http://stackoverflow.com/a/28403187
has answer: http://stackoverflow.com/a/28403142
type: AnsweredQuestion
has title: Create an array of number of occurrences from another array in Javascript
has answer: http://stackoverflow.com/a/28403121
tagged with: loops
type: Question
has body: I have two array which looks like var monthNames = [ "January", "January", "January", "April", "April", "December", "August", "August", "November", "November", "November", "December" ]; var monthRange = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; Now I am wondering how should I work in JS so that I would get a new array back, again with 12 elements in it (one for each month) and get a count of it. So it will be like this - [3, 0, 0, 2, 0, 0, 0, 2, 0, 0, 3, 1] Here count is in the order of the monthRange which gives count for each month in monthNames . So here January : 3, April: 2, December: 1, August: 2, November: 3, December : 1

http://stackoverflow.com/comment/44938583
has text: Welcome. I'll add this as answer. Please mark it as accepted ;-)
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28292306

http://stackoverflow.com/a/28381596
has comment: http://stackoverflow.com/comment/45140174
score: 2
accepted answer of: http://stackoverflow.com/q/28381433
has comment: http://stackoverflow.com/comment/45121942
has body: Here i got solution for your problem: Check updated Fiddle here: Fiddle Write onClick="event.stopPropagation();" in div. like: &lt;div data-toggle = "collapse" class ="panel-collapse collapse" id = "link"&gt; Because When your click on link. div will get the click event instead of link.
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28381433
upvote count: 2
type: Answer

http://stackoverflow.com/comment/45182803
score: 0
type: AnswerComment
type: Comment
has text: Thanks for your suggestion. I want to show an alert within the scriptlets only
comment on: http://stackoverflow.com/a/28425145

http://stackoverflow.com/a/28411888
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/45197193
has body: something like this? i used .blur() to trigger the dynamic adding so that if you type something in the email input and you click outside of it, then the next 3 lines of information will show up. i also added some classes to help jquery find elements faster and more reliably. i used clone() to recreate the same structure of the 3 lines every time. $(document).ready(function() { $('.email').on('blur', function() { if($(this).val().length > 0) { var count = $('.row').length; console.log(count); var clone = $('#template').clone(true).attr('id', ''); clone.find('.firstName').attr('id', 'firstName' + count).val(''); clone.find('.lastName').attr('id', 'lastName' + count).val(''); clone.find('.email').attr('id', 'inputMail' + count).val(''); $('body').append(clone); } }); }); First name Last name Email hope this helps!
has comment: http://stackoverflow.com/comment/45158014
has comment: http://stackoverflow.com/comment/45186552
answers question: http://stackoverflow.com/q/28411468
downvote count: 0
has comment: http://stackoverflow.com/comment/45157921

http://stackoverflow.com/comment/45169457
type: AnswerComment
type: Comment
has text: No, you do not need script tags. Just put your code in the file as-is.
score: 1
comment on: http://stackoverflow.com/a/28417798

http://stackoverflow.com/comment/45183859
comment on: http://stackoverflow.com/a/28425433
score: 0
type: AnswerComment
has text: Yes, that's exactly what it's doing. However, this mechanism is not called a "closure". The closure is the mechanism that causes `i` to be shared in the first place. Your scoping off the `i` is intended remove it from the closure.
type: Comment

http://stackoverflow.com/q/28337558
tagged with: css
tagged with: menu
favorite count: 0
has body: I've modified the code on several places now and I've come up with the following solution: jsfiddle.net/u2158392/2g8poyxh/ It's working pretty well, but I'm looking for a way to close the other dropdown menus which are still open when I'm clicking on another one. So how can I make sure only one dropdown menu can be activated on the page at all times? Thanks in advance!
answer count: 0
type: UnansweredQuestion
upvote count: 1
type: Question
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
has title: Multiple Jquery dropdown menus remain open after clicking on another one
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/28367099
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45080428
score: 1
upvote count: 1
has body: This is because your video file is being served as a text/html file, so the browser doesn't understand what to do with this file. (Well, Firefox understands, Chrome doesn't.) You must indicate to the browser the MIME type of the video via the Content-Type header. header('Content-Type: video/mp4'); readfile($file); exit;
answers question: http://stackoverflow.com/q/28367003

http://stackoverflow.com/q/28421578
upvote count: 1
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28423269
accepted answer: http://stackoverflow.com/a/28423269
score: 1
type: Question
tagged with: encoding
has title: Error Handling on yEnc in nodejs
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has body: I am using the yEnc module with Node. I have been trying to work out how to carry out error handling as the module has no token for an err. How would I perform error handling? The code I have is as follows: exports.emailSNSclient = SNSClient(function(err, message) { var payload = JSON.parse(yEnc.decode(message.Message)); logger.info(payload); I am unsure if try catch would work because I have been led to believe it doesn't work too well with node. What is the correct way to do this? Thanks
tagged with: error-handling

http://stackoverflow.com/comment/45124345
score: 0
type: Comment
type: AnswerComment
has text: @ProbabilityWolf, Good catch, I think my edit will fix this. In my version(working from memory now as I don't have it here), I use the `blur` event as the exit point, which focuses the next element and closes the next one. This could replace your `closeAll` function, but if it works for you, no need to fix it.
comment on: http://stackoverflow.com/a/28393770

http://stackoverflow.com/comment/45220903
type: Comment
comment on: http://stackoverflow.com/a/28439671
has text: @foreyez, Angular is a framework that facilitates the MVVM paradigm, and unlike jQuery, not meant for general augmentation of DOM with JavaScript. Specifically, [there is no event](http://stackoverflow.com/a/9779171/968155) for when style rules have applied to an element. Additionally, unless I misunderstood you, your question only asks about when elements are inserted.
score: 0
type: AnswerComment

http://stackoverflow.com/q/28340231
type: UnansweredQuestion
tagged with: store
tagged with: charts
type: Question
has body: First: Here is the fiddle that explains clearly my problem : https://fiddle.sencha.com/#fiddle/hgm To sum up, I have a very simple chart bound to a store. The store has few "empty" records and is like this: var storeA = Ext.create('Ext.data.Store', { fields: ['name', 'value', 'length'], data: [ {"name": "A-0", "value": 18.34, "length": 30}, {"name": "A-1", "value": 2.67, "length": 35}, {"name": "", "value": 0, "length": 0} // this is what I call an empty record ] }); My pie chart is very simple: var donut = Ext.create('Ext.chart.PolarChart', { title: 'Test', animation: true, width: 300, height: 300, renderTo: Ext.getBody(), store: storeA, legend: { docked: 'bottom' }, series: [{ type: 'pie', angleField: 'value', lengthField: 'length', colors: ["#9aff4f", "#35b4e3", "#ffb400"], donut: 20, label: { field: 'name', display: 'inside' }, highlight: true }] }); But I would like that the empty record does not appear in the legend like it does actually: I would like to add that I don't want to clean the store before giving it to the chart. I need to use this exact same store.
has answer: http://stackoverflow.com/a/28341621
has answer: http://stackoverflow.com/a/28341482
has title: EXTJS 5 Not display empty record in chart
tagged with: javascript
tagged with: extjs
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28341293
has comment: http://stackoverflow.com/comment/45028270

http://stackoverflow.com/q/28364500
has comment: http://stackoverflow.com/comment/45070767
has body: I am generating dynamic divs and need to refresh them every 10 seconds. Earlier I used meta refresh but didn't like the flickering of page. I have tried to insert the ajax code but got failed. below is my code without ajax,please tell me how and where to insert the ajax refresh code. $(document).ready(function (){ var n = 9; for(var i=0; i<n; i++){ var div = document.createElement('div'); div.className = "d5"; div.id=i+1; // alert(div.id); document.getElementById('container').appendChild(div); $.ajax({ async : false, url : 'myapi.php', //the script to call to get data data : "", //you can insert url argumnets here to pass to api.php for example "id=5&parent=6" dataType : 'json', //data format success : function(data){ //on recieve of reply var Name = data[2]; var subdomain = data[15]; var uniqueid = data[1]; var shop_photo = data[3]; var offer = data[19]; //get id //var vname = data[1]; //get name //$('#'+div.id).html(""+Name+""); //$('#'+div.id).html(" "+Name+" Special Offer "+offer+" "); if(offer == ""){ $('#'+div.id).html(" "+Name+" "); }else{ $('#'+div.id).html(" "+Name+" Special Offer "+offer+" "); } } }); } });
type: UnansweredQuestion
has title: how to refresh dynamically generated divs using ajax?
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/45070646
has answer: http://stackoverflow.com/a/28364595
downvote count: 1
has comment: http://stackoverflow.com/comment/45070797
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28364728
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
linked to: http://stackoverflow.com/q/5687600
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45070616
favorite count: 0

http://stackoverflow.com/q/28306942
has comment: http://stackoverflow.com/comment/44964785
tagged with: javascript
score: 0
answer count: 1
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44965029
has body: I'm new to AngularJS and I've been looking for a basic example, where when I click a link, a class is added/removed from another element elsewhere on the page? Any help would be greatly appreciated as I would really like to get my head around AngularJS basics. Thanks
has title: How do I change class on element when I click a element elsewhere using AngularJS?
has comment: http://stackoverflow.com/comment/44965135
has answer: http://stackoverflow.com/a/28307177
type: Question
has comment: http://stackoverflow.com/comment/44965062

http://stackoverflow.com/q/28377073
favorite count: 0
has answer: http://stackoverflow.com/a/28377219
downvote count: 0
type: UnansweredQuestion
score: 1
type: Question
has comment: http://stackoverflow.com/comment/45094459
has comment: http://stackoverflow.com/comment/45094478
tagged with: javascript
has body: in "mixins" chapter, there is an example code function mixin(receiver, supplier) { for (var property in supplier) { if (supplier.hasOwnProperty(property)) { receiver[property] = supplier[property] } } return receiver; } function EventTarget(){ } EventTarget.prototype = { add: function(){console.log("add");} }; function Person(name) { this.name = name; } mixin(Person.prototype, new EventTarget()); mixin(Person.prototype, { constructor: Person, sayName: function() { console.log(this.name); this.fire({ type: "namesaid", name: name }); } }); var person = new Person("Nicholas"); for my understanding, this is trying to copy properties from EventTarget.prototype into Person.prototype. So the code: mixin(Person.prototype, new EventTarget()); should be mixin(Person.prototype, EventTarget.prototype); Am I right of this piece of code?
has title: is this mixins code an error of book "The Principles of Object-Oriented JavaScript"
has comment: http://stackoverflow.com/comment/45094351
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/39726764

http://stackoverflow.com/q/28286319
score: 3
tagged with: http://stackoverflow.com/tag/json
type: Question
has comment: http://stackoverflow.com/comment/45048036
has title: Converting excel file to json in nodejs
tagged with: javascript
has body: I am trying to convert an excel file to json by using this api: convert-json node api. I am able to do it on my local machine but not on my server. Only the csv-to-json works locally and on the server. Here is my code: https://gist.github.com/debasreedash/33efd4473ba8b344a5ac The server crashes while trying to parse the excel file right after the first console.log. Here is what it looks like: https://i.sstatic.net/2bAld.jpg I thought that it was a problem with not having excel drivers on the server but after downloading and installing it did not work either. Has anyone come across this issue? If you need anymore information then let me know.
has answer: http://stackoverflow.com/a/59871044
has answer: http://stackoverflow.com/a/28297556
downvote count: 1
upvote count: 4
answer count: 4
tagged with: node.js
favorite count: 0
has answer: http://stackoverflow.com/a/32219160
linked to: http://stackoverflow.com/q/13719593
type: UnansweredQuestion
tagged with: excel
has answer: http://stackoverflow.com/a/77541129
has comment: http://stackoverflow.com/comment/44927923

http://stackoverflow.com/comment/45053989
type: Comment
has text: Hi Basarat, this is what I thought also. Please have a look at the attached link. i.imgur.com/b73jXXq.png
comment on: http://stackoverflow.com/a/28338569
score: 0
type: AnswerComment

http://stackoverflow.com/q/28416442
tagged with: bloodhound
downvote count: 0
has body: I am using Typeahead/Bloodhoud for a company search and the autocomplete section is not showing enough matches. ---------- Search ---------- I should see at least 5 results since the limit is 5. ---------- Ajax Response ---------- Typeahead JS companies = new Bloodhound({ datumTokenizer: function(d) { return Bloodhound.tokenizers.nonword(d.id); }, queryTokenizer: Bloodhound.tokenizers.nonword, remote: 'access/companies?q=%QUERY' }); companies.initialize(); $('#companySearch').typeahead({ highlight: true, source: companies.ttAdapter(), updater: selectCompany }); How can I ensure that all of my results appear as expected? I've been digging through the documentation/source code looking for options I must've overlooked and have been struggling to come up with any.
has answer: http://stackoverflow.com/a/28708855
type: Question
answer count: 2
tagged with: javascript
tagged with: twitter-typeahead
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28666990
upvote count: 3
has comment: http://stackoverflow.com/comment/45210715
has title: Unable to view all matching results with Typeahead/Bloodhound
has comment: http://stackoverflow.com/comment/45203509
accepted answer: http://stackoverflow.com/a/28708855
type: AnsweredQuestion
score: 3
possible better answer: http://stackoverflow.com/a/28666990

http://stackoverflow.com/q/28330615
favorite count: 0
has comment: http://stackoverflow.com/comment/45008964
has body: I have small HTML and javascript code that calculates resources for a game server. I'm trying to make the select options be on the same line as the text but on the opposite side of the page. For some reason it's messing up. function reCalc() { var e1 = document.getElementById("players"); var v1 = parseInt(e1.options[e1.selectedIndex].value) var e2 = document.getElementById("type"); var v2 = parseInt(e2.options[e2.selectedIndex].value) var e3 = document.getElementById("plugins"); var v3 = parseInt(e3.options[e3.selectedIndex].value) var e4 = document.getElementById("multiworld"); var v4 = parseInt(e4.options[e4.selectedIndex].value) var ram = v1 + v2 + v3 + v4 + 256 if (ram < 256) { ram = 256 } else if (ram > 256 && ram < 512) { ram = 512 } else if (ram > 512 && ram < 1024) { ram = 1024 } else if (ram > 1024 && ram < 2048) { ram = 2048 } else if (ram > 2048 && ram < 3072) { ram = 3072 } else if (ram > 3072 && ram < 4096) { ram = 4096 } else if (ram > 4096 && ram < 5120) { ram = 5120 } else if (ram > 5120 && ram < 6144) { ram = 6144 } else if (ram > 6144 && ram < 7168) { ram = 7168 } else if (ram > 7169 && ram < 8192) { ram = 8192 } if (v2 == 9999) { ram = 256 } document.getElementById("ramAmt").innerHTML = "Recommended plan: " + ram + "MB"; } .stitle { font-family: Lato; margin-top: 5px; } .left { float: left; width: 500px; } .right { float: right; width: 500px; } How many players do you expect at a peak time? Select player count 1-10 11-20 21-50 50-100 100-150 and over What type of server are you most likely to run? Select server type Vanilla 1.7.* Craftbukkit 1.7.* Spigot 1.7.* Vanilla 1.8.* Spigot 1.8.* Modpack w/Vanilla Modpack w/Craftbukkit Bungeecord How many plugins are you expected to run? (If you are using Spigot/Craftbukkit) 0 (Not using plugins) 1-5 6-10 11-20 21-50 Over 50 Will you be running multiple worlds with a plugin? Single World Yes - 1-3 extra worlds Yes - 4-5 extra worlds Yes - 5-10 extra worlds Yes - Over 10 worlds Recommended plan: 1024MB * Doe…
has title: HTML & CSS and layout
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45008622
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28330774
upvote count: 1
downvote count: 1
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45009020
score: 0
accepted answer: http://stackoverflow.com/a/28330774
answer count: 1
has comment: http://stackoverflow.com/comment/45008950

http://stackoverflow.com/a/28389100
has comment: http://stackoverflow.com/comment/45116130
upvote count: 3
score: 3
has comment: http://stackoverflow.com/comment/45116183
answers question: http://stackoverflow.com/q/28388960
has comment: http://stackoverflow.com/comment/45116168
has body: I have wrote script for you:) http://jsfiddle.net/maxim_mazurok/6s7z6zwt/ But array should be like var arr = [1, 2, 3, 4]; if you want to call function with number as a second param. var arr = [1, 2, 3, 4]; function closestTo(arr, key, direction) { var last = arr.length - 1; var first = 0; var keyIndex = arr.indexOf(key); switch (direction) { case ('next'): if (keyIndex != last) { return arr[keyIndex + 1]; } else { return arr[first]; } break; case ('prev'): if (keyIndex != first) { return arr[keyIndex - 1]; } else { return arr[last]; } } } alert(closestTo(arr, 4, 'next' )); alert(closestTo(arr, 4, 'prev' ));
downvote count: 0
type: Answer

http://stackoverflow.com/q/28434713
type: UnansweredQuestion
favorite count: 0
has comment: http://stackoverflow.com/comment/45199480
type: Question
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45199502
tagged with: web
score: -1
has comment: http://stackoverflow.com/comment/45199574
has body: I'm looking for the most streamlined way of uploading images to insert them into a text that a user is typing. So while the user is typing into a textarea I want him to be able to click an icon which will open the file browsing dialog of the browser. After choosing an image I want it to be uploaded automatically and have the url inserted in the text field. Unfortunately I don't really have an idea how to solve this. One idea is to use a hidden file input field and 'click' it using js. But how can i submit the hidden form after an image got chosen without the need of an additional submit button? EDIT: Of course I want to archive this using ajax. The server side should be easy as it just receives the data and returns the URL. What I need to know is how to trigger the file browser dialog and then trigger the ajax request when the user presses "open".
answer count: 1
has comment: http://stackoverflow.com/comment/45199454
has answer: http://stackoverflow.com/a/28435028
has title: Upload image without form using javascript?
has comment: http://stackoverflow.com/comment/45199720
downvote count: 1
upvote count: 0
tagged with: javascript

http://stackoverflow.com/q/28386100
tagged with: javascript
score: 0
answer count: 1
has body: Hey please can any one help me to solve this problem. my View is &lt;div id="sankey_multiple" style="width: 900px; height: 300px;"&gt;&lt;/div&gt; my Component.js is App.sankeyComponent = Ember.Component.extend({ needs: ['sankey'], //navigation: Ember.computed.alias('controllers.navigation'), isExpandedBookmarks: false, didInsertElement: function() { alert('insert'); } }); But didInsertElement function is not working I am not getting where exactly I need to add the google chart scripts. If I add it in init function it says container not found. So I thought we need to add after didInsertElement. But its not working. Can any one help me out in this ? thank you in advance.
has title: Google chart rendering in Ember.js
type: UnansweredQuestion
tagged with: ember.js
has answer: http://stackoverflow.com/a/28389491
type: Question
tagged with: google-visualization

http://stackoverflow.com/a/28333223
answers question: http://stackoverflow.com/q/28332937
downvote count: 0
has body: To handle carrying correctly, you could use something like: function replaceChar(str, index, character) { return str.substr(0, index) + character + str.substr(index + character.length); } function incStr(str) { var carry = false; var ret = str; for (var i = str.length; i &gt; 0; --i) { var inc = str.charCodeAt(i - 1); if (i === str.length) { ++inc; } if (carry) { ++inc; } if (inc &gt; 58) { carry = true; ret = replaceChar(ret, i - 1, "1"); } else if (inc === 58) { carry = true; ret = replaceChar(ret, i - 1, "0"); } else { carry = false; ret = replaceChar(ret, i - 1, String.fromCharCode(inc)); } }; if (carry) { return "1" + ret; } else { return ret; } } var testData = ["13", "14", "19", "20", "300", "08974871238471923501", "999999999999999999999999999"]; var results = testData.map(function(it) { return incStr(it); }); document.getElementById("results").textContent = JSON.stringify(results); &lt;pre id="results"&gt;&lt;/pre&gt; It's definitely not the prettiest implementation, as it creates a lot of strings along the way (at least one for each digit in the input), but it will run with linear speed (depending on the input length) and won't balloon in memory for large values. There is not a single actual string-to-number conversion, as we know that the ten valid digits ([0-9]) come in order, and we can simply increment the character code. If it goes beyond 9 (followed by :), then we check: If it's greater than '9'+1, we're carrying and hit the initial increment, so the digit should be one and we carry. If it's greater than '9', we're carrying, so the digit should be zero and we carry. Otherwise, we didn't wrap, so replace the digit but don't carry.
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/q/28352939
has body: Already tried with $(window) or $(document) they're not working either. $('a[href^="#"').on('click', function () { var id = $(this).attr("href"); var target = $(id).offset().top; //Animation $('body,html').animate({ scrollTop: target }, 500); return false; }); JsFiddle
has answer: http://stackoverflow.com/a/28353611
accepted answer: http://stackoverflow.com/a/28353611
tagged with: scrollto
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45050749
type: AnsweredQuestion
has title: jQuery scrollTop doesn't animate in FF or IE but working fine in chrome
score: 0
has comment: http://stackoverflow.com/comment/45049854
has comment: http://stackoverflow.com/comment/45049743
type: Question
has comment: http://stackoverflow.com/comment/45050927

http://stackoverflow.com/q/28423952
score: -1
accepted answer: http://stackoverflow.com/a/28424025
answer count: 1
downvote count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28424025
tagged with: angularjs
has title: show multiple modal pop up in angularjs
type: AnsweredQuestion
upvote count: 0
type: Question
has body: I'm using angularjs. What I want to do is to check student id in database by Angularjs, when the user clicks a button. If student id exists in database, #modal1 will be shown, otherwise #modal2 will be prompted. Is it possible to do this with angularjs? If possible how.. Html {{g.studentId}} {{g.studentName}} #Modal that will be displayed confirm delete? Yes No Data already existed Controller $scope.act = function (g) { g.studentId; }

http://stackoverflow.com/a/28627745
accepted answer of: http://stackoverflow.com/q/28372454
answers question: http://stackoverflow.com/q/28372454
type: Answer
score: 1
has body: Hahaha.... I realised my mistake. It was my fault for not reading properly, and it made me lost about 2 days of my life. Oh well. RSVP.Hashes are initialized like this: return Ember.RSVP.hash({ ... }) NOT like I was doing: return new Ember.RSVP.Hash({ ... }) Problem solved. I wish the error reporting was as bit more clearer.
upvote count: 1
type: AcceptedAnswer
downvote count: 0

jssor
tags question: http://stackoverflow.com/q/28315407
tags question: http://stackoverflow.com/q/28395469
tag name: jssor
tags question: http://stackoverflow.com/q/28415617
tags question: http://stackoverflow.com/q/28386171
type: Tag

http://stackoverflow.com/a/28293497
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/44940044
has comment: http://stackoverflow.com/comment/44940280
has body: You can provide a syntax to access these properties in the getValue function parameter. For example, to access properties.parent_id you can use 'properties.parent_id'. Then the getValue function should be written as the following: function getValue(prop) { if (typeof(prop) !== 'string') throw 'invalid input string'; props = prop.split('.'); var value = item[props[0]]; for(var i = 1, l = props.length; i &lt; l; i++) { value = value[props[i]]; } return value; } Example: getValue('properties.parent_id'); //returns 20
upvote count: 3
answers question: http://stackoverflow.com/q/28293356
has comment: http://stackoverflow.com/comment/44939720
has comment: http://stackoverflow.com/comment/44940315
type: Answer
has comment: http://stackoverflow.com/comment/44940016
has comment: http://stackoverflow.com/comment/44939777
has comment: http://stackoverflow.com/comment/44940105
has comment: http://stackoverflow.com/comment/44939746

http://stackoverflow.com/q/28375536
tagged with: sqlite
has comment: http://stackoverflow.com/comment/45101186
has comment: http://stackoverflow.com/comment/45100995
has body: Im trying to store messages for a messaging app locally on the devices. Therefore I created a database but I always get back Error 5. My code is essentially similar to the one in many tutorials and the documentation. Do I have to link a certain js file to my page? Code: document.addEventListener("deviceready", onDeviceReady, false); var db = ""; function onDeviceReady() { db = window.openDatabase("localmessages", "1.0", "Test_DB", 200000); db.transaction(populateDB, errorCB, successCB); } function populateDB(tx) { //tx.executeSql("DROP TABLE messages"); tx.executeSql("CREATE TABLE IF NOT EXISTS messages(transmitter_ename varchar(40),receiver_ename varchar(40), message varchar(600)"); } function errorCB(err) { alert("Database Error: " + err.code); } function successCB() { alert("Database successfully created"); } // To add messages to the DB function savesendmessagetodb(){ db.transaction( function (tx) { tx.executeSql("INSERT INTO messages VALUES ( 'trtest','retest','metest'"); }, errorCB); } I checked the querys And I couldn't really find any helpful information about that error. Thanks,
tagged with: cordova
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45097656
type: Question
tagged with: database
tagged with: javascript
score: 0
has title: Phonegap Local Storage Database Error 5

http://stackoverflow.com/q/28301393
has answer: http://stackoverflow.com/a/30621044
favorite count: 0
accepted answer: http://stackoverflow.com/a/30621044
upvote count: 81
answer count: 5
has answer: http://stackoverflow.com/a/46254797
has body: I installed IE11 on server 2008r2. I was trying to debug using IE11 and I am having the following error. The error I am having in the Dom Explorer tab is: Diagnostic: Exception in window.onload: Error: An error has ocurredJSPlugin.3005 Stack Trace: Error: An error has ocurredJSPlugin.3005 at getString (res://C:\Program Files\Internet Explorer\F12Resources.dll/23/pluginhost/plugin.f12.js:5021:27) at ToolWindowHelpers.loadString (res://C:\Program Files\Internet Explorer\F12Resources.dll/23/Common/CommonMerged.js:5803:13) at TabPanes..
type: AnsweredQuestion
has title: An error has ocurredJSPlugin.3005
possible better answer: http://stackoverflow.com/a/28516034
tagged with: ie11-developer-tools
has comment: http://stackoverflow.com/comment/60797589
score: 80
has comment: http://stackoverflow.com/comment/73808780
downvote count: 1
linked to: http://stackoverflow.com/q/27435753
type: Question
tagged with: browser
has answer: http://stackoverflow.com/a/44420589
tagged with: internet-explorer
tagged with: javascript
has answer: http://stackoverflow.com/a/36588160
has comment: http://stackoverflow.com/comment/70962598
has answer: http://stackoverflow.com/a/28516034
tagged with: windows

http://stackoverflow.com/a/44149470
upvote count: 0
score: -2
answers question: http://stackoverflow.com/q/28365737
downvote count: 2
type: Answer
has body: You can try this var x, y, space = "", star = "", n = 4, m = n - 1; for (x = 1; x &lt;= n; x++) { for (y = m; y &gt;= 1; y--) { space = space + (" "); } m--; for (let k = 1; k &lt;= x * 2 - 1; k++) { star = star + "*" } console.log(space + star) space = ''; star = ""; }

http://stackoverflow.com/comment/45024035
type: QuestionComment
comment on: http://stackoverflow.com/q/28337803
score: 0
has text: Thanks for the response Niraj,Actually i am not familiar with server cache can you please tell me how to remove server cache.
type: Comment

http://stackoverflow.com/q/28419424
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: python
tagged with: simulation
has comment: http://stackoverflow.com/comment/45172319
answer count: 0
has title: How can I make a webpage that will display the contents of a file that is constantly being updated?
upvote count: 1
type: Question
score: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has body: I have been messing around with python to write code for small projects that I come up with to do for fun, and the most recent one I've been working on is a simulation of a house. For instance, I create the data structures of a house that has three rooms that are connected to each other, then I have a Person object that can move through the rooms based on how they are connected. That's all that it does now, and the only way to see the simulation's progress so far is through a file that I called "output.txt" that the program prints its state to for each iteration of the simulation. The file lists the rooms in the house, how they are connected, and who is in each room currently. This is a sample output: Room: Kitchen Connections: Living Room, Dining Room Actors in Room: Bob, Sue Room: Living Room Connections: Kitchen Actors in Room: Joe Room: Dining Room Connections: Kitchen Actors in Room: I'm writing all this on a server I built not too long ago so eventually I can just let it run and see what happens, and right now I have it set up so that I can go to a link and see the contents of the file. I wanted to do this so I could just refresh the page to see the changes instead of having to open the file every time I wanted to see what changed. The problem is that sometimes I think the program is in between writes to output.txt so nothing shows up when I refresh the page. I'm wondering if there is some way that I can make the webpage just show the output of the program live, without even having to refresh. Here is how I'm writing to the output.txt file in a python program: while(True): home.tick() output = open("/var/www/html/output.txt", "w") output.write(str(home)) output.close() The home.tick() statement basically goes through all the people in the house and tells them to go through their tick methods, which at this point just makes them wander through the house. Then to display output.txt I have an html file with House Simulation which, as I said, works sometimes, but …

http://stackoverflow.com/a/28353467
downvote count: 0
has body: As Ari Lerner writes about AngularJS in ng-book, "When we mix Angular into the flow, it extends this normal browser flow to create an Angular context. The Angular context refers specifically to code that runs inside the Angular event loop, referred to as the $digest loop." This is good for updating the view with a JavaScript library. Both AngularJS and jQuery are extremely efficient, and can be used together to meet the needs listed above. In my opinion, the optimal JavaScript library for mobile is jQuery Mobile.
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28353067

http://stackoverflow.com/q/28404624
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/13909665
has body: I have a list of "tasks" and I'm using "sortable" so that a user can prioritize them, putting the most important ones on top. But of course, every time the page is refreshed they go back to their original position. I'm wondering if it's possible to save the position of the tasks? Here's my code (it's a rails project): <%= render "form" %> <% if !@project.tasks.blank? %> <% for item in @project.tasks %> <%= item.title %> <%= item.description %> <%= link_to "Edit", edit_project_task_path(@project, item) %> <% end %> <% end %>
favorite count: 0
has answer: http://stackoverflow.com/a/28405462
has answer: http://stackoverflow.com/a/28404778
has comment: http://stackoverflow.com/comment/45148550
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/45148917
downvote count: 0
score: 1
type: Question
has title: jQuery UI: How to save "sortable"?
tagged with: jquery-ui
tagged with: javascript
tagged with: jquery
answer count: 2
upvote count: 1

http://stackoverflow.com/q/28322427
favorite count: 0
has title: UIWebView - Set default date programmatically
type: Question
has body: I'm trying to display default date in input embedded in iOS UIWebview : &lt;input type="date" id="startDate" format="dd/mm/yyyy" /&gt; by using this javascript code : var myDate = new Date(); document.getElementById("startDate").value = myDate.getDate()+1.0 + "/" + (myDate.getMonth() * 1.0 + 1.0 * 1.0) + "/" + myDate.getFullYear(); The date appears only after I choose a date from the native date picker. How can I set the default date programmatically ?
tagged with: http://stackoverflow.com/tag/html
answer count: 1
upvote count: 3
accepted answer: http://stackoverflow.com/a/28322553
tagged with: ios
tagged with: javascript
type: AnsweredQuestion
score: 3
downvote count: 0
has answer: http://stackoverflow.com/a/28322553
tagged with: uiwebview

http://stackoverflow.com/q/28341508
answer count: 2
has answer: http://stackoverflow.com/a/28341561
downvote count: 0
tagged with: javascript
has body: MDN doesn't mention the complexity of Set.prototype.delete(). Usually, deletion in a set is O(1). Could anybody quote a spec guaranteeing this for any javascript set implementation?
has answer: http://stackoverflow.com/a/73548960
accepted answer: http://stackoverflow.com/a/73548960
favorite count: 0
upvote count: 2
possible better answer: http://stackoverflow.com/a/28341561
has title: Complexity of Set.prototype.delete()
score: 2
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/44994981
comment on: http://stackoverflow.com/q/28322299
has text: @Pratik you can for exemple use c# to get the address from your database. After that you itereate over the address and made a call to the api [this is te api reference](https://developers.google.com/maps/documentation/geocoding).
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45184013
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28293339
has text: okay @tangent, as you said our cookie is one cookie that will be updated when we try to access the 2nd time login message, then how we can detect 2nd window opened in gwt

http://stackoverflow.com/a/28302393
has body: You should use the OnClientClick instead of OnClick. The first one handles the client click on the client - it doesn't trigger a postback. While the second triggers a postback and the click will be handled in the server. That being said, you could try this: &lt;asp:Button ID="btnSchedule" runat="server" Text="Schedule" OnClientClick="Show();" TabIndex="1000" style="width:120px;margin-top:-5px;border: thin solid #ffffff;"/&gt; The same holds for the OnClick of btnScheduleHide button. As a side note, I don't see the reason for these button to be server side buttons. They could be html buttons. You don't have to define them as a server side controls and then the View engine of ASP.NET render the corresponding html code for them, since you quite possibly don't need to trigger a postback to the server and make some actions there and return a response from the server. The following, I am almost sure that would meet your needs: &lt;input type="button" id="btnSchedule" value="Schedule" onclick="Show();"/&gt; Furthermore, if you stick with the first approach you have to change also the way you select your button in your client side code: This will not work: document.getElementById('btnSchedule') Why? Because the rendering engine of ASP.NET will create an ID not exactly like btnSchedule. You could easily spot this, if you use the developer tools. So how you could select it correctly? document.getElementById("&lt;%= btnSchedule.ClientID%&gt;");
accepted answer of: http://stackoverflow.com/q/28302337
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44958719
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28302337

http://stackoverflow.com/comment/45135116
comment on: http://stackoverflow.com/q/28399538
has text: then any of the answers below should give your desired result :)
score: 0
type: Comment
type: QuestionComment

ajax
tags question: http://stackoverflow.com/q/28403854
tags question: http://stackoverflow.com/q/28425283
tags question: http://stackoverflow.com/q/28417769
tags question: http://stackoverflow.com/q/28387024
tags question: http://stackoverflow.com/q/28424676
tags question: http://stackoverflow.com/q/28326737
tags question: http://stackoverflow.com/q/28311223
tags question: http://stackoverflow.com/q/28321696
tags question: http://stackoverflow.com/q/28299576
tags question: http://stackoverflow.com/q/28423730
tags question: http://stackoverflow.com/q/28340619
tags question: http://stackoverflow.com/q/28307735
tags question: http://stackoverflow.com/q/28295891
tags question: http://stackoverflow.com/q/28317884
tags question: http://stackoverflow.com/q/28342146
tags question: http://stackoverflow.com/q/28345835
tags question: http://stackoverflow.com/q/28349061
tags question: http://stackoverflow.com/q/28318142
tags question: http://stackoverflow.com/q/28408102
tags question: http://stackoverflow.com/q/28366664
tags question: http://stackoverflow.com/q/28357664
tags question: http://stackoverflow.com/q/28295942
tags question: http://stackoverflow.com/q/28371835
tags question: http://stackoverflow.com/q/28313269
tags question: http://stackoverflow.com/q/28365417
tags question: http://stackoverflow.com/q/28360780
tags question: http://stackoverflow.com/q/28305271
tags question: http://stackoverflow.com/q/28350959
tags question: http://stackoverflow.com/q/28333818
tags question: http://stackoverflow.com/q/28280287
tags question: http://stackoverflow.com/q/28359376
tags question: http://stackoverflow.com/q/28362802
tags question: http://stackoverflow.com/q/28311957
tags question: http://stackoverflow.com/q/28351606
tags question: http://stackoverflow.com/q/28431236
tags question: http://stackoverflow.com/q/28390370
tags question: http://stackoverflow.com/q/28399629
tags question: http://stackoverflow.com/q/28299159
tags question: http://stackoverflow.com/q/28379619
tags question: http://stackoverflow.com/q/28367960
tags question: http://stackoverflow.com/q/28409664
tags question: http://stackoverflow.com/q/28341238
tags question: http://stackoverflow.com/q/28349160
tags question: http://stackoverflow.com/q/28397609
tags question: http://stackoverflow.com/q/28342244
type: Tag
tags question: http://stackoverflow.com/q/28377424
tags question: http://stackoverflow.com/q/28287924
tags question: http://stackoverflow.com/q/28391820
tags question: http://stackoverflow.com/q/28307015
tags question: http://stackoverflow.com/q/28294892
tags question: http://stackoverflow.com/q/28395628
tags question: http://stackoverflow.com/q/28300923
tags question: http://stackoverflow.com/q/28291183
tags question: http://stackoverflow.com/q/28382406
tags question: http://stackoverflow.com/q/28283958
tags question: http://stackoverflow.com/q/28340255
tags question: http://stackoverflow.com/q/28430768
tags question: http://stackoverflow.com/q/28315584
tags question: http://stackoverflow.com/q/28364820
tags question: http://stackoverflow.com/q/28360854
tags question: http://stackoverflow.com/q/28364500
tags question: http://stackoverflow.com/q/28293399
tags question: http://stackoverflow.com/q/28361353
tags question: http://stackoverflow.com/q/28333613
tags question: http://stackoverflow.com/q/28311047
tags question: http://stackoverflow.com/q/28360435
tags question: http://stackoverflow.com/q/28331252
tags question: http://stackoverflow.com/q/28338638
tags question: http://stackoverflow.com/q/28290422
tags question: http://stackoverflow.com/q/28357117
tags question: http://stackoverflow.com/q/28319776
tags question: http://stackoverflow.com/q/28383856
tags question: http://stackoverflow.com/q/28417246
tags question: http://stackoverflow.com/q/28410898
tags question: http://stackoverflow.com/q/28386927
tags question: http://stackoverflow.com/q/28388919
tags question: http://stackoverflow.com/q/28300586
tags question: http://stackoverflow.com/q/28403148
tags question: http://stackoverflow.com/q/28320471

http://stackoverflow.com/q/28338783
has body: content.php $(document).ready(function(){ var srt=$("#cal1Date1").val();//start date var end=$("#cal1Date2").val();//end date $.ajax({ url:"http://localhost/show.php", data: {srt:srt, end:end }, type:"POST", dataType: "json", complete:function(response){ console.log(response.responseText); }}); })} the above code is sends the data to show.php which queries the date range show.php include_once "connector.php"; $sql = "SELECT * FROM `testtable` WHERE `Request Date` BETWEEN 'start date' AND 'end date' " ; $result = mysqli_query($db,$sql); if (mysqli_num_rows($result) &gt; 0) { while($row = mysqli_fetch_assoc($result)) { echo $row["Order ID"]; } mysqli_close($db); ?&gt; and the above code filters the result by the date range we provided. it prints all the filtered 'Order Ids' now I want to know is how can I send all these order id back to content.php? so i can manipulate the data there.
tagged with: javascript
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28339296
downvote count: 0
score: 1
favorite count: 0
tagged with: ajax
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: php
accepted answer: http://stackoverflow.com/a/28339296
tagged with: mysql
has comment: http://stackoverflow.com/comment/45022911
upvote count: 1
has title: how to return data by ajax in php/mysql/jquery webpage?
answer count: 1

http://stackoverflow.com/q/28305914
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/44962930
answer count: 2
has comment: http://stackoverflow.com/comment/44962967
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28306280
favorite count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44962981
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28306024
upvote count: 0
has body: I have html code like this, .. .. If one option is selected, it displays corresponding div. Code I used is $("#select1").change(function() { if($(this).val() == 1) { $("#select2").show(); } else { $("#select2").hide(); } if($(this).val() == 2) { $("#select3").show(); } else { $("#select3").hide(); } if($(this).val() == 3) { $("#select4").show(); } else { $("#select4").hide(); } }); If one div is displayed, I again used the same script for another select which shows/hides a textarea. But that textarea is not displaying.
has title: Nested Hide, show javascript not working

http://stackoverflow.com/comment/44948415
type: QuestionComment
comment on: http://stackoverflow.com/q/28297679
score: 0
type: Comment
has text: No, I was using a `style` attribute of `opacity` and was feeding it my opacity value from the CSV. Thinking about this further, I am thinking I can let D3 handle all that? I just feed it my cart count numbers?

http://stackoverflow.com/a/28317422
upvote count: 1
has body: The output in you fiddle is exactly the same without the first ng-repeat: http://jsfiddle.net/2nrbrfxL/ Going by you description rather than you code: {{value.knobTitle}} : {{value.knobColor}} {{gemItem.name}} http://jsfiddle.net/p2fuq2du/
downvote count: 0
has comment: http://stackoverflow.com/comment/44984704
has comment: http://stackoverflow.com/comment/44984267
type: Answer
answers question: http://stackoverflow.com/q/28317279
score: 1

http://stackoverflow.com/comment/45081575
comment on: http://stackoverflow.com/a/28370385
has text: jQuery wasn't tagged.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45104319
has text: better share the detailed error message.
comment on: http://stackoverflow.com/q/28382406
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28418782
has body: I have this function and I would like to know how to make this work with jQuery. My HTML: This is the function: var videos = document.querySelectorAll(".videoThumbnail"); for(var i = 0; i < videos.length; i++) { videos[i].addEventListener('click', clickHandler, false); } function clickHandler(e) { var mainVideo = document.getElementById("mainVideo"); mainVideo.src = e.srcElement.currentSrc; }
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/28418874
has comment: http://stackoverflow.com/comment/45171047
has comment: http://stackoverflow.com/comment/45170751
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45170853
type: Question
has comment: http://stackoverflow.com/comment/45170899
score: -9
has comment: http://stackoverflow.com/comment/45173995
answer count: 2
has comment: http://stackoverflow.com/comment/45170726
has comment: http://stackoverflow.com/comment/45171192
has comment: http://stackoverflow.com/comment/45171725
has comment: http://stackoverflow.com/comment/45173277
possible better answer: http://stackoverflow.com/a/28418872
accepted answer: http://stackoverflow.com/a/28418874
has answer: http://stackoverflow.com/a/28418872
has comment: http://stackoverflow.com/comment/45171361
downvote count: 9
has title: Convert from JavaScript function to jQuery
tagged with: javascript
has comment: http://stackoverflow.com/comment/45174339

http://stackoverflow.com/q/28333405
favorite count: 0
tagged with: promise
has title: Angular: can a controller watch server properties?
tagged with: angularjs
tagged with: design-patterns
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28677122
has body: I have a controller which manages I page of data and a service which makes an HTTP request every 30 seconds to get fresh data to show on the page. I'm trying to write this in an "Angular" way that is testable and leverages the service properly. I can think of two basic approaches, and I'm guessing one (or maybe both) is wrong: The controller stores the data in a $scope variable, and does a setInterval or $timeout to call methods of the service to get new data and then update the variable. The service stores the data in it's own variables/property and periodically calls its self to get new data. And the controller somehow watches/listens to the service properties to know when to update the view. For the purposes of this question, it may be helpful to consider a concrete example. If the HTTP request fails, I want to show the error to the view/user. So assume an errorMsg variable that needs to live somewhere. Should it live in the controller? In which case, the service needs to return that value every time. Or should it live in the service, and the controller somehow watches for it. I've tried the first approach, and it seems to result in a LOT of logic in the controller, mostly in then()s which follow the service methods. My instinct is that #2 is the correct way to do it. But I'm a little unclear as to how the controller should listen/watch the service. Thanks in advance.
possible better answer: http://stackoverflow.com/a/28559737
type: Question
score: 9
linked to: http://stackoverflow.com/q/8182631
has answer: http://stackoverflow.com/a/28626111
has comment: http://stackoverflow.com/comment/45014236
linked to: http://stackoverflow.com/q/19506735
upvote count: 9
tagged with: javascript
has answer: http://stackoverflow.com/a/28595482
answer count: 6
has answer: http://stackoverflow.com/a/28559737
has answer: http://stackoverflow.com/a/28333750
accepted answer: http://stackoverflow.com/a/28333750
has answer: http://stackoverflow.com/a/28675930
downvote count: 0

http://stackoverflow.com/comment/45085267
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28372267
has text: @adeneo how would you use "this" to accomplish that?
score: 0

http://stackoverflow.com/q/28388980
possible better answer: http://stackoverflow.com/a/28389015
has answer: http://stackoverflow.com/a/28389015
type: Question
type: AnsweredQuestion
tagged with: javascript
score: 0
answer count: 2
tagged with: function
has answer: http://stackoverflow.com/a/28389034
tagged with: jquery
has comment: http://stackoverflow.com/comment/45115558
has body: First of all, I'm pretty new to jQuery but with the help of http://css-tricks.com/examples/Circulate/ I managed to figure out how to create ellipses in my code. Here's the thing though, I want to create an input field/text box for users to type in their own "speed" value (which is now set at "500") and then click a submit button to start the ellipse. $("#ball").circulate({ speed: 500, height: 500, width: 200, loop: true, zIndexValues: [1, 1, 1, 1] }); I figured out the submit button part, but I keep running in circles when it comes to finding a way for a visitor of my website to manually input the "speed". I would be much obliged if someone could point me in the right direction/could give me a starting point.
has title: How to adjust a jQuery function property value?
accepted answer: http://stackoverflow.com/a/28389034
has comment: http://stackoverflow.com/comment/45115560

http://stackoverflow.com/q/28329951
has comment: http://stackoverflow.com/comment/45007558
score: 1
type: Question
has comment: http://stackoverflow.com/comment/45008860
has body: I have a one page horizontal sliding site. each slider has a question and a timer. when user slides to next, it should reset the timer and start from beginning. here is my jquery code: $(document).ready(function(){ var mytimer; $('#main').on('click', '.slidinglink', function(e){ e.preventDefault(); var section = $(this).attr('href'); var slide = $(this).data('slide'); var left = ''; if(section != '#'){ $('.timer').show(); left = '-100%'; var $active_question = $('.answer-list.active'); //mytimer = null; clearTimeout( mytimer ); mytimer = setTimeout(function () { finish_question( $('.answer-list &gt; li.checked') ); }, 5000); do_sliding(left, section, slideback); } }); }); The timer works for the first time. but if i go to next section, the timer does not work. What seems to be the problem? I have 2 other setTimeout functions which are also called during slide. They are like this (both similar): setTimeout(function(){ item.removeClass('clone'); }, 20);
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45007655
has comment: http://stackoverflow.com/comment/45007293
has comment: http://stackoverflow.com/comment/45008960
has comment: http://stackoverflow.com/comment/45007490
favorite count: 0
answer count: 0
type: UnansweredQuestion
has title: Javascript setTimeout call multiple time
upvote count: 1
tagged with: settimeout

http://stackoverflow.com/comment/45103194
has text: @Mouser I could find something but only for one video. I need to check whether both of the videos have been loaded.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28382195

http://stackoverflow.com/a/28294309
has comment: http://stackoverflow.com/comment/44974713
answers question: http://stackoverflow.com/q/28287637
type: Answer
has body: I think you're missing a scope in the your query of the media-panel. Assuming the structure of the dom is something like this 60's 60's author 1 60's title 1 ... ... 70's 70's author 1 70's title 1 ... You need to find the #media-panel .row that is inside the currently selected playlist, so in your js, change $("#media-panel .row").each(function(){ ... }) to $("#media-panel .row", this).each(function(){ ... }) or $(this).find('#media-panel .row').each( ... ) Granted - I'm assuming the DOM structure. If I'm off on that, please post a snippet of the actual HTML. EDIT: Also, it occurred to me that if this dom is correct, then you probably have multiple media-panel elements which could cause trouble since each page should have unique id elements. You might need media-panel to be a class instead of an id to make things work.
has comment: http://stackoverflow.com/comment/44967728
score: 0

http://stackoverflow.com/comment/44944594
has text: It's firing an error on every instance. I have multiple TypeErrors(5) as a result. I'm using angular 1.3.9. maybe it's something to do with that?
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28294327
score: 0

http://stackoverflow.com/a/28317517
accepted answer of: http://stackoverflow.com/q/28301372
downvote count: 0
has body: Improving on your answer I would like to add that you can add the tweens to the timeline successively and they will automatically be added to the end of the timeline. So a better way for your animation code would be: var tl = new TimelineMax() .add(TweenMax.to('.hero-unit .scene:first-of-type', 1, {opacity: 1})) .add(TweenMax.to('.hero-unit .scene:first-of-type', 1, {opacity: 0})) .add(TweenMax.to('.hero-unit .scene:nth-of-type(2)', 1, {opacity:1})) .add(TweenMax.to('.hero-unit .scene:nth-of-type(2)', 1, {opacity:0})) .add(TweenMax.to('.hero-unit .scene:nth-of-type(3)', 1, {opacity:1})) .add(TweenMax.to('.hero-unit .scene:nth-of-type(3)', 1, {opacity:0})); This way the code is a lot more managable in case you want to add anything at any time. For more information check http://greensock.com/docs/#/HTML5/GSAP/TimelineMax/add/ If all you want to do is add a .to tween to the end of the timeline you can make this even more concise by making use of the TimelineMax.to() method. From GSAP Docs: Adds a TweenLite.to() tween to the end of the timeline (or elsewhere using the "position" parameter) - this is a convenience method that accomplishes exactly the same thing as add( TweenLite.to(...) ) but with less code. So this would make this the best possible GSAP animation code for your purposes: var tl = new TimelineMax() .to('.hero-unit .scene:first-of-type', 1, {opacity: 1}) .to('.hero-unit .scene:first-of-type', 1, {opacity: 0}) .to('.hero-unit .scene:nth-of-type(2)', 1, {opacity:1}) .to('.hero-unit .scene:nth-of-type(2)', 1, {opacity:0}) .to('.hero-unit .scene:nth-of-type(3)', 1, {opacity:1}) .to('.hero-unit .scene:nth-of-type(3)', 1, {opacity:0});
answers question: http://stackoverflow.com/q/28301372
score: 4
type: AcceptedAnswer
type: Answer
upvote count: 4

http://stackoverflow.com/a/28447503
has body: FINALYYYYYYYYYY i fixed it changing my mongoose model I had this: var materias=new Schema({ Nombre:{type:String, required:true}, Docente:{type:String, required:true}, Horario:{type:String, required:true} }); module.exports = materias; and change for this: Horario:[{Dia:String, Hora:String, Tiempo:String}] for reading: for(x=0;x&lt;materias.length;x++){ var arreglo=materias[x].Horario; // TRY TWO console.log(arreglo[0].Dia); }
answers question: http://stackoverflow.com/q/28425681
type: Answer
score: 0

http://stackoverflow.com/comment/45124296
type: QuestionComment
comment on: http://stackoverflow.com/q/28393723
has text: @MukeshAgarwal what do you mean? Thanks
type: Comment
score: 0

http://stackoverflow.com/a/28485644
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28284875
has body: Mozilla probably won't let you Looking at the Syn.js source code, the events you are after aren't simulated at all. jQuery does what the others have suggested Keep in mind that originally mouse enter/leave was proprietary to Internet Explorer, and that jQuery emulated it. Its only quite recently become ubiquitous. 1 2 Here is a jsfiddle using a modified Syn.js to achieve what you asked for. Simply changed the event names: if (last !== el &amp;&amp; el &amp;&amp; last) { var options = syn.helpers.extend({}, point); options.relatedTarget = el; syn.trigger(last, 'mouseleave', options); options.relatedTarget = last; syn.trigger(el, 'mouseenter', options); }
accepted answer of: http://stackoverflow.com/q/28284875
has comment: http://stackoverflow.com/comment/45338291
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/28327737
has comment: http://stackoverflow.com/comment/45732988
accepted answer of: http://stackoverflow.com/q/28326028
has body: When I change the hiddenHolder value from javascript that is not reflected in the backingBean You're indeed not telling JSF to process the input value. The &lt;f:ajax execute&gt; should be used for this, which defaults to @this (the current input or command component). As the &lt;f:ajax&gt; is enclosed inside a command component, only the command component itself (its action) will be processed. So, just explicitly specify the input value along with the command component: &lt;f:ajax execute="@this hiddenHolder" ... /&gt; Or, if this all is within the same form, use @form: &lt;f:ajax execute="@form" ... /&gt; See also: How to invoke a JSF managed bean on a HTML DOM event using native JavaScript? How to use jsf.ajax.request to manually send ajax request in JSF Calling JSF managed bean method with arguments in jQuery
type: AcceptedAnswer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45033387
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28326028

http://stackoverflow.com/comment/44943815
comment on: http://stackoverflow.com/q/28295474
has text: Well, unless you are going to provide some code that takes the json and converts it to displayed output in your calendar, we aren't going to be able to help any further. It is at that stage where your issue lies. Also, my questions about DST still need an answer. Thanks.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45087474
has text: Might want to add another type of identifier to the selector. With this if the `checkbox` in the `th` is selected it will also be removed. [Example](http://jsfiddle.net/b1g99qfp/)
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28373455
score: 0

http://stackoverflow.com/a/28362136
answers question: http://stackoverflow.com/q/28362024
type: Answer
has comment: http://stackoverflow.com/comment/45066742
downvote count: 2
has comment: http://stackoverflow.com/comment/45066401
score: -2
upvote count: 0
has body: var userguess = "5"; var answer = "5"; function GuessFn() { if (userguess == answer) { alert("right answer!"); } else { alert("wrong answer!"); } } Click me UPDATE: After reading through comments in OP thread I noticed his Element ID is "Guess" as well as the function name is "Guess" so this could be the reason behind "object is not a function" error. I also removed my ambiguous statement as in discussion below in comments to my answer.

http://stackoverflow.com/comment/45123567
comment on: http://stackoverflow.com/a/28393161
type: Comment
type: AnswerComment
has text: @VincentVerheyen I think not. mainly because you cant have [**nested anchor tags**](http://stackoverflow.com/questions/13052598/creating-anchor-tag-inside-anchor-tag). your case requires different anchor tags (and you can do so using **JS** as suggested in other answers)
score: 0

http://stackoverflow.com/q/28318422
type: Question
has answer: http://stackoverflow.com/a/28319354
answer count: 2
has comment: http://stackoverflow.com/comment/44985814
tagged with: javascript
has title: Recommended way to extend DOM object in AngularJS without jQuery?
score: 0
accepted answer: http://stackoverflow.com/a/28319354
possible better answer: http://stackoverflow.com/a/28318495
tagged with: angularjs
has answer: http://stackoverflow.com/a/28318495
has comment: http://stackoverflow.com/comment/44985852
has body: I'm using angularJS (without jQuery), lo-dash.js and coffeescript.. Below is my codes: div = document.getElementById('play') iframe = document.createElement('iframe'); iframe.id='iframe_played' iframe.width = '420' iframe.height = '315' iframe.src = './home.html#/video/'+ currentMarker.id iframe.frameborder = '0' iframe.allowfullscreen = 'true' iframe.webkitallowfullscreen = 'true' iframe.mozallowfullscreen = 'true' div.appendChild(iframe); which looks a little clumsy.. I know it would be super easy if I could use jQuery but unfortunately I didn't import jQuery becasue AngularJS recommend not to do this.. Does anyone have suggestions about refactoring them? (The best way may be put them all in css.. But the src should be dynamic and allowfullscreen seems not supported by CSS..) Thanks!
has comment: http://stackoverflow.com/comment/44985727
type: AnsweredQuestion
tagged with: underscore.js
tagged with: coffeescript
tagged with: dom
linked to: http://stackoverflow.com/q/867916

ruby-on-rails-4
tags question: http://stackoverflow.com/q/28346489
type: Tag
tags question: http://stackoverflow.com/q/28290867
tags question: http://stackoverflow.com/q/28412947
tags question: http://stackoverflow.com/q/28317089
tags question: http://stackoverflow.com/q/28421755
tags question: http://stackoverflow.com/q/28420857
tags question: http://stackoverflow.com/q/28362290
tag name: ruby-on-rails-4
tags question: http://stackoverflow.com/q/28288816
tags question: http://stackoverflow.com/q/28311223

http://stackoverflow.com/comment/45121037
type: Comment
has text: So that was it! I tested it on firefox and worked like a charm! Many thanks!
comment on: http://stackoverflow.com/a/28391799
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45117528
type: Comment
type: QuestionComment
has text: if i had to guess (and thats all i'm doing), i would suspect that _from_ is more of a pop/smtp thing, and that the gmail feature doesn't use it. that said, just put their email somewhere else you can control.
comment on: http://stackoverflow.com/q/28389953
score: 0

http://stackoverflow.com/comment/45062491
has text: What response do u get in ur ajax function..??
score: 0
comment on: http://stackoverflow.com/q/28359521
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28395603
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28395472
answers question: http://stackoverflow.com/q/28395472
type: Answer
has body: You need to put an extra "." in front of the url. You are now linking to /css/images/mybackground. If you put an extra "." in front of it, like ../images/myBackground (and add the extension like mentioned) It should work. (At least it does in my reproduction of your situation.)
has comment: http://stackoverflow.com/comment/45127381
has comment: http://stackoverflow.com/comment/45127444
has comment: http://stackoverflow.com/comment/45127405

http://stackoverflow.com/a/28351376
type: Answer
answers question: http://stackoverflow.com/q/28350387
has comment: http://stackoverflow.com/comment/45054913
has comment: http://stackoverflow.com/comment/45084584
score: 0
has comment: http://stackoverflow.com/comment/45287407
has body: Something like this perhaps? Button for submitting. It runs validateSubmit. It only submits if the function is true. &lt;input type="button" value="submit" onsubmit="return validateSubmit();" /&gt; Here's the validate function. It gets the value of the checkbox and the text. If they're both falsy then it sets valid to a confirm box. The confirm box allows the user to select ok or cancel and returns true or false based on that. function validate() { var valid = true; var checkbox = document.getElementById('checkboxID').value; var text = document.getElementById('textBox').value; if(!(checkbox || text)) valid = confirm("Checkbox and text are empty. \n Continue?"); return valid; } The condition could be written as (!checkbox &amp;&amp; !text), however I find it simpler to read to only use one ! if I can. The rule is called De Morgan's law if you're interested. If you're using jQuery, things become easier. var checkbox = $('#checkboxID').prop( "checked" ); var text =$('#textBox').val(); Plus you can attach even handlers like this: $(document).ready(function() { $('#btnSubmit').on('click', validate); }); Let me know if you have any questions.

http://stackoverflow.com/q/28288682
has title: On mouseover cursor changes to button form
type: AnsweredQuestion
has body: I need some help with my d3.js. Could someone help me in implementing a feature that on mouse over your cursor turns into the "click" cursor form? For example when you click hover over a button on stack overflow the cursor changes. .on("mouseover", function() { d3.select(this) .style("fill", "#3b6887"); })
type: Question
score: 0
accepted answer: http://stackoverflow.com/a/28288747
answer count: 1
tagged with: javascript
tagged with: d3.js
has comment: http://stackoverflow.com/comment/44931412
has answer: http://stackoverflow.com/a/28288747

http://stackoverflow.com/comment/45071734
type: Comment
has text: @Graham I've added a few comments about issues I see in your code [here](http://jsfiddle.net/janfoeh/dwztmquk/), and have added a suggestion for an improved version [here](http://jsfiddle.net/janfoeh/dwztmquk/1/).
type: QuestionComment
comment on: http://stackoverflow.com/q/28364257
score: 0

http://stackoverflow.com/q/28385821
has comment: http://stackoverflow.com/comment/45110108
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45109599
tagged with: php
has answer: http://stackoverflow.com/a/28388607
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28388607
has comment: http://stackoverflow.com/comment/45110464
downvote count: 0
tagged with: wordpress
has comment: http://stackoverflow.com/comment/45109827
has title: How to pass parameter from another php file using wp_localize_script
type: Question
score: 1
has body: I've a post type called "rooms" and there is a meta variable like $max_person for every room. In single-rooms.php all what I need is to pass $max_person to an external javascript file This is what I wrote in function.php - add_action("wp_enqueue_scripts", function() { if (is_single()) { if (get_post_type() == 'rooms') { $max_person = get_post_meta($post->ID,'max_person',true); $combo_parameters = array( 'max' => $max_person ); wp_enqueue_script('room_combobox', get_template_directory_uri() . '/js/room_combobox.js', array( 'jquery' ), '1.0' ,true); wp_localize_script( 'room_combobox', 'ComboParameters', $combo_parameters ); } } }); and this is my javascript file function room_combobox() { var text = ""; var i; var x = ComboParameters.max; for (i = 0; i <= x; i++) { text += " "+i+" " +" "; } document.getElementById("combo").innerHTML = ' No. adults '+text+x+' '; } jQuery(document).ready(function() { room_combobox() }); for some reasons ComboParameters.max = 0
has comment: http://stackoverflow.com/comment/45114760

http://stackoverflow.com/a/28425514
type: Answer
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45218017
score: 0
accepted answer of: http://stackoverflow.com/q/28425222
answers question: http://stackoverflow.com/q/28425222
has body: You could prevent forms from resubmit themselves after refreshing the page using the Post/Redirect/Get (PRG) Pattern. (http://en.wikipedia.org/wiki/Post/Redirect/Get). Not sure what language you are using but you can refer to this post: How to prevent form resubmission when page is refreshed via PHP

http://stackoverflow.com/q/28335593
type: AnsweredQuestion
tagged with: internet-explorer
has title: MoveTargetOutOfBoundsException Selenium IE9/FireFox
answer count: 2
tagged with: firefox
tagged with: javascript
has answer: http://stackoverflow.com/a/29095775
has body: I've encountered a problem with FireFox/IE9 driver with selenium. When I use the Actions class of selenium and use its method moveToElement, it wont move to the element and it would return a MoveTargetOutOfBoundsException. I've tried to used others solutions like using Coordinates, Point and javascriptexecutor and all of them didn't worked. By using the moveToElement, It worked on my chrome driver so i don't know why it wont work on firefox33/IE9 as they are native to selenium Here is my snippet of the code: WebElement requiredCheckbox = new WebDriverWait(driver,15).until(ExpectedConditions.presenceOfElementLocated(By.name("tc_n_cs_subscribe_1"))); // Point points = requiredCheckbox.getLocation(); // System.out.println(points.getX()); // System.out.println(points.getY()); // actions.moveByOffset(points.getX(), points.getY()).perform(); // ((JavascriptExecutor) // driver).executeScript("window.scrollBy(0, "+points.getY()+");"); // ((JavascriptExecutor) driver).executeScript( // "arguments[0].scrollIntoView();", requiredCheckbox); // Coordinates coordinate = // ((Locatable)requiredCheckbox).getCoordinates(); // coordinate.onPage(); // coordinate.inViewPort(); actions.moveToElement(requiredCheckbox).build().perform(); requiredCheckbox.click();
score: 0
tagged with: css
possible better answer: http://stackoverflow.com/a/28364702
has answer: http://stackoverflow.com/a/28364702
tagged with: selenium
accepted answer: http://stackoverflow.com/a/29095775
type: Question

http://stackoverflow.com/q/28371185
answer count: 1
has comment: http://stackoverflow.com/comment/45083209
accepted answer: http://stackoverflow.com/a/28371398
has body: Passive Q W E R I'm trying to check if Q is selected with Jquery and display 'test' in console
tagged with: javascript
tagged with: jquery
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
score: -1
linked to: http://stackoverflow.com/q/19922729
type: Question
downvote count: 2
has title: Checking selected tag via jquery
has answer: http://stackoverflow.com/a/28371398
upvote count: 1

http://stackoverflow.com/comment/68023659
type: Comment
has text: Hi you can check ecqi.
type: AnswerComment
comment on: http://stackoverflow.com/a/28437544
score: 0

http://stackoverflow.com/q/28304485
has comment: http://stackoverflow.com/comment/44960450
has comment: http://stackoverflow.com/comment/44960227
type: Question
has title: innerhtml of a select tag does not update selected option
has comment: http://stackoverflow.com/comment/44960634
has comment: http://stackoverflow.com/comment/44960874
accepted answer: http://stackoverflow.com/a/28304936
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44960608
has comment: http://stackoverflow.com/comment/44960969
has comment: http://stackoverflow.com/comment/44960426
upvote count: 2
has comment: http://stackoverflow.com/comment/44960476
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/28304936
downvote count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/44960846
has comment: http://stackoverflow.com/comment/44960680
has body: 1 2 3 4 5 6 $("body").on("change", ".cs_position_id", function(){ var cs_select = $(this); var cs_select_html = cs_select.html(); alert(cs_select_html); }); Once this runs the selected attribute of the html does not reflect the actual selected value? Can anyone explain how this works?
has comment: http://stackoverflow.com/comment/44960503
has comment: http://stackoverflow.com/comment/44960485
type: AnsweredQuestion
score: 1

http://stackoverflow.com/q/28310997
tagged with: javascript
has title: jQuery .click not working on dynamically loaded button
downvote count: 4
accepted answer: http://stackoverflow.com/a/28311029
linked to: http://stackoverflow.com/q/203198
answer count: 1
tagged with: jquery
favorite count: 0
score: -3
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has body: I'm a little stuck here. I have a dynamically loaded list, and it has a button in it. I have jQuery setup to handle the .click on it but nothing is happening. Here is some sample code. HTML: jQuery/Javascript: $(document).ready(function() $.ajax({ url: 'showcart', type: 'GET', dataType: 'JSON', success: function(products){ $.each(products, function(i, product){ var FORM = ' x '; $('#cart').append(' '+product.name+' : '+product.qty+' '); $('#cart').append(FORM); }) }, error: function(){ console.log('FAILURE LOADING PRODUCTS'); } }) $('#productForm').submit(function(event){ event.preventDefault(); $.ajax({ type: 'POST', url: 'addproduct', data: $(this).serialize(), success: function(addedProduct){ // var product = addedProduct.product; var productName = addedProduct.product.name; var productQty = addedProduct.qty; var FORM = ' x '; console.log('Name:'+productName+' '+'Qty:'+productQty); $('#cart').append(' '+productName+' : '+productQty+' '); $('#cart').append(FORM); $('#cart').empty(); $.ajax({ url: 'showcart', type: 'GET', dataType: 'JSON', success: function(products){ $.each(products, function(i, product){ var FORM = ' x '; $('#cart').append(' '+product.name+' : '+product.qty+' '); $('#cart').append(FORM); }) }, error: function(){ console.log('FAILURE LOADING PRODUCTS'); } }) }, error: function(){ console.log('Failed to add or update product') } }) }) $(".remove").click(function(){ // event.preventDefault(); // var id = $(this).siblings("input[name='id']").val(); console.log('id'); // $.ajax({ // type: 'POST', // url: 'removeproduct', // data: $(this).serialize(), // success: function(removedProduct){ // // var product = addedProduct.product; // var productName = addedProduct.product.name; // var productId = addedProduct.product.id; // var productQty = addedProduct.qty; // }, // error: function(){ // console.log('Failed to remove product') // } // }) // return false; }) })
upvote count: 1
duplicate of: http://stackoverflow.com/q/203198
type: Question
has answer: http://stackoverflow.com/a/28311029

http://stackoverflow.com/comment/44982328
comment on: http://stackoverflow.com/q/28316657
score: 1
has text: Possible duplicate of http://stackoverflow.com/questions/6511542/force-javascript-exception-error-when-reading-an-undefined-object-property
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45017917
score: 0
comment on: http://stackoverflow.com/q/28335583
type: QuestionComment
type: Comment
has text: I assume index.html is not complete? You are using ng-controller="MainController as main"?

http://stackoverflow.com/a/28339775
has body: What are you trying to achieve ? From what I understand you try to execute several processes in SERVER side, and you want, from CLIENT side, to query their status(which process is still running/finished...) If so, IMO you can execute those processes(using fork() or whatever), and let the parent process to return a list of unique token identifier for each process, to your AJAX request. Now for every 500ms, using setInterval(), query the of the tokens your received. Hope it help a bit.
downvote count: 0
score: 1
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28338638

http://stackoverflow.com/a/28433457
has body: This should help you: &lt;script&gt; var yourValue = '&lt;?php echo $_SESSION['yourSessionValue'] ?&gt;'; if(yourValue == 'hello') { console.log('hide yo kids'); } else { console.log('hide yo wife'); } &lt;/script&gt;
answers question: http://stackoverflow.com/q/28433367
type: Answer
score: 0

http://stackoverflow.com/comment/45215579
score: 0
comment on: http://stackoverflow.com/a/28435747
type: Comment
has text: Wait, do you want to edit the files externally and re-fetch them?
type: AnswerComment

http://stackoverflow.com/comment/45122215
type: QuestionComment
has text: check all fields are contained within the form element.
comment on: http://stackoverflow.com/q/28392679
score: 1
type: Comment

http://stackoverflow.com/a/28398687
accepted answer of: http://stackoverflow.com/q/28398429
score: 0
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/45133111
has body: It's because scoreScores only has one nested array @ index === 1 So when you loop and j &gt; 0 or k &gt; 0 it will fail. You just need to make sure the indexes are valid. edit: If sparse arrays are OK, the following should work: if(k == i){ if(!scoreScores[j]) { scoreScores[j] = []; } scoreScores[j][k] = $(this).val(); }
answers question: http://stackoverflow.com/q/28398429

http://stackoverflow.com/q/28304358
has answer: http://stackoverflow.com/a/28326134
tagged with: select
has title: Ember 2 select dependency
type: Question
score: 0
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28326134
tagged with: ember.js
has comment: http://stackoverflow.com/comment/44959887
has body: I'm trying to create a depency between two select boxes in ember. I found a solution for an older version of ember: http://jsbin.com/cibonulora/1/edit But with the new version and with a complete model with json+rest, i can´t seem to get it working. http://jsbin.com/jumiwogugi/4/edit?html,js,console,output When i select one item in the checkbox it should filter the elements on the second. but nothing happens. Thanks My code: App = Ember.Application.create({}); App.IndexRoute = Ember.Route.extend({ setupController : function(controller, model) { this._super(controller, model); controller.set('producttypes', this.store.find('producttype')); } }); App.ProducttypesController = Ember.Object.create({ content: null }); App.ProductsubtypesController = Ember.Object.create({ content: null }); App.ProductsubtypeController = Ember.ArrayController.extend({ active: function() { alert(""); }.property("App.selectedProductType.content").cacheable() }); //model App.Producttype = DS.Model.extend({ name: DS.attr(), }); App.Productsubtype = DS.Model.extend({ name: DS.attr(), }); var producttypes = { "producttypes":[ {"id":1,"name":"type1"}, {"id":2,"name":"type2"}, {"id":3,"name":"type3"} ] }; var productsubtypes = { "productsubtypes":[ {"id":4,"name":"type4","type_id":"1"}, {"id":5,"name":"type5","type_id":"1"}, {"id":6,"name":"type6","type_id":"3"} ] }; $.mockjax({ url: '/producttypes', dataType: 'json', type: 'get', responseText: producttypes }); $.mockjax({ url: '/productsubtypes', dataType: 'json', type: 'get', responseText: productsubtypes });
type: AnsweredQuestion

http://stackoverflow.com/q/28317540
has title: Remove last params from url
downvote count: 2
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28317665
tagged with: javascript
tagged with: jquery
score: 4
has comment: http://stackoverflow.com/comment/44984126
possible better answer: http://stackoverflow.com/a/28317621
has answer: http://stackoverflow.com/a/28317621
favorite count: 0
accepted answer: http://stackoverflow.com/a/28317665
has body: How to remove last params from the url for instance, i have url such as http://localhost/autoservice/public_html/tickets/load_service/6 i want to get this result http://localhost/autoservice/public_html/tickets how to make this with jquery or javascript i have tried many solutions by reading many post on stack but i can't get it right var url = $(location).attr('href');
upvote count: 6
type: AnsweredQuestion

maps
tags question: http://stackoverflow.com/q/28427986
tag name: maps
tags question: http://stackoverflow.com/q/28413474
tags question: http://stackoverflow.com/q/28303685
tags question: http://stackoverflow.com/q/28293582
tags question: http://stackoverflow.com/q/28320928
type: Tag

http://stackoverflow.com/a/28374183
has comment: http://stackoverflow.com/comment/45089455
has comment: http://stackoverflow.com/comment/45089258
has comment: http://stackoverflow.com/comment/45089113
has comment: http://stackoverflow.com/comment/86172314
type: Answer
has body: First, it's possible to upload with Ajax, the important thing is you need to set on you form to tell it your form has an file upload input. Then you need to accept HttpPostedFileBase as an input parameter in your controller action. Try this. Example of jquery upload code. (Taken mostly from How can I upload files asynchronously?) function uploadFile(uploadId) { var formData = new FormData($('form')[0]); $.ajax({ url: '<%= Url.Action("SaveOneDatabase")%>', type: 'Post', beforeSend: function(){}, success: function(result){ }, xhr: function() { // Custom XMLHttpRequest var myXhr = $.ajaxSettings.xhr(); if(myXhr.upload) { // Check if upload property exists // Progress code if you want } return myXhr; }, error: function(){}, data: formData, cache: false, contentType: false, processData: false }); } HTML Form needs this attribute. See this post why you need it -> What does enctype='multipart/form-data' mean? enctype="multipart/form-data" C# [HttpPost] public ActionResult SaveOneDatabase(HttpPostedFileBase file) { }
has comment: http://stackoverflow.com/comment/45090486
answers question: http://stackoverflow.com/q/28373894
upvote count: 17
accepted answer of: http://stackoverflow.com/q/28373894
has comment: http://stackoverflow.com/comment/45089319
score: 17
has comment: http://stackoverflow.com/comment/68255432
has comment: http://stackoverflow.com/comment/45089406
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28336017
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has body: Facebook resizes our uploaded images if it is upper to 2 megapixels. Such as my image is 3264x1832, facebook resize to 2048x1529 it. So which edge if it is long, the images reduces to until the edge is 2048px. The reducing is measured that the other edge is reducing to. After that the image compressing for the image size is smaller. The method is careful in large images. I will be doing the method my mvc 5 project, how to find a c#, jquery, javascrip, php plugin or api like this method?
favorite count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: php
has title: Facebook style uploaded image resizing and compressing
score: 1
type: Question
has answer: http://stackoverflow.com/a/28336939
tagged with: c#
tagged with: asp.net-mvc

http://stackoverflow.com/q/28365696
has body: I did try the following: class Child { public func() { alert("hello"); } constructor() { Parent.apply(this, arguments); } } Child["prototype"] = Object.create(Parent.prototype) Child["prototype"].constructor = Child; but the instance of the Child class doesn't have func() method. How to do inheritance from js class?
accepted answer: http://stackoverflow.com/a/28366800
tagged with: typescript
type: AnsweredQuestion
tagged with: oop
score: 1
type: Question
has answer: http://stackoverflow.com/a/28366800
has title: How to inherit from existing AMD js class in TypeScript compilng to AMD module?
answer count: 1
tagged with: javascript
tagged with: inheritance
upvote count: 1
downvote count: 0
favorite count: 0

http://stackoverflow.com/q/28400437
has title: Leaving a webpage with SoundJS causes Google Chrome to crash
upvote count: 1
tagged with: google-chrome
linked to: http://stackoverflow.com/q/28393885
type: Question
has comment: http://stackoverflow.com/comment/45136560
possible better answer: http://stackoverflow.com/a/28400481
tagged with: soundjs
tagged with: javascript
has body: I have a webpage index.php which contains a link to sound.php. On sound.php, sound is played using SoundJS. When I navigate from sound.php to index.php, Google Chrome usually (but not always) displays an error message ("Aw, Snap!"): https://support.google.com/chrome/answer/95669?hl=en I'm using Chrome 40 for Mac OS. It doesn't matter whether I use a link or the browser's back button. Here's my code: sound.php calls a JS function that's using SoundJS: &lt;script type="text/javascript"&gt; var int = [0, 7]; prepareAudio(); &lt;/script&gt; As soon as I delete this code, the browser doesn't crash anymore. prepareAudio() is in an external file: function prepareAudio() { // Try WebAudio or HTMLAudio createjs.Sound.initializeDefaultPlugins(); // Try flash otherwise if (!createjs.Sound.isReady()) { // Flash plug-in is not default createjs.FlashPlugin.swfPath = "../audio/"; // Enable flash support $.getScript("../../js/flashplugin-0.6.0.min.js"); // Prefer WebAudio over HTMLAudio. Prefer HTMLAudio over Flash. createjs.Sound.registerPlugins([createjs.WebAudioPlugin, createjs.HTMLAudioPlugin, createjs.FlashPlugin]); } // Get audio files var audioPath = "../audio/"; var manifest = []; for (var i = 0; i&lt; audioFiles.length; i++) manifest.push({id: audioFiles[i], src: audioPath + audioFiles[i] + ".ogg"}); // Play audio var queue = new createjs.LoadQueue(); createjs.Sound.alternateExtensions = ["mp3"]; queue.installPlugin(createjs.Sound); queue.addEventListener("complete", function() {playTask(int);}); queue.loadManifest(manifest); createjs.Sound.registerSounds(manifest, audioPath); } There's some more code involved. I play sounds using createjs.Sound.play(mySound); Audio playback is fine in Chrome and other browsers.
has comment: http://stackoverflow.com/comment/45531610
answer count: 3
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28400481
has comment: http://stackoverflow.com/comment/45137199
type: AnsweredQuestion
tagged with: audio
has answer: http://stackoverflow.com/a/28453051
has answer: http://stackoverflow.com/a/28614247
score: 1
accepted answer: http://stackoverflow.com/a/28453051

http://stackoverflow.com/comment/45198352
has text: I'd prefer if each block content would stay inside a div because I'd like to display them in a vertical way like this : http://jsfiddle.net/36hk5bne/2/show/
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28432818

http://stackoverflow.com/q/28365969
type: Question
possible better answer: http://stackoverflow.com/a/29377122
tagged with: javascript
has answer: http://stackoverflow.com/a/28366795
accepted answer: http://stackoverflow.com/a/28366795
score: 4
answer count: 2
has body: I create polygons of different sizes by clicking a button in my webapp. I also add some values inside the object as a nested object, like {properties:{status:'active'}}. Then I run toGeoJSON() method of the polygon and get an object with properties and geometry objects. properties object is empty. My question is how do I add my values into the object so that they are passed to the GeoJSON object on conversion?
has title: Convert a newly created polygon to GeoJSON in Leaflet
has answer: http://stackoverflow.com/a/29377122
downvote count: 0
favorite count: 0
upvote count: 4
type: AnsweredQuestion
tagged with: leaflet
tagged with: geojson

http://stackoverflow.com/comment/44977562
type: AnswerComment
has text: yes..that did work..my script file was outside and i was just dragging it from outside..i included that in vs and then dragged, so it worked.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28313662

http://stackoverflow.com/comment/127202128
comment on: http://stackoverflow.com/a/28282130
has text: Exactly, I meant reference. And it has to keep 2 blobs at the same time while writing. I don't say it is optimal, but it will not keep all 10 blobs after operation is complete.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45038962
comment on: http://stackoverflow.com/a/28347280
has text: I don't need to highlight the whole value, just a search string in it.
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/120684706
type: Comment
comment on: http://stackoverflow.com/a/48964692
has text: Dosen't work anymore.
score: 1
type: AnswerComment

http://stackoverflow.com/a/28326258
has body: var b; Object.defineProperty(window,'a',{ set : function(value){ b = value; alert(new Error().stack.split('\n')[2]); }, get : function(){ return b; }, }); a = 1;
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28325447
answers question: http://stackoverflow.com/q/28325447
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28363676
answer count: 2
linked to: http://stackoverflow.com/q/20424742
has comment: http://stackoverflow.com/comment/45074555
has comment: http://stackoverflow.com/comment/45069759
has answer: http://stackoverflow.com/a/28364180
has title: Unable to access array of entities passed through twig in javascript
accepted answer: http://stackoverflow.com/a/28406564
tagged with: symfony
type: AnsweredQuestion
tagged with: twig
has body: I am currently working on a symfony2.0 project. At the moment I am stuck at some point where I want to use some simple javascript within my twig file. From my controller I pass an array of entities called Machine to the twig file like this: ... return $this-&gt;render('PRwissHostsBundle:mini:editLocation.html.twig', array( 'form' =&gt; $form-&gt;createView(), 'id' =&gt; $id, 'machines' =&gt; $machinesInLoc, )); My form inside the twig file easily cann acces the machines array. What I now need is to access this array within javascript. Currently I m doing this like follwing: &lt;script type="text/javascript"&gt; ... var mach_array =; var machine = mach_array[0]; alert(machine.name); .... &lt;/script&gt; Somehow if I alert the mach_array it says that it is an object. Same result when I alert the machine. What is not possible is to access the machines id or name or whatevers property of it. I have searched a couple of other questions like this but unfortunatly they were not helpfull regarding an array of entities. Any help is highly appreciated.
has answer: http://stackoverflow.com/a/28406564
has comment: http://stackoverflow.com/comment/45079081
type: Question
has comment: http://stackoverflow.com/comment/45071431
possible better answer: http://stackoverflow.com/a/28364180
tagged with: javascript
score: 0

http://stackoverflow.com/a/28436174
has comment: http://stackoverflow.com/comment/140010896
score: 18
upvote count: 18
downvote count: 0
has comment: http://stackoverflow.com/comment/69657994
type: Answer
answers question: http://stackoverflow.com/q/28435865
has body: Just for completeness and not my recommended way. You could call: window.stop(); To stop loading the window. Internet Explorer doesn't support this and you have to to this: document.execCommand("Stop");

http://stackoverflow.com/q/28409130
answer count: 1
downvote count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28409258
type: AnsweredQuestion
favorite count: 0
has title: mouse right click and Save Target As in javascript
type: Question
accepted answer: http://stackoverflow.com/a/28409258
has body: There is any possiblity of automatining the Mouse "Right Click" and "Save Target As" functionality. Here in my case I have a href link, on which I have to right click the link and to select the "Save Target As" option, to inetrnally downlaod a text file. Question: Whether it can be done in javascript or in jQuery? There is any other technologies which I can use to do this process?
tagged with: java
score: 0
upvote count: 1

http://stackoverflow.com/comment/45089707
type: QuestionComment
comment on: http://stackoverflow.com/q/28374595
has text: Ramesh, I unfortunately cannot follow.
score: 0
type: Comment

http://stackoverflow.com/comment/45175301
score: 0
type: QuestionComment
has text: Your `bind` approach is correct, only it suffers from the problem mentioned in the duplicate.
type: Comment
comment on: http://stackoverflow.com/q/28421012

http://stackoverflow.com/comment/45022288
has text: Or the client browser cache?
score: 0
comment on: http://stackoverflow.com/q/28337803
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28353979
has answer: http://stackoverflow.com/a/28355218
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45055490
tagged with: scroll
has title: Div id empty when grabbing it during a scroll
has body: I'm trying to grab the id of a div during a scroll so that I can trigger a GA event to track who is scrolling to what section of the site. Here is the .js code I'm using: function scrollDetect(){ var triggerPoint= Math.round($(window).height() / 2); var sections = document.getElementsByClassName("section"); var triggeredSectionArray = []; for(var i = 0; i &lt; sections.length; i++){ triggeredSectionArray[i] = true; } $(document).scroll(function(){ for(var i = 0; i &lt; sections.length; i++){ if(($(sections[i]).offset().top-$(window).scrollTop()) &lt; triggerPoint &amp;&amp; triggeredSectionArray[i] != false){ var tempElem = sections[i]; alert(sections[i].id); triggeredSectionArray[i] = false; } }}); } scrollDetect() is called on body load, and it detects when the top of the div is past the trigger point (I'm still deciding on what I want that trigger point to be exactly) - but the id itself is coming up as an empty string. All of the divs have ids explicitly defined in the tag, and when I try setting the id it does so as well.
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45052037
has comment: http://stackoverflow.com/comment/45051982
score: 0
has comment: http://stackoverflow.com/comment/45051907

http://stackoverflow.com/q/28377393
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28377416
type: AnsweredQuestion
upvote count: 3
has body: I've a table with almost 100 rows, I'm displaying 20 as default by adding a class to the tr as visible and hiding the rest of rows by the class hidden I've added an Add More button to display 5 rows each time the button is clicked but my jQuery logic is completely wrong, Have a look at it $(".more-show").click(function (e) { e.preventDefault(); for (var i = 0; i<5; i++) { $('#ranking-table tr').each(function(i) { $(this).removeClass("hidden").addClass("visible"); }); } }); PROBLEM Instead of displaying 5 rows each time upon click and it has to be the very first 5 hidden rows, It's displaying all the rows by changing the class to visible
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28377416
has title: Changing hidden to visible state of Table > TR on click
score: 3
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/28299929
downvote count: 0
has comment: http://stackoverflow.com/comment/44981852
score: 1
has comment: http://stackoverflow.com/comment/44982361
has comment: http://stackoverflow.com/comment/44982226
type: Answer
upvote count: 1
has body: You can use the attribute starts with selector, with .not() var IDphotoFromURL = getUrlParameter('IDphoto'); $('div[id^="IDphoto"]:not(#' + IDphotoFromURL + ')').hide();
answers question: http://stackoverflow.com/q/28299904
accepted answer of: http://stackoverflow.com/q/28299904
type: AcceptedAnswer

http://stackoverflow.com/q/28336266
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28336287
accepted answer: http://stackoverflow.com/a/28336287
type: Question
has body: I have 4 textbox in a div. I want to set the background color for the 3rd textbox. But, there is no ID attribute for the all textbox. How to set the background color to the textbox without using the id?
score: 0
has title: Change bgcolor of textbox without using ID in jquery
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/28396570
type: Answer
accepted answer of: http://stackoverflow.com/q/28393576
has body: Your code does work actually, check this fiddle: http://jsfiddle.net/6pbx2yof/ Check if none of your other code interfers with it. I'd remove everything else and check if it works, then piece by piece re-add your other code. Stackoverflow doesn't let me answer without code so here is the html code I used (JS Code is unchanged) Messaggi inclusi 0 Ordine: 1 Ordine:
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28393576

http://stackoverflow.com/q/28421853
upvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28421886
downvote count: 3
type: Question
has body: I have just learned about code organization with object literals, but I haven't been able to figure out how to pass a string variable within an object literal. This is my code kind of looks like: var foo = { onReady : function() { $( '.adiv' ).click( foo.action( 'test' ) ); }, action : function( x ) { alert( x ); } jQuery( function($){ foo.onReady(); });
score: -2
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28421886
has comment: http://stackoverflow.com/comment/45176811
has comment: http://stackoverflow.com/comment/45176888
answer count: 1
tagged with: web
favorite count: 0
has title: How do I pass a string within an object literal in JS?

http://stackoverflow.com/a/28335160
has body: @deceze you're right. The var logging is inited every time you call the logger. Just make the flag a global var.
type: Answer
has comment: http://stackoverflow.com/comment/45016695
downvote count: 1
score: -1
answers question: http://stackoverflow.com/q/28335084
upvote count: 0

http://stackoverflow.com/comment/45077612
type: AnswerComment
comment on: http://stackoverflow.com/a/28368325
score: 0
type: Comment
has text: Great if that helped anyhow. Enjoy mighty UI-Router ;)

http://stackoverflow.com/q/28293339
tagged with: java
has comment: http://stackoverflow.com/comment/44941960
type: Question
tagged with: browser
has body: We are developing Java-Gwt web application and we have a login page to access the application. Recently we had facing one scenario which is described below. 1) The user opens the application in one browser window (say Chrome) and login page will show to the user. 2) The user again opens the same application in another browser window (say Chrome) and there also login page will show to the user. here, the user enters the login credentials and access the application from the first browser window, then again user enters the different login credentials in the second browser window and access the application. Here We have opened application with two different credentials in 2 browser windows even though the browser instance is same. If we do like above we are going into inconsistency state as per our implementation. What is the best way of doing in the above case? I have observed in 'Gmail' application with the above explained case, It is reloading the second window if the user logs in first window. If We consider 'Gmail' is good example how to detect second browser window from first window in GWT or JavaScript? Any suggestions would be great.
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44977395
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45089326
has comment: http://stackoverflow.com/comment/44939929
upvote count: 2
has title: How to detect whether the browser window has opened from another browser window?
type: UnansweredQuestion
tagged with: web-applications
has answer: http://stackoverflow.com/a/28436554
has comment: http://stackoverflow.com/comment/45184013
has comment: http://stackoverflow.com/comment/44944917
tagged with: gwt
score: 2

wijmo
type: Tag
tags question: http://stackoverflow.com/q/28407444
tag name: wijmo

http://stackoverflow.com/comment/45164225
type: AnswerComment
score: 0
type: Comment
has text: To me, a timer is just a timer, so if tracking the arguments make sense, then making a new object seems reasonable.
comment on: http://stackoverflow.com/a/28403550

http://stackoverflow.com/a/28335621
accepted answer of: http://stackoverflow.com/q/28334694
has comment: http://stackoverflow.com/comment/45017600
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: Try this (untested). It won't call API2 until API1 completes: // Version 1 getEmptyArticles(); function getEmptyArticles() { articleArray = []; var empytyBaseURL = "scripts/get-empty-rows.php"; $.ajax({ url: empytyBaseURL, dataType: 'json', timeout: 7000 }).done(function(json){ token = json; for( var i = 0; i &lt; token.length; i++) { articleArray.push(token[i]); } API1(articleArray); }).fail(function(){ alert("ERROR: Could Not Get Empty Articles"); }).always(function() { //setTimeout(getEmptyArticles, 200000); //articleArray.length = 0; }); } function API1(articleIDs) { var BaseURL = "OMITTED"; var IDs = returnCIDs(articleIDs, ";"); var APIKey = "OMITTED"; var APIURL = BaseURL + IDs + "?api_key=" + APIKey; $.ajax({ url: APIURL, dataType: 'json', timeout: 7000 }).done(function(json){ token = json; obj = token.result; API1Success(obj, articleIDs); }).fail(function(){ API1Error(); }); function API1Success(obj, articleIDs) { var lastScan = ""; for (var i = 0; i &lt; obj.length; i++) { if(obj[i].LabelNo) { //ADD RESULTS TO TABLE HERE } else if (obj[i].LabelNumber) { var arrayIndex = articleArray.indexOf(obj[i].LabelNumber); for (var x = 0; x &lt; obj[i].Scans.length; x++) { lastScan = obj[i].Scans[x].StatusDescription; } //POST DATA TO TABLE 1 DATABASE URL var id = obj[i].LabelNumber; lastScan = lastScan.replace(/'/g, ""); var articles = "None Specified"; var Name = "OMITTED"; postTable1Data(id, lastScan, articles, Name); //POST DATA TO TABLE 2 DATABASE URL for (var x = 0; x &lt; obj[i].Scans.length; x++) { var eventID = obj[i].LabelNumber; var eventProdType = ""; var eventBadTime = moment(obj[i].Scans[x].Date, "DD/MM/YYYY HH:mm:ss"); var eventGoodTime = eventBadTime.format("YYYY-MM-DD HH:mm:ss"); var eventLocation = obj[i].Scans[x].Name; var scan = obj[i].Scans[x].StatusDescription; scan = scan.replace(/'/g, ""); postTable2Data(eventID, eventProdType, eventGoodTime, eventLocation, scan); } //REMOVE GOOD URL FROM ARRAY eraseFoundArticle(obj[i].LabelNumber); } } API2(art…
upvote count: 1
answers question: http://stackoverflow.com/q/28334694
score: 1

http://stackoverflow.com/a/28294866
answers question: http://stackoverflow.com/q/28294768
has body: Look at this answer. You wrap the public functions in an object literal and return it. You can thus call the private functions in the object literal functions.
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28294768
score: 3

http://stackoverflow.com/q/28421075
upvote count: 1
type: Question
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45175469
has comment: http://stackoverflow.com/comment/45175443
has comment: http://stackoverflow.com/comment/45175742
has answer: http://stackoverflow.com/a/28421350
accepted answer: http://stackoverflow.com/a/28421350
has title: Update page with items added via text field in Ember
answer count: 1
has comment: http://stackoverflow.com/comment/45175550
favorite count: 0
linked to: http://stackoverflow.com/q/14033175
has comment: http://stackoverflow.com/comment/45175391
tagged with: ember.js
has body: I'm working on my first Ember app. It's a variation of a to do app. You type in a value, hit submission button and the page should update with each new item added using two-way data binding. Every new item gets added to an array of object literals. So adding new objects to the array and then looping through each item and printing it to the page is working just fine. Only problem is the page never updates with new items added via the input field. I thought creating a custom view (App.ReRenderUserList in this instance) and adding .observes like they talk about in a previous question might be the answer, but that didn't seem to work. Here's my code. Let me know if there's anything else I need to add. Thanks for your help. index.html pertinent app.js code: var itemLibrary = [ { 'name' : 'bread' }, { 'name' : 'milk' }, { 'name' : 'eggs' }, { 'name' : 'cereal' } ]; var userLibrary = []; App.AddRoute = Ember.Route.extend({ model: function() { return Ember.RSVP.hash({ presetItems: itemLibrary, userItems: userLibrary }); } }); App.AddController = Ember.ObjectController.extend({ actions: { // add the clicked item to userLibrary JSON object addToList: function(){ var value = this.get('itemName'); // gets text input value userLibrary.push({ name: value // this is just echoing and not adding my new items from the form. }); // adds it to JSON Object console.log(userLibrary); } } }); App.ReRenderUserList = Ember.View.extend({ submit: function(){ console.log('rerendered!'); } });
type: AnsweredQuestion
score: 1

http://stackoverflow.com/a/28436395
has body: Hi i've found a solution: $.when( $.getScript( "/path/to/script1.js" ), $.getScript( "/path/to/myscript2.js" ), $.getScript( "/path/to/myscript3.js" ), $.Deferred(function( deferred ){ $( deferred.resolve ); }) ).done(function(){ //place your code here, the scripts are all loaded }); now it works as it should.
answers question: http://stackoverflow.com/q/28411516
score: 0
type: Answer

http://stackoverflow.com/a/28552021
has comment: http://stackoverflow.com/comment/59686499
answers question: http://stackoverflow.com/q/28421307
type: AcceptedAnswer
downvote count: 0
score: 18
type: Answer
has body: After some research, I found a solution to this problem. The issue is caused by casper.thenOpen being an asynchronous process, and the rest of the javascript being synchronous. I applied an elegant method found in this thread (Asynchronous Process inside a javascript for loop). Following that method, here is an example that works with CasperJS: var casper = require('casper').create({ pageSettings: { webSecurityEnabled: false } }); casper.start(); casper.then(function() { var current = 1; var end = 4; for (;current &lt; end;) { (function(cntr) { casper.thenOpen('http://example.com/page-' + cntr +'.html', function() { this.echo('casper.async: '+cntr); // here we can download stuff }); })(current); current++; } }); casper.run(function() { this.echo('Done.').exit(); }); This example will output the following: casper.async: 1 casper.async: 2 casper.async: 3 Done. The loop is working! :)
accepted answer of: http://stackoverflow.com/q/28421307
upvote count: 18

http://stackoverflow.com/q/28313041
has answer: http://stackoverflow.com/a/28313118
upvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
has body: $.ajax({ type: 'GET', url: fburl, dataType: 'json', success: function (data) { var html = ''; $.each(data["data"], function () { html += ' '; html += ' '; html += ' ' + this.name + ' '; }); $("#albums").append(html); }, complete: function (){ alert('done'); }); // here What's wrong here with my ajax's complete? I got unexpected token ')' at the last line of above code.
has answer: http://stackoverflow.com/a/28313056
has title: ajax complete unexpected token '('
type: UnansweredQuestion
downvote count: 1
score: -1
type: Question
answer count: 2

http://stackoverflow.com/a/28334703
score: 0
has comment: http://stackoverflow.com/comment/45017635
type: AcceptedAnswer
has body: You could use the following: Example Here $('#moveUp').click(function() { var $checkedElement = $('#theList li :checked'); $checkedElement.closest('li').insertBefore($checkedElement.closest('li').prev()); }); $('#moveDown').click(function() { var $checkedElement = $('#theList li :checked'); $checkedElement.closest('li').insertAfter($checkedElement.closest('li').next()); }); A few notes.. You were using a jQuery method on a non-jQuery object this.prev()/this.next(). It should have been $(this).prev()/$(this).next(). $(this) in the current scope referred to the up/down elements. You don't want to change the positions of the checkbox elements based on the up/down button indexes. You need to change the positions relative to the checkbox elements, therefore you would use something like $checkedElement.closest('li').prev(). If you want this to work when moving multiple checkbox elements, you can use: Example Here $('#moveUp').click(function() { var $checkedElement = $('#theList li :checked'); $checkedElement.each(function () { $(this).closest('li').insertBefore($(this).closest('li').prev()); }); }); $('#moveDown').click(function() { var $checkedElement = $('#theList li :checked'); $($checkedElement.get().reverse()).each(function () { $(this).closest('li').insertAfter($(this).closest('li').next()); }); });
type: Answer
accepted answer of: http://stackoverflow.com/q/28334664
answers question: http://stackoverflow.com/q/28334664

http://stackoverflow.com/q/28411263
downvote count: 0
has answer: http://stackoverflow.com/a/28411294
accepted answer: http://stackoverflow.com/a/28411294
type: AnsweredQuestion
has title: Regex - Get everything after, but not including, this character
score: 1
type: Question
upvote count: 1
has body: I have an Id String which is appended to the end of the current pages URL, like so: www.website.com?id=XXXXXXXXXXXX I want to get the Id from the end of the URL, so I want to end up with just XXXXXXXXXXXX At the moment I have this: var the_url; var the_id; the_id = the_url.replace(/^[^=]+/,""); console.log(the_id); But that is giving me this: =XXXXXXXXXXXX How do I get everything after the equals sign, but not including the equals sign? The Id itself is composed of random letters and numbers each time it is generated, so using any part of that for reference isn't really an option.
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45156579
favorite count: 0
has comment: http://stackoverflow.com/comment/45156507
tagged with: regex

http://stackoverflow.com/a/44698349
type: Answer
score: 0
has body: You can use the following function in javascript which gets called after any > kind of postback, i.e. synchronous or asynchronous. function pageLoad() { if($(".wf-button").val()=="Thank You!") { // show your popup } } Hope it works....
answers question: http://stackoverflow.com/q/28360149

http://stackoverflow.com/comment/44964952
comment on: http://stackoverflow.com/q/28306419
score: 0
has text: check i have posted the sample how to do on mouse over and mouseout
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28420275
type: Answer
answers question: http://stackoverflow.com/q/28419370
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45176059
downvote count: 0
has body: there is no simple way of doing that since google Autocomplete API does not return that information, an example response is like this: { "html_attributions" : [ "Listings by \u003ca href=\"http://www.yellowpages.com.au/\"\u003eYellow Pages\u003c/a\u003e" ], "results" : [ { "formatted_address" : "529 Kent Street, Sydney NSW, Australia", "geometry" : { "location" : { "lat" : -33.8750460, "lng" : 151.2052720 } }, "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png", "id" : "827f1ac561d72ec25897df088199315f7cbbc8ed", "name" : "Tetsuya's", "rating" : 4.30, "reference" : "CnRmAAAAmmm3dlSVT3E7rIvwQ0lHBA4sayvxWEc4nZaXSSjRtfKRGoYnfr3d5AvQGk4e0u3oOErXsIJwtd3Wck1Onyw6pCzr8swW4E7dZ6wP4dV6AsXPvodwdVyqHgyGE_K8DqSp5McW_nFcci_-1jXb5Phv-RIQTzv5BjIGS0ufgTslfC6dqBoU7tw8NKUDHg28bPJlL0vGVWVgbTg", "types" : [ "restaurant", "food", "establishment" ] }, { "formatted_address" : "Upper Level, Overseas Passenger Terminal/5 Hickson Road, The Rocks NSW, Australia", "geometry" : { "location" : { "lat" : -33.8583790, "lng" : 151.2100270 } }, "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/cafe-71.png", "id" : "f181b872b9bc680c8966df3e5770ae9839115440", "name" : "Quay", "rating" : 4.10, "reference" : "CnRiAAAADmPDOkn3znv_fX78Ma6X5_t7caEGNdSWnpwMIdDNZkLpVKPnQJXP1ghlySO-ixqs28UtDmJaOlCHn18pxpj7UQjRzR4Kmye6Gijoqoox9bpkaCAJatbJGZEIIUwRbTNIE_L2jGo5BDqiosqU2F5QdBIQbXKrvfQuo6rmu8285j7bDBoUrGrN4r6XQ-PVm260PFt5kwc3EfY", "types" : [ "cafe", "bar", "restaurant", "food", "establishment" ] }, { "formatted_address" : "107 George Street, The Rocks NSW, Australia", "geometry" : { "location" : { "lat" : -33.8597750, "lng" : 151.2085920 } }, "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png", "id" : "7beacea28938ae42bcac04faf79a607bf84409e6", "name" : "Rockpool", "rating" : 4.0, "reference" : "CnRlAAAAVK4Ek78r9yHV56I-zbaTxo9YiroCbTlel-ZRj2i6yGAkLwNMm_flMhCl3j8ZHN-jJyG1TvKqBBnKQS2z4Tceu-1kZupZ1HSo5JWRBKd7qt2vKgT8VauiEBQL-zJiKVzSy5rFfilKDLSiLusmdi88ThIQqq…

http://stackoverflow.com/comment/45065888
comment on: http://stackoverflow.com/q/28361758
type: Comment
has text: http://stackoverflow.com/questions/5419134/how-to-detect-if-two-divs-touch-with-jquery
score: 0
type: QuestionComment

http://stackoverflow.com/q/28403753
has comment: http://stackoverflow.com/comment/45143548
has comment: http://stackoverflow.com/comment/45143558
has title: calling variable in multiple functions javascript angular controller
has comment: http://stackoverflow.com/comment/45142252
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45142326
has comment: http://stackoverflow.com/comment/45143613
answer count: 0
has comment: http://stackoverflow.com/comment/45146832
has body: I have the following controller file angular.module('IpadAppApp') .controller('Mortgage_LoanCtrl', function ($location, $scope, $http, $modal) { var loans, loandatarray, loandata, params, passParams; $scope.paramsData = function() { params = { land_type: (!!filter.loan_type.value? filter.loan_type.value : 'Residential'), property: (!!filter.property_value.value? filter.property_value.value : 500000), finance_margin: (!!filter.margin_finance.value? filter.margin_finance.value : 90), tenure: (!!filter.tenure.value? filter.tenure.value : 20), rate_type: (!!filter.rate_type.value? filter.rate_type.value : 'Floating and fixed interest'), flexi: (!!filter.full_non_flexi.value? filter.full_non_flexi.value : 'Full flexi and non full flexi loan'), islamic: (!!filter.conventional_islamic.value? filter.conventional_islamic.value : 'Islamic and Conventional'), sort_by: $scope.getActiveColumn('table.packages'), sort_direction: $scope.getSortDirection('table.packages'), lock_in: (!!filter.lock_period.value? filter.lock_period.value : 'Show all') }; return params; }; $scope.homeloandata = function() { $scope.paramsData(); passParams = params; passParams = JSON.stringify(passParams).replace(/:/g,'=').replace(/"/g,'').replace(/,/g,'&amp;').replace(/{/g,'').replace(/}/g,'').replace(/ /g,'+'); }; $scope.submit_info = function() { console.log(passParams); }; }); The problem is when i ask for the passParams variable in homeloandata it returns perfectly. But when i ask for the data in submit_info, it returns undefined. Does anyone know why? I want to return the data in passParams in submit_info.
type: Question
has comment: http://stackoverflow.com/comment/45143569
tagged with: javascript
score: 0

http://stackoverflow.com/comment/45157215
has text: `Access-Control-Allow-Origin: *, *` seems incorrect, if it's supposed to be a wildcard it should be a single `*`
type: Comment
score: 2
type: AnswerComment
comment on: http://stackoverflow.com/a/28388333

http://stackoverflow.com/a/28326455
upvote count: 4
score: 4
downvote count: 0
has body: After using Sanitize i change my code and used getTrustedHtml instead trustAsHtml, it runs the sanitize on controller. $scope.to_trusted = function(html_code) { return $sce.getTrustedHtml(html_code); }; And it solves my issue.
type: Answer
answers question: http://stackoverflow.com/q/28325714

http://stackoverflow.com/comment/45137493
type: QuestionComment
type: Comment
has text: @ssl Your date is obviously no number. So you'll have to write some custom parser or use something like moment.js
score: 0
comment on: http://stackoverflow.com/q/28398997

http://stackoverflow.com/comment/45077240
type: Comment
comment on: http://stackoverflow.com/a/28367772
score: 0
type: AnswerComment
has text: I get: Object {data: Array[5]}data: Array[5]0: Object1: Object2: Object3: Object4: Objectlength: 5

http://stackoverflow.com/q/28390320
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: Autosizing different sized images in a single row
has answer: http://stackoverflow.com/a/28390389
has answer: http://stackoverflow.com/a/28390547
type: Question
tagged with: javascript
has body: I have a set of images that are different heights, widths, and aspect ratios. I'd like to line them all up to fit across the screen. I also want the heights to all be the same. So I can set the width to auto and manually play with the height until no images drop down to the next line, but obviously that doesn't work across monitors with different resolutions than mine. Is there an easy way to do this without having to use any constants of the specific images?
score: 0
answer count: 2

http://stackoverflow.com/comment/51779139
has text: This dropbox issue may help, https://github.com/enyo/dropzone/issues/717
comment on: http://stackoverflow.com/q/28401944
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44970468
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28309512
has text: @blex is it missing a `}` curly brace?
score: 0

http://stackoverflow.com/comment/45105091
score: 0
comment on: http://stackoverflow.com/q/28383524
type: Comment
type: QuestionComment
has text: Is the form submitted via a submit button?

http://stackoverflow.com/comment/45133232
comment on: http://stackoverflow.com/a/28398508
score: 0
type: Comment
has text: A more extensive explanation can be found at [developer.mozilla.org](https://developer.mozilla.org/en-US/docs/Web/CSS/:hover)
type: AnswerComment

http://stackoverflow.com/q/28373430
answer count: 1
tagged with: arrays
has answer: http://stackoverflow.com/a/28373499
tagged with: javascript
has title: Expression to use on array in ng-class
type: AnsweredQuestion
downvote count: 0
score: 1
favorite count: 0
tagged with: angularjs
type: Question
accepted answer: http://stackoverflow.com/a/28373499
has body: There's an array on my controller's $scope ... $scope.myElements = [false, false, true, false, true, false]; ... and the class on a div tag should be firstClass if at least one of the elements in said array is true, otherwise secondClass. Easy to achieve with ng-class ... &lt;div ng-class="anyElementTrue() ? 'firstClass' : 'secondClass'"&gt; ...and a helper function... $scope.anyElementTrue = function () { for (var i = 0; i &lt; $scope.myElements.length; i++) { if ($scope.myElements[i]) return true; } return false; } Is there an easier way to achieve the same just with an expression? Something like this: &lt;div ng-class="angular.any(myElements) ? 'firstClass' : 'secondClass'"&gt; Except that there is no angular.any. Thoughts?
upvote count: 1

http://stackoverflow.com/comment/45085681
type: QuestionComment
type: Comment
has text: Likely. Where is the non-angular code here?
score: 0
comment on: http://stackoverflow.com/q/28372428

amazon-s3
tags question: http://stackoverflow.com/q/28295631
type: Tag
tags question: http://stackoverflow.com/q/28303592
tag name: amazon-s3
tags question: http://stackoverflow.com/q/28286675

http://stackoverflow.com/q/28317716
tagged with: audio
score: 2
downvote count: 0
tagged with: javascript
favorite count: 0
has body: Im trying to set the html5 audio control with the url of an audio resource. In order to check if player can play mp3 or ogg files, I'm using this: var audio = this.$('audio')[0], type = audio.canPlayType('audio/mpeg') ? 'mp3' : 'ogg'; My first attempt was to append the proper url extension inside the src property, App.AudioPlayerComponent = Ember.Component.extend({ src: function() { var audio = this.$('audio')[0], type = audio.canPlayType('audio/mpeg') ? 'mp3' : 'ogg'; return this.get('url') + '.' + this.get('_type'); }.property('url') }); But it doesnt work because before template has been rendered, src attribute is evaluated and we cannot access to this.$('audio')[0], also, the property is not reevaluated because url has not changed. so finally I added a _type property that is set in didInsertElement callback and the src checks for its existence. With this, src is reevaluated when we set _type and when url changes. App.AudioPlayerComponent = Ember.Component.extend({ src: function() { if(Ember.isEmpty(this.get('_type'))) return ''; return this.get('url') + '.' + this.get('_type'); }.property('url', '_type'), didInsertElement: function() { var audio = this.$('audio')[0], type = audio.canPlayType('audio/mpeg') ? 'mp3' : 'ogg'; this.set('_type', type); } }); I'd like to avoid this check if(Ember.isEmpty(this.get('_type'))) return '';, I think is kinda ugly and maybe Ember has a proper solution for this. These are the templates: &lt;script type="text/x-handlebars"&gt; {{audio-player url=url}} &lt;/script&gt; &lt;script type="text/x-handlebars" data-template-name="components/audio-player"&gt; {{input value=url placeholder='Audio url'}} &lt;audio controls {{bind-attr src='src'}} preload="auto"&gt; &lt;/audio&gt; &lt;/script&gt; Working demo: http://emberjs.jsbin.com/cufaho/1/edit?html,js,output
tagged with: http://stackoverflow.com/tag/html
tagged with: ember.js
has title: Using html5 audio from Ember
answer count: 0
upvote count: 2
type: UnansweredQuestion
type: Question

http://stackoverflow.com/q/28407641
accepted answer: http://stackoverflow.com/a/28427714
tagged with: javascript
type: Question
has comment: http://stackoverflow.com/comment/45154128
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
score: 1
has comment: http://stackoverflow.com/comment/45186856
favorite count: 0
has comment: http://stackoverflow.com/comment/45149296
upvote count: 2
has answer: http://stackoverflow.com/a/28427714
answer count: 1
has comment: http://stackoverflow.com/comment/45152289
has comment: http://stackoverflow.com/comment/45149605
has comment: http://stackoverflow.com/comment/45155548
has body: i want to store the canvas generated with the fabric.js, i have canvas as like below in my page as said in the fabric.js documentation serialization tried to save the canvas as json, but am unable to get the objects in the canvas it always returns empty as follows {"objects":[],"background":""} and my code to generate the json is follow var canvas = new fabric.Canvas('design-stage'); console.log(canvas); var json = JSON.stringify( canvas.toJSON() ); console.log(json); Code to add the images on canvas self._loadItemImage = function (url) { fabric.Image.fromURL(url, function (img) { var w = img.width; var h = img.height; var size = self._resizeImage(w, h, self._width - 100, self._height - 100); img.set({ left: self._width / 2, top: self._height / 2, originX: 'center', originY: 'center', hasBorders: false, hasControls: false, hasRotatingPoint: false, selectable: false, scaleX: 0.5, scaleY: 0.5 }); self._motorImg = img; self._canvas.add(self._motorImg); }); }; Note: Am not created objects using the functions in the fabric.js, i have loaded the svg images from a directory and added those images into the canvas by positioning the images
has comment: http://stackoverflow.com/comment/45185079
has comment: http://stackoverflow.com/comment/45150109
has title: Save canvas created with fabric.js
has comment: http://stackoverflow.com/comment/45156936
tagged with: fabricjs
downvote count: 1
has comment: http://stackoverflow.com/comment/45186844
tagged with: canvas

http://stackoverflow.com/comment/44994633
type: Comment
comment on: http://stackoverflow.com/q/28323259
type: QuestionComment
has text: I also wondered if this is maybe a default security setting, which differs from OS to OS. I did not consciously change any settings. The is created by a local script - I wanted it to be very simple. I could implement a small local web server, but that seems overkill for my intention.
score: 0

http://stackoverflow.com/q/28431969
type: Question
score: 1
has title: Cannot attach the animation to the mesh?
has comment: http://stackoverflow.com/comment/45206208
has comment: http://stackoverflow.com/comment/45216449
answer count: 1
tagged with: maya
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28457724
favorite count: 0
tagged with: three.js
has body: I'm new in three.js and I have a problem to attach the animation to the mesh. I'm trying to use JSONLoader for this purpose. I created the js file using this Maya plug-in - https://github.com/BlackTowerEntertainment/three.js/tree/maya_animation_exporter/utils/exporters/maya. I've already loaded the mesh and the textures. I found the way to show the skeleton and when the animation is playing I can see that only skeleton is moving. The mesh is static! I will appreciate any help! This is my script: if ( ! Detector.webgl ) Detector.addGetWebGLMessage(); var container, stats; var camera, scene, renderer, objects, mesh; var clock; // instantiate a loader var imageLoader = new THREE.ImageLoader(); var loader = new THREE.JSONLoader(); loader.load( 'elephant2.js', function (geometry, materials) { geometry.computeVertexNormals(); geometry.computeBoundingBox(); ensureLoop( geometry.animation ); var material1 = new THREE.MeshPhongMaterial({map:THREE.ImageUtils.loadTexture( "textures/CH_NPC_MOB_Elephant_A01_D_GRN.jpg" )}); var material2 = new THREE.MeshPhongMaterial( { map: THREE.ImageUtils.loadTexture('textures/CH_NPC_MOB_Elephant_A01_N_GRN.jpg') } ); var material3 = new THREE.MeshPhongMaterial( { map: THREE.ImageUtils.loadTexture('textures/CH_NPC_MOB_Elephant_A01_SP_GRN.jpg') } ); var materials = [material1, material2, material3]; var meshFaceMaterial = new THREE.MeshFaceMaterial( materials ); var mesh = new THREE.SkinnedMesh( geometry, meshFaceMaterial ); mesh.scale.x = mesh.scale.y = mesh.scale.z = 0.015 mesh.updateMatrix(); var animation = new THREE.Animation( mesh, geometry.animation); animation.play(); init(mesh); animate(); } ); function ensureLoop( animation ) { for ( var i = 0; i &lt; animation.hierarchy.length; i ++ ) { var bone = animation.hierarchy[ i ]; var first = bone.keys[ 0 ]; var last = bone.keys[ bone.keys.length - 1 ]; last.pos = first.pos; last.rot = first.rot; last.scl = first.scl; } } function init(mesh) { container = document.createElement( 'div' ); docu…
type: UnansweredQuestion
upvote count: 1

http://stackoverflow.com/q/28315672
type: Question
tagged with: c#
possible better answer: http://stackoverflow.com/a/28317243
tagged with: javascript
has comment: http://stackoverflow.com/comment/44981215
score: 0
answer count: 2
upvote count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/44982394
has answer: http://stackoverflow.com/a/28317243
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28833163
accepted answer: http://stackoverflow.com/a/28833163
tagged with: asp.net-mvc-4
has body: I am creating knockout data-bind properties dynamically using .cshtml in MVC. I want to bind only those properties which are available in viewModel which again I am creating dynamically from the result of restful WCF. So there may be or may be not some keys available in the viewModel for which e.g.: is created. But when I bind the viewModel, I get an error along the lines of "'cli' property not found in viewModel". However, I wanted to bind that property only if that key is there in viewModel in the first place. $(document).ready(function () { debugger; $.ajax({ cache: false, type: "GET", async: false, dataType: "json", url: requestURL, success: function (data) { debugger; if (data.GetCircuitCheckStatusResponse.Status.HasErrors == false) { networkData = data.GetCircuitCheckStatusResponse.Response.RunningStatus.networkData; diagnosticData = data.GetCircuitCheckStatusResponse.Response.RunningStatus.diagnosticData; diagnosticsInfo = {}; //To Create boxPanel Datas for (var i = 0; i < networkData.length; i++) { diagnosticsInfo[networkData[i].ItemTitle] = networkData[i].itemValue; } //To Bind the data using Knockout } }, error: function (xhr) { debugger; alert(xhr.responseText); } }); debugger; var viewModel = ko.mapping.fromJS(diagnosticsInfo); ko.applyBindings(viewModel); // Every time data is received from the server: //ko.mapping.fromJS(data, viewModel); }); @foreach (var nameValue in childContainer.NameValueImageItemsList) { var cssClass = "nameValueItem floatLeft" + " " + nameValue.DataBindName; @nameValue.DisplayName @if (nameValue.IconImageURL != null && nameValue.IconImageURL != "") { } }
type: AnsweredQuestion
has title: How to bind Knockout viewModel for only available keys?
tagged with: knockout.js
downvote count: 1

http://stackoverflow.com/q/28339595
upvote count: 3
linked to: http://stackoverflow.com/q/5631830
type: Question
tagged with: google-analytics
score: 3
has body: We use Google Tag Manager on our site, which uses Universal Analytics to track our customers. The goal is to fetch referral information for specific customer in realtime when he signs up, so we can store that source in the database. With older ga.js tracking script some information could be fetched from the cookies, like it has been described here. However, Universal Analytics does not store any meaningful information in the cookies, and we need the alternative. What is the easiest way to track the following information realtime? Referral URL for specific Analytics user Originating traffic category for that user (like 'Google / organic' and so on)
tagged with: javascript
has answer: http://stackoverflow.com/a/28340768
answer count: 1
downvote count: 0
favorite count: 0
tagged with: google-analytics-api
type: AnsweredQuestion
has title: Getting referral and campaign information from Google Universal Analytics
accepted answer: http://stackoverflow.com/a/28340768
tagged with: cookies

http://stackoverflow.com/q/28411374
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28415938
type: Question
score: 0
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28415938
tagged with: jsdoc
tagged with: annotations
has body: If I define an object like this: /** * My Cool Object * @constructor */ function MyCoolObject() { /** * Cool Method, private * @param {!string} parameter */ function localMethod(parameter) { // do stuff } // Export the method this.exportedMethod = localMethod; } I'd like to know, if at all possible, how to tell JSDOC to use the annotation for localMethod in exportedMethod, or how can I annotate exportedMethod, because if I do: // Export the method /** * Cool Method * @param {!string} parameter */ this.exportedMethod = localMethod; JSDOC assumes it's a field rather than a method, then only uses the description, ignoring the @param part.
has title: JSDoc: Annotating an exported method
tagged with: documentation-generation

http://stackoverflow.com/q/28284758
downvote count: 0
score: 1
tagged with: select
type: Question
accepted answer: http://stackoverflow.com/a/28285215
has comment: http://stackoverflow.com/comment/44924309
answer count: 2
has title: Angular blank option selected
tagged with: javascript
has body: I'm banging my head against the wall on this one. I have an array of objects that will be used to populate a select drop down: CardCount = [{"ClientId": "0010", "Description": "0010 (206 Members)"}, {"ClientId": "0051", "Description": "0051 (1 Member)"}, ........] When I attempt to use ng-options, the value of the option is set to the index, not to the ClientId as desired. To get the value in each option to be the ClientId, I have to use a ng-repeat in the options. Here is my html: {{item.Description}} Initially, all is well, the select and options are generated correctly, and the first option is correct. Now, when a certain button is clicked somewhere else on the page, it becomes necessary to recreate this select and options with a smaller array of similar objects. However, doing so creates a blank option with a value of "? string:0010 ?". This is the option that is selected. Again, I cannot use ng-options to correct this problem because doing so doesn't set the value attribute in the option tags correctly. So, I added this to the option tag: {{item.Description}} Now, that does mark the correct option as selected. However, the drop down still shows the blank option. Here's the rendered html: 0010 (206 Members) As you can see, it sets the correct option to selected. However, it sets it to selected="selected", and not just selected. When I inspect element and change selected="selected" to selected (remove the equals and everything after it), the drop down then correctly displays the correctly selected option. Again, initially the select and options work great. The problem seems to happen only after the array that the select is created with is changed. How can I get this select and options working correctly after I change the array, and not show that first blank option? Thanks!
has comment: http://stackoverflow.com/comment/44924023
has answer: http://stackoverflow.com/a/28285215
has comment: http://stackoverflow.com/comment/44923495
has comment: http://stackoverflow.com/comment/44924590
upvote count: 1
has comment: http://stackoverflow.com/comment/44923782
tagged with: angularjs-ng-repeat
favorite count: 0
tagged with: html-select
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/28284968
has comment: http://stackoverflow.com/comment/63348221
has answer: http://stackoverflow.com/a/28284968
type: AnsweredQuestion

http://stackoverflow.com/q/28418112
has comment: http://stackoverflow.com/comment/45186147
has comment: http://stackoverflow.com/comment/45169581
tagged with: promise
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28427250
has answer: http://stackoverflow.com/a/28418177
accepted answer: http://stackoverflow.com/a/28418177
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45202581
tagged with: javascript
has body: var newUser; newUser = { name: req.body.name, email: req.body.email, username: req.body.username, password: req.body.password }; global.db.User.create(newUser).then(function(dbUser) { var newEntity; newEntity = { name: newUser.name + " Default Entity" }; return global.db.Entity.create(newEntity); }).then(function(dbEntity) { console.log(dbEntity); return res.json(dbUser.display()); })["catch"](function(err) { console.log(err); return next(err); }); global.db is a Sequelize object that has a User model and Entity model. I want to first create a user, then create an entity for that user. Is this the proper way to chain things together to have promises be useful?
score: 0
possible better answer: http://stackoverflow.com/a/28427250
tagged with: sequelize.js
has title: Is this the proper way to use promises with Sequelize.js?

http://stackoverflow.com/comment/44930829
comment on: http://stackoverflow.com/a/28288349
type: AnswerComment
score: 0
type: Comment
has text: Isn't that, what you wanted?

http://stackoverflow.com/a/28417607
upvote count: 0
score: -1
answers question: http://stackoverflow.com/q/28417497
downvote count: 1
type: Answer
has body: Try to use setInterval() instead. Here the information provided in w3schools. "The setInterval() method will wait a specified number of milliseconds, and then execute a specified function, and it will continue to execute the function, once at every given time-interval."

http://stackoverflow.com/q/28331519
has comment: http://stackoverflow.com/comment/45011839
has answer: http://stackoverflow.com/a/28331933
has comment: http://stackoverflow.com/comment/45012015
has comment: http://stackoverflow.com/comment/45010899
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/130319973
upvote count: 10
type: Question
tagged with: asp-classic
has comment: http://stackoverflow.com/comment/45012140
has title: What version of JavaScript does ASP Classic use?
accepted answer: http://stackoverflow.com/a/28331933
has comment: http://stackoverflow.com/comment/45010507
tagged with: javascript
has comment: http://stackoverflow.com/comment/45010207
answer count: 1
downvote count: 0
has body: The hacks I've seen for identifying a JavaScript version are all tailored to the browser, not an ASP Classic server running JavaScript. (And no, I'm not running ASP Classic/JavaScript by choice.)
score: 10
favorite count: 0

http://stackoverflow.com/comment/44942628
score: 1
type: Comment
comment on: http://stackoverflow.com/a/28294569
has text: @Vishnu: `$current.is($items.first())` says "is the first selected". `$current.is($items.last())` says "is the last selected". Save those values instead to a var if you want to use them more the once :)
type: AnswerComment

function
tags question: http://stackoverflow.com/q/28318113
tags question: http://stackoverflow.com/q/28400995
tags question: http://stackoverflow.com/q/28417716
tags question: http://stackoverflow.com/q/28308075
tag name: function
tags question: http://stackoverflow.com/q/28417576
tags question: http://stackoverflow.com/q/28311658
tags question: http://stackoverflow.com/q/28433316
tags question: http://stackoverflow.com/q/28288183
tags question: http://stackoverflow.com/q/28421735
tags question: http://stackoverflow.com/q/28381066
tags question: http://stackoverflow.com/q/28386051
tags question: http://stackoverflow.com/q/28316629
tags question: http://stackoverflow.com/q/28326243
tags question: http://stackoverflow.com/q/28417786
tags question: http://stackoverflow.com/q/28395467
tags question: http://stackoverflow.com/q/28398772
tags question: http://stackoverflow.com/q/28332792
tags question: http://stackoverflow.com/q/28436807
tags question: http://stackoverflow.com/q/28399381
tags question: http://stackoverflow.com/q/28304673
tags question: http://stackoverflow.com/q/28425884
tags question: http://stackoverflow.com/q/28390844
tags question: http://stackoverflow.com/q/28396981
tags question: http://stackoverflow.com/q/28349445
tags question: http://stackoverflow.com/q/28333451
tags question: http://stackoverflow.com/q/28420050
tags question: http://stackoverflow.com/q/28422205
tags question: http://stackoverflow.com/q/28397414
tags question: http://stackoverflow.com/q/28401207
tags question: http://stackoverflow.com/q/28355577
tags question: http://stackoverflow.com/q/28405879
tags question: http://stackoverflow.com/q/28378353
type: Tag
tags question: http://stackoverflow.com/q/28384829
tags question: http://stackoverflow.com/q/28357631
tags question: http://stackoverflow.com/q/28402904
tags question: http://stackoverflow.com/q/28414199
tags question: http://stackoverflow.com/q/28377096
tags question: http://stackoverflow.com/q/28394291
tags question: http://stackoverflow.com/q/28390231
tags question: http://stackoverflow.com/q/28290946
tags question: http://stackoverflow.com/q/28341699
tags question: http://stackoverflow.com/q/28388980
tags question: http://stackoverflow.com/q/28297004
tags question: http://stackoverflow.com/q/28387770
tags question: http://stackoverflow.com/q/28363110
tags question: http://stackoverflow.com/q/28371814
tags question: http://stackoverflow.com/q/28339286
tags question: http://stackoverflow.com/q/28342974
tags question: http://stackoverflow.com/q/28414398
tags question: http://stackoverflow.com/q/28399317
tags question: http://stackoverflow.com/q/28334029
tags question: http://stackoverflow.com/q/28326998
tags question: http://stackoverflow.com/q/28285962
tags question: http://stackoverflow.com/q/28409193

http://stackoverflow.com/comment/44999899
type: Comment
type: QuestionComment
has text: [mdn](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty) is generally very insightful and talks to use cases.
score: 2
comment on: http://stackoverflow.com/q/28326034

http://stackoverflow.com/comment/44962930
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28305914
type: Comment
has text: `#select4` doesn't have a value so it can't see a value of `1`...

http://stackoverflow.com/comment/45027258
score: 0
type: AnswerComment
type: Comment
has text: Glad to help. Can you accept the answer so that the question closes? Thanks :)
comment on: http://stackoverflow.com/a/28327584

http://stackoverflow.com/a/28363718
downvote count: 0
has body: Assume that you have the text html in your url, and whenever this is the case you want to route it to login. Try following: app.use(function (req, res, next) { if ((req.path.indexOf('html') &gt;= 0)) { res.redirect('/login'); } }); It checks your url path, and if it detects html it will redirect to login
type: Answer
has comment: http://stackoverflow.com/comment/45072154
upvote count: 2
score: 2
answers question: http://stackoverflow.com/q/28362909

http://stackoverflow.com/q/28386853
answer count: 1
has comment: http://stackoverflow.com/comment/45117008
tagged with: javascript
has answer: http://stackoverflow.com/a/28386905
score: 0
tagged with: ember.js
tagged with: ember-model
accepted answer: http://stackoverflow.com/a/28386905
has comment: http://stackoverflow.com/comment/45111376
type: AnsweredQuestion
type: Question
has title: Same origin policy when developing on local machine
has body: Im using Ember and Ember-Model to develop a front end which is calling a Spring/Rest/MongoDB back end, which is all running on my local machine for development purposes, but I get the same origin policy error for my call. I want to know what the common work around for this is. Here is my code: App = Ember.Application.create(); App.Router.map(function(){ }); App.IndexRoute = Ember.Route.extend({ model: function(){ return App.User.find(); } }); App.User = Ember.Model.extend({ lastName: Ember.attr() }); App.User.adapter = Ember.Adapter.create({ findAll: function(klass, records) { $.getJSONP("http://localhost:8080/users").then(function(data) { records.load(klass, data.users); }); } })

http://stackoverflow.com/comment/44999678
comment on: http://stackoverflow.com/a/28325877
has text: @mpuria yes you've made it clear what you want to do. But if you really want to learn how it works, I suggest you do not simply copy everything, but instead try to build it on your own, starting from zero. I have added some links in my answer which can help you start.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/56147542
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28365737

http://stackoverflow.com/a/28304208
type: AcceptedAnswer
downvote count: 0
has body: This is not "TO CHANGE" the bounds but to listen when the bounds were changed: google.maps.event.addListener(map, 'bounds_changed', function() { var bounds = map.getBounds(); searchBox.setBounds(bounds); }); Pass {bound : new LatLngBounds.... } to: new google.maps.places.SearchBox( /** @type {HTMLInputElement} */(input)); So something like this Having your bounds object: var defaultBounds = new google.maps.LatLngBounds( new google.maps.LatLng(-33.8902, 151.1759), new google.maps.LatLng(-33.8474, 151.2631)); Pass it to contructor : new google.maps.places.SearchBox(input, {bounds: defaultBounds}); Check out the reference for google.maps.places.SearchBox
type: Answer
accepted answer of: http://stackoverflow.com/q/28304014
upvote count: 5
has comment: http://stackoverflow.com/comment/44961439
answers question: http://stackoverflow.com/q/28304014
score: 5

http://stackoverflow.com/comment/44960911
comment on: http://stackoverflow.com/q/28304673
has text: @Why do you expect createCounter to return 1 when it clearly returns a function? The inner function itself returns a value that should be '1', so should not the outer function return the value of the inner one?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28401747
type: Question
score: 0
has title: Receiving "undefined" errors when trying to access object details
has comment: http://stackoverflow.com/comment/45139421
has comment: http://stackoverflow.com/comment/45155220
has body: I'm very much a beginner when it comes to javascript, so I hope that you will bear with me. I have an html file that contains a table with three values for reporting on a variety of system statuses - name, status, and notes. I am pulling the contents of the table into a variable, and scanning it for tags that point to an offline or partially online system. If found, the system name, status, and any notes concerning its status are stored into an object array (at least, I think it is an object array - I'm new at this). Here's where I am having trouble. While I am looping through the table looking for a matching value, I am able to display an alert with the appropriate information as it is assigned to the object (example SmartPay, Offline, Not taking credit cards). Once I am out of the loop, I am unable to reference any data that I have stored. Here's the object constructor and function that I am working with: function status(name, status, notes) { this.name = name; this.status = status; this.notes = notes; } function parseStatus() { var tagMatch = document.getElementsByTagName("td"); var problemStatus = new Array(); var j = 0; for (i = 0; i &lt; tagMatch.length; i++) { if (tagMatch[i].textContent == "Offline" || tagMatch[i].textContent == "Partially Online") { problemStatus[j] = new status(tagMatch[i-1].textContent, tagMatch[i].textContent, tagMatch[i+1].textContent); alert("OFFLINE: " + problemStatus[j]['name'] + ", " + problemStatus[j]['status'] + ", " + problemStatus[j]['notes']); j++; } } } The alert at the end of the for loop displays everything correctly. If I add this after the end bracket for the loop alert(problemStatus[0]['name']); I get "Cannot read property 'name' of undefined" I do not understand where I am going wrong. Can someone please point me in the right direction? Edited to include the link to JSFiddle
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45146088
tagged with: javascript

http://stackoverflow.com/comment/44933325
type: Comment
comment on: http://stackoverflow.com/a/28286907
has text: If the browser is not full screen, why would the screen resolution matter?
score: 0
type: AnswerComment

http://stackoverflow.com/q/28310020
downvote count: 5
type: Question
has comment: http://stackoverflow.com/comment/44971121
has comment: http://stackoverflow.com/comment/44971045
answer count: 1
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/28310214
has body: It is a YouTube iframe and some divs (about 5 or less) which display video data as title, time and a progress bar and a random video section at the bottom. If the video doesn't exists these (title, time and progress) divs should not be displayed and then if the user click in a random video these divs should be displayed again. So is it faster to generate hidden tags and show them when the button is clicked with JS or do not generate them at all and create using createElement() ? What are the pros/ cons? And of course which is faster? And does that delta time really matter?
tagged with: http://stackoverflow.com/tag/html
score: -4
has title: HTML hidden tags vs JS createElement
upvote count: 1
has comment: http://stackoverflow.com/comment/44971904
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28310214

http://stackoverflow.com/q/28379976
has answer: http://stackoverflow.com/a/28391067
tagged with: iife
type: Question
tagged with: singleton
tagged with: module
has body: I am trying to practice different module patterns. Below is IIFE pattern for a scroll function that can be used for different elements in different pages (not sure this is the right pattern for the purpose). My question is 1. how to replace the config = {} options outside IIFE module? 2. I name every single functions, not sure if this is an overkill or suggested way in write this kind of code. 3. What would be a better module pattern for the purpose? ;(function($, ScrollToTop, undefined) { 'use strict'; var clickedElem = $('[data-scroll]'); var config = { scrollDistance: 500, speed: 300 }; var _scrollToTargetAnimation = function () { $('body').animate({ scrollTop: $($(this).data('scroll')).offset().top }, config.speed); return false; //stop bubbling }; var _showHideAnimation = function () { if ($(this).scrollTop() &gt; config.scrollDistance) { clickedElem.fadeIn(config.speed); } else { clickedElem.fadeOut(config.speed); } }; ScrollToTop.showHide = function() { if ($('.top-bar').length) return; $(document).scroll( _showHideAnimation ); }; ScrollToTop.clickBtn = function() { clickedElem.on('click', _scrollToTargetAnimation ); }; ScrollToTop.init = function (config) { $.extend(this.config, config); ScrollToTop.showHide(); ScrollToTop.clickBtn(); }; })(jQuery, window.ScrollToTop = window.ScrollToTop || {}); $(function() { config = { scrollDistance: 500, speed: 300 }; ScrollToTop.init(config); });
score: 0
answer count: 1
has title: Chage configurable setting's object outside Revealing Module Pattern
tagged with: javascript
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/22906662
tagged with: jquery

http://stackoverflow.com/a/28383151
has body: What you need is chaining and alternation operator function customReplace(str){ return str.replace(/_/g, " ").replace(/^'|'$|[^a-zA-Z0-9 &amp;-.!]|\+(?=[^+])/g,""); } The regex /^'|'$|[^a-zA-Z0-9 &amp;-.!]|\+(?=[^+])/g combines all that is needed to be removed. And we replace all _ by a space, which we finally return. \+(?=[^+]) looks for + that is followed by anything except + Also, the ordering of the replace is important.
type: Answer
has comment: http://stackoverflow.com/comment/45387431
answers question: http://stackoverflow.com/q/28383091
score: 1
upvote count: 2
downvote count: 1

http://stackoverflow.com/q/28386125
has answer: http://stackoverflow.com/a/66867415
has answer: http://stackoverflow.com/a/75756171
has answer: http://stackoverflow.com/a/60533623
has answer: http://stackoverflow.com/a/60775614
has answer: http://stackoverflow.com/a/68933893
favorite count: 0
has answer: http://stackoverflow.com/a/63480545
score: 41
upvote count: 41
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28386674
has body: I'm building a CMS system for managing marketing landing pages. On the "Edit Landing Page" view, I want to be able to load the associated stylesheet for whichever landing page the user is editing. How could I do something like this with React? My app is fully React, isomorphic, running on Koa. My basic component heirarchy for the page in question looks something like this: App.jsx (has `&lt;head&gt;` tag) └── Layout.jsx (dictates page structure, sidebars, etc.) └── EditLandingPage.jsx (shows the landing page in edit mode) Data for the landing page (including the path of the stylesheet to load) is fetched asynchronously in EditLandingPage in ComponentDidMount. Let me know if you need any additional info. Would love to get this figured out! Bonus: I'd also like to unload the stylesheet when navigating away from the page, which I assume I can do the reverse of whatever answer comes my way in ComponentWillUnmount, right?
tagged with: isomorphic-javascript
has title: Dynamically load a stylesheet with React
has answer: http://stackoverflow.com/a/34837201
tagged with: stylesheet
type: Question
answer count: 8
tagged with: reactjs
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/28435431
has body: Here's your code in main.js: // We launch the App require(['backbone', 'utils'], function(Backbone, Utils) { require(['preloader', 'router'], function(PreLoader, AppRouter) { document.addEventListener("deviceready", run, false); function run() { console.log("asas"); // ... and so on ... Your main.js file defines a function, run() inside a few require() blocks, but it never actually calls it. The run() function doesn't appear to be necessary; try just changing it to: // We launch the App require(['backbone', 'utils'], function(Backbone, Utils) { require(['preloader', 'router'], function(PreLoader, AppRouter) { document.addEventListener("deviceready", run, false); console.log("asas"); // ... and so on ... Your log statement should show up just fine.
answers question: http://stackoverflow.com/q/28420258
has comment: http://stackoverflow.com/comment/45210480
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45244926

search-engine
type: Tag
tags question: http://stackoverflow.com/q/28296142
tag name: search-engine
tags question: http://stackoverflow.com/q/28301663

http://stackoverflow.com/comment/44982964
comment on: http://stackoverflow.com/q/28316808
has text: Seriously it was that easy.....oh man it works!! Thanks for your help.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28283786
has answer: http://stackoverflow.com/a/30236828
tagged with: datatables-1.10
has body: I know I can use the function fnGetData() but that only gets me the data for whichever page I'm on. I want to get all of the data, even from pages not currently displayed. My purpose is to get all of the latitude &amp; longitude fields so that I can display it on a map using Google Maps v3. I have this code but, again, it only gets me data for the current page. var table = $('#example1 table').dataTable(); var data = table.fnGetData(); console.log(data);
answer count: 2
has answer: http://stackoverflow.com/a/28340227
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: datatables
has comment: http://stackoverflow.com/comment/44947489
has comment: http://stackoverflow.com/comment/44923911
upvote count: 3
type: UnansweredQuestion
type: Question
score: 3
has title: How to get all the data rows from DataTables.net when using pagination

http://stackoverflow.com/comment/44980572
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28315584
has text: @SunilPachlangia for the example sir ? please

http://stackoverflow.com/comment/44984774
comment on: http://stackoverflow.com/q/28317175
has text: Agree with @Claies - getting the data during ng-repeat doesn't seem the best way to go about it. At some point elsewhere in the code you will have populated items. Since the url depends only on the value of item, you can do getUrl for all of them at that point. That will make your display code much more straightforward.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28359028
accepted answer: http://stackoverflow.com/a/28360166
tagged with: angularjs
type: AnsweredQuestion
has title: Sort Object with Object using ng-repeat in AngularJs
has answer: http://stackoverflow.com/a/28360166
type: Question
answer count: 1
tagged with: javascript
tagged with: sorting
has body: My question is: I want to sort an Object whose children are Object using ng-repeat. facets = { 'tm_mailbox': {buckets: [{key:'budlion', doc_count:1037}]}, 'tm_user': {buckets: [{key:'karl', doc_count:10}, {key:'kael2', doc_count:111}] }, 'tm_message': {buckets: [{key:'sylvia', doc_count:298}] }}; facets_ordered_keys = ['tm_user', 'tm_message', 'tm_mailbox'] The object will be sorted A-Z by default. I want to order the object. I used two ng-repeat, the first loop will read sorted keys and second loop will read value by the key, such as the loop in pseudo code: for k in facets_ordered_keys: print k for v in facets[k]: print v But I cannot read facets[k] in the 2nd ng-repeat. Here is code in angular js: k is: {{k}} In facets values is:{{facets[k]}} {{k}} {{bucket.key}} {{bucket.doc_count}}
score: 0

http://stackoverflow.com/q/28367957
has title: Google visualisation target line
tagged with: line
type: Question
tagged with: target
answer count: 1
tagged with: javascript
score: 0
tagged with: visualization
has answer: http://stackoverflow.com/a/33181842
has body: I'm trying to add a target line in Google visualisation graph. Only when there is only one result, the target line is a dot instead of an expected line. chart.draw(data, { hAxis: {title: '', titleTextStyle: {color: 'red'}}, seriesType: 'bars', series: {1: {type: 'line'}} });
type: UnansweredQuestion

http://stackoverflow.com/q/28344906
possible better answer: http://stackoverflow.com/a/28345108
has comment: http://stackoverflow.com/comment/45034033
has comment: http://stackoverflow.com/comment/45034157
type: AnsweredQuestion
has title: Escape characters in JavaScript?
type: Question
has answer: http://stackoverflow.com/a/28345240
answer count: 2
has comment: http://stackoverflow.com/comment/45034051
accepted answer: http://stackoverflow.com/a/28345240
linked to: http://stackoverflow.com/q/75980
has body: I am creating a file name like this var name = $('#top-line').val(); var fname = random+'-'+name+'-something'; Here fname is file name. I don't know what the user might enter in #top-line, how can I escape the characters to be sure about safety. I tried it with a $top line = somethin "else" and things got messed up. From the comment I read I understand that escape("Need tips? Visit W3Schools!") will produce Need%20tips%3F%20Visit%20W3Schools%21 My doubt is will the file get saved as Need%20tips%3F%20Visit%20W3Schools%21 What if someone writes escape(/Need tips? Visit W3Schools!") EDIT on server I am saving files like $name = uniqid('somevalue',true); $file = 'usermemes/' . $name . '.jpeg'; On user computer they have the name that user provides.
linked to: http://stackoverflow.com/q/770523
score: 0
has comment: http://stackoverflow.com/comment/45034215
has comment: http://stackoverflow.com/comment/45034018
has answer: http://stackoverflow.com/a/28345108
tagged with: javascript

http://stackoverflow.com/comment/44963836
type: Comment
comment on: http://stackoverflow.com/a/28290699
has text: Someone did reply with something really similar to this but I'm selecting this as the answer mainly because you pointed out myFunction() being in the for loop. Thank you!
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45086767
score: 0
has text: I think you meant to write `a.c = a.b;` in your second example.
type: Comment
comment on: http://stackoverflow.com/a/28358201
type: AnswerComment

http://stackoverflow.com/comment/119362481
type: AnswerComment
comment on: http://stackoverflow.com/a/41077776
type: Comment
has text: Just as a solution I have been looking for. Thanks so much
score: 0

http://stackoverflow.com/a/28419890
answers question: http://stackoverflow.com/q/28419844
upvote count: 1
score: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45173429
type: Answer
has comment: http://stackoverflow.com/comment/45173493
has comment: http://stackoverflow.com/comment/45173318
has comment: http://stackoverflow.com/comment/45173169
has body: You could define a getter / setter, and name those functions with a preceding _ to indicate that they shouldn't be messed with: $(function() { 'use strict'; // Example feature module var featureOne = (function() { var privateVar = 0; function bar(n) { console.log(n); } return { foo: function() { bar(privateVar); return this; }, _getPrivateVar: function() { return privateVar; }, _setPrivateVar: function(val) { privateVar = val; return this; } } })() var myFeature = featureOne; myFeature.foo(); //logs 0 console.log(myFeature._getPrivateVar()) //logs 0 myFeature._setPrivateVar('hi').foo() //logs 'hi' });

http://stackoverflow.com/a/28329676
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28326751
has body: The issue is in the way you bind event handlers. $(".sellorderprice").click(function(e){ }); $(".sellorderamount").click(function(e){ }); Looking at your code, you're creating these links dynamically and appending to some table. But click() only works if your elements are already present in the DOM at the time you're defining these click handlers. So you need to use on() (in JQuery 1.7+) in delegated mode like this /* Assuming sellingorders is a static element, if this is also some dynamically added element, change main selector to closest static parent (or) document if there's none*/ $("#sellingorders").on('click','.sellorderprice, .sellorderamount',function(e){ e.preventDefault(); if(this.className == 'sellorderprice'){ $('#buyprice').val($(this).attr('href')); }else{ $('#buyamount').val($(this).attr('href')); } }); Hope this helps :)
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/28326751
type: AcceptedAnswer

http://stackoverflow.com/q/28308388
upvote count: 1
type: Question
tagged with: charts
tagged with: javascript
tagged with: extjs
has answer: http://stackoverflow.com/a/28308759
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has body: I've been researching without any luck about how to change the x legend color in a Line chart. Do you know how can I do it ? Attached image of the chart.
has title: ExtJS 4 - Changing legend colour dynamically in LineChart
score: 1

http://stackoverflow.com/comment/45178094
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28422487
type: QuestionComment
has text: @cgatian - this already is event delegation.

http://stackoverflow.com/comment/45011855
comment on: http://stackoverflow.com/a/28330958
score: 0
type: AnswerComment
type: Comment
has text: @BrettCaswell The instructions are just as unclear as my initial post unfortunately. I'm sure I could use anon functions, as that's what he's (my prof) has been stressing for us to use.

http://stackoverflow.com/comment/44952031
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28299920
type: AnswerComment
has text: But for example if I send only 3 requests per some time does the effect on web page is big??

http://stackoverflow.com/comment/45027868
score: 0
has text: @DarkAshelin Actually that is exactly what I need.. If video is not clipped, there will be ugly black edging in the top and the bottom of the Page..
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28340625

http://stackoverflow.com/comment/45035034
type: QuestionComment
type: Comment
score: 1
has text: "only got the Title row" — You still haven't show us what data is actually in `data`.
comment on: http://stackoverflow.com/q/28345029

http://stackoverflow.com/a/28407051
has comment: http://stackoverflow.com/comment/45149277
has comment: http://stackoverflow.com/comment/45150922
has body: First of all, initializing those view related stuffs in the controller is conceptually wrong. It's not recommended to override the init method this way unless you do it right. Actually you are missing to call parent init. export default Ember.Controller.extend({ init: function () { this._super(); // missing Possibly the issue was, you are trying to initialize those modules before the view is inserted. Particularly, since the model call is async, the controller finishes init method before view has been inserted. What you should be doing is, // assuming you use ember-cli // views/application.js import Ember from 'ember'; export default Ember.View.extend({ initLibs: function () { // do your initialization here }.on('didInsertElement') }); I'd also prefer the initialization of google+, the same way as you did for Facebook.
type: Answer
accepted answer of: http://stackoverflow.com/q/28395114
answers question: http://stackoverflow.com/q/28395114
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45150883
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/q/28327924
accepted answer: http://stackoverflow.com/a/28328408
has body: I'm trying to write a simple Content Service API with Google App Script. My doGet() just takes a single param 'row' and returns the value in that row from col 2. Here it is: function doGet(req){ try{ reqRow = req.queryString.split('=')[1]; rowNum = parseInt(reqRow); } catch(err){ throw "Error: "+ err + " -- Here's what we got: " + req + "Did you include a row parameter?"; } resultValue = getFromSheet(rowNum); if(resultValue != ""){ result = { "Result":"Success", "Row": reqRow, "Value" : resultValue } } else{ result = { "Result":"Failure", "Row": reqRow, "Value" : "No value found at row" } } return ContentService.createTextOutput(JSON.stringify(result)).setMimeType(ContentService.MimeType.JSON); } And here's our simple getFromSheet function: function getFromSheet(row){ if(typeof row != "number"){ row = Number(row); Logger.log("converting"); } sheetid = 111111111; ss = SpreadsheetApp.openById(sheetid); sheet = ss.getSheets()[0]; return ss.getRange(row, 2).getValue(); } When I post something to it, via a url similar to "https://script.google.com/macros/s/111111111/exec?row=3" I get the following error: Cannot find method getRange(number,number). Note: Why didn't I use req.parameters.row in our doGet() method? Because I was receiving the following error: Cannot find method getRange((class),number). Isn't getRange(number, number) the main way to call this method? Here is the reference guide to the sheet class: https://developers.google.com/apps-script/reference/spreadsheet/sheet Thank you all!
has title: Google App Script: Cannot find method getRange(number, number)
type: Question
upvote count: 4
tagged with: google-apps-script
tagged with: api
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28328408
score: 4
type: AnsweredQuestion

http://stackoverflow.com/comment/45411346
score: 0
comment on: http://stackoverflow.com/a/28332306
type: Comment
has text: It sounds like a simple data inconsistency. Can you make a jsfiddle for me to look at?
type: AnswerComment

http://stackoverflow.com/comment/45008402
has text: I added the component you're talking about to the original question.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28329550

http://stackoverflow.com/a/28410086
has body: It's probably much easier and faster to just use a regex if you only need one item/value from the HTML. I would like to give an example but therefor I would need a more extended snippet of how the HTML looks like that contains the endpoint that you want to fetch. Is it possible to give a snippet of the HTML that contains the endpoint?
type: Answer
answers question: http://stackoverflow.com/q/28409760
score: 0

http://stackoverflow.com/q/28348632
has body: I have two almost identical JQuery requests that I issue after the page loads, the first one requests json for the current path and the second for a different url. I was surprised to see, though, that the first request type is text/html and the second is application/json. I would have expected both to be application/json. The requests look something like this: $.ajax({ url: window.location.pathname, type: 'GET', dataType: 'json', success: doSomething }); $.ajax({ url: '/tags', type: 'GET', dataType: 'json', success: doSomethingElse }); Yet in the network tab I'm seeing: What am I missing?
tagged with: javascript
tagged with: jquery
tagged with: ajax
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28348829
score: 1
favorite count: 0
type: Question
has title: Ajax request to current path requests `text/html` instead of `application/json`
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
possible better answer: http://stackoverflow.com/a/28348724
has answer: http://stackoverflow.com/a/28348829
answer count: 2
has answer: http://stackoverflow.com/a/28348724
downvote count: 0

c#
tags question: http://stackoverflow.com/q/28351074
tags question: http://stackoverflow.com/q/28395377
tags question: http://stackoverflow.com/q/28295055
tags question: http://stackoverflow.com/q/28421575
tags question: http://stackoverflow.com/q/28431417
tags question: http://stackoverflow.com/q/28433401
tags question: http://stackoverflow.com/q/28338443
tags question: http://stackoverflow.com/q/28385418
tag name: c#
tags question: http://stackoverflow.com/q/28351686
tags question: http://stackoverflow.com/q/28311751
tags question: http://stackoverflow.com/q/28341418
tags question: http://stackoverflow.com/q/28319357
tags question: http://stackoverflow.com/q/28337546
tags question: http://stackoverflow.com/q/28293993
tags question: http://stackoverflow.com/q/28372527
tags question: http://stackoverflow.com/q/28412564
tags question: http://stackoverflow.com/q/28315672
tags question: http://stackoverflow.com/q/28383478
tags question: http://stackoverflow.com/q/28290985
tags question: http://stackoverflow.com/q/28403798
tags question: http://stackoverflow.com/q/28327674
tags question: http://stackoverflow.com/q/28416077
tags question: http://stackoverflow.com/q/28359810
tags question: http://stackoverflow.com/q/28397974
tags question: http://stackoverflow.com/q/28361010
tags question: http://stackoverflow.com/q/28362563
tags question: http://stackoverflow.com/q/28337988
tags question: http://stackoverflow.com/q/28416367
tags question: http://stackoverflow.com/q/28301747
tags question: http://stackoverflow.com/q/28331335
tags question: http://stackoverflow.com/q/28295918
tags question: http://stackoverflow.com/q/28339258
tags question: http://stackoverflow.com/q/28367683
tags question: http://stackoverflow.com/q/28394378
tags question: http://stackoverflow.com/q/28395476
tags question: http://stackoverflow.com/q/28423919
tags question: http://stackoverflow.com/q/28340017
tags question: http://stackoverflow.com/q/28282817
tags question: http://stackoverflow.com/q/28336358
tags question: http://stackoverflow.com/q/28345808
tags question: http://stackoverflow.com/q/28336017
tags question: http://stackoverflow.com/q/28339246
tags question: http://stackoverflow.com/q/28323799
tags question: http://stackoverflow.com/q/28299865
tags question: http://stackoverflow.com/q/28408377
tags question: http://stackoverflow.com/q/28333705
tags question: http://stackoverflow.com/q/28371589
tags question: http://stackoverflow.com/q/28436669
tags question: http://stackoverflow.com/q/28396534
tags question: http://stackoverflow.com/q/28365661
tags question: http://stackoverflow.com/q/28282205
tags question: http://stackoverflow.com/q/28300171
tags question: http://stackoverflow.com/q/28356390
tags question: http://stackoverflow.com/q/28290871
tags question: http://stackoverflow.com/q/28352169
tags question: http://stackoverflow.com/q/28371094
tags question: http://stackoverflow.com/q/28435078
tags question: http://stackoverflow.com/q/28381069
tags question: http://stackoverflow.com/q/28363387
tags question: http://stackoverflow.com/q/28293008
tags question: http://stackoverflow.com/q/28364501
tags question: http://stackoverflow.com/q/28296656
tags question: http://stackoverflow.com/q/28318847
tags question: http://stackoverflow.com/q/28405817
type: Tag
tags question: http://stackoverflow.com/q/28413291
tags question: http://stackoverflow.com/q/28282043
tags question: http://stackoverflow.com/q/28415316
tags question: http://stackoverflow.com/q/28372804
tags question: http://stackoverflow.com/q/28298199
tags question: http://stackoverflow.com/q/28295666
tags question: http://stackoverflow.com/q/28317182
tags question: http://stackoverflow.com/q/28316478
tags question: http://stackoverflow.com/q/28343669
tags question: http://stackoverflow.com/q/28367663
tags question: http://stackoverflow.com/q/28284271
tags question: http://stackoverflow.com/q/28349155
tags question: http://stackoverflow.com/q/28376372
tags question: http://stackoverflow.com/q/28284702

http://stackoverflow.com/q/28316151
tagged with: javascript
has answer: http://stackoverflow.com/a/28328309
tagged with: angularjs
tagged with: filter
has comment: http://stackoverflow.com/comment/44999124
type: UnansweredQuestion
type: Question
has body: Not too sure what I am doing wrong here. I am trying to return the participant of a conversation that has a username equal to the current user. Those are the scopes in the view: conversation: [{id: 1, participants: [{ date: 1234, user: [{ username: "test001", id: 2}], }, { date: 1456, user: [{ username: "test005", id: 5}], }] }] user: [{username: "test001", id: 2}] When calling {{user.username}} it works (no worries on that the scopes are loaded) Here is the code in the html with the filter: {{notMe}} I wanted to avoid building a specific filter and was under the impression that the angular ones should handle that right? Thanks for your help :-)
has title: Filter with nested element and scope AngularJS
score: 0
answer count: 1
tagged with: arrays

http://stackoverflow.com/q/28414764
has answer: http://stackoverflow.com/a/28415074
downvote count: 0
has answer: http://stackoverflow.com/a/28415073
possible better answer: http://stackoverflow.com/a/28415074
type: AnsweredQuestion
score: 1
has title: How to disable form submit for all fields but the submit button
type: Question
answer count: 2
upvote count: 1
has body: How can I disable form submit for all input fields but the submit button (with id called submit). The below code works but the problem is that I cannot do new lines in textareas. I am using jQuery. My goal is to prevent enter from submitting form. $('form').on('keyup keypress', function(e) { var code; code = e.keyCode || e.which; if (code === 13) { e.preventDefault(); return false; } });
tagged with: javascript
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/28415073

http://stackoverflow.com/a/28419405
score: 0
type: Answer
has body: In your controller just change the selectedAlbum model to the value you want $scope.selectedAlbum = albumsList[0].albumName
answers question: http://stackoverflow.com/q/28419292

http://stackoverflow.com/q/28326470
has body: I've been trying to place the Basemap Gallery TitlePane of this fiddle code on the right side of the mapDiv (center) pane, right next to the slider (marked as "BASEMAPS HERE"). I create a div called switchPane on the on the upper right corner of the pane and I would like for the TitlePane to go there (I initially thought "inside" the div but it doesn't seem to be working) and not on top of a Toggle Button for toggling the right pane on and off. I could make an inline absolute placement (I tried with the relative but it didn't work) for the slider but I'm not able to do the same thing for the Basemaps Gallery TitlePane. I tried to change many CSS properties of the widjet but I'm getting lost not finding which one to override!
type: AnsweredQuestion
tagged with: javascript
type: Question
score: 0
tagged with: arcgis-js-api
answer count: 1
has title: Dojo/Dijit TitlePane (Basemap Gallery) Placement
tagged with: http://stackoverflow.com/tag/html
tagged with: css
tagged with: dojo
has answer: http://stackoverflow.com/a/28406167
accepted answer: http://stackoverflow.com/a/28406167

http://stackoverflow.com/q/28400708
score: -1
tagged with: mysql
answer count: 2
has title: Table form dynamically refresh with php and ajax
upvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28400795
has answer: http://stackoverflow.com/a/28400831
type: UnansweredQuestion
tagged with: php
downvote count: 1
type: Question
has body: I have a page which has a form table. It displays select option when an option is selected the user clicks button and it runs updatephp.php which has query for updating. I need the select to be dynamically updated and display the success/error message like "updated" or "no results" on the screen how can I achieve this. Im not very good at ajax could someone guide me please. displaytable.php Select <?php $sql = "SELECT bakeryid, datefrom FROM cakes"; $sqlresult = $link->query($sql); $sqllist = array(); if(mysqli_num_rows($sqlresult) > 0) { while($row = mysqli_fetch_array($sqlresult)) { echo " ".$row['datefrom']." "; } $sqlencode = json_encode($sqllist); echo $sqlencode; } else { echo 'No Results were found'; } ?> <input type="hidden" value="<?php echo $bakeryid;?>" name="bakeryid"/>

http://stackoverflow.com/a/38489749
type: Answer
has body: Great question. The answer: it depends, but mostly one time bindings are a better option unless your app is very small. Why? Because if your app is middle sized or large you will have watch count problem. If you blow number of watches to more then 2000 your app will feel sluggish on less powerful devices whatever you do. Watches will slow your application all the time. On every digest cycle. So your primary concern regarding performance should be to keep that watch count down. And removing watches from stuff inside ng-repeat helps the most obviously. On the other hand track by will speed up refresh of a table a little but it's a optimization that you should take only if you know your app will stay small (bellow 2000 watches)
answers question: http://stackoverflow.com/q/28301958
score: 0

http://stackoverflow.com/comment/45087677
type: QuestionComment
has text: @thijs: figure out the shortest distance between two array elements, pretending that the array is a circle, so that there's invisible `...,5,1,2,3,...`
comment on: http://stackoverflow.com/q/28373567
score: 0
type: Comment

http://stackoverflow.com/q/28349253
tagged with: http://stackoverflow.com/tag/html
has title: Change day in a function used by onclick, javascript
has answer: http://stackoverflow.com/a/28350353
has body: Hey there i have the following problem. I am sure you could help me: I have a button that change the hour +1 hour or - 1 hour. But the date jumps from 00UTC to 23 UTC on the same day and not the day before. Note: addZero completes the string from 1 to "01" (it is because an image string needs 01 02 03 ) function switch_image(i) { if (i == 0) { d.setUTCHours(d.getUTCHours() - 1); if (d.getUTCHours() == 23) { d.setUTCDate(d.getUTCDate() - 1); } h = addZero(d.getUTCHours()); } else { d.setUTCHours(d.getUTCHours() + 1); if (d.getUTCHours() == 0) { d.setUTCDate(d.getUTCDate() + 1); } h = addZero(d.getUTCHours()); } } Thanks a lot for your help ;)
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45042645
linked to: http://stackoverflow.com/q/1050720
score: 0
has answer: http://stackoverflow.com/a/28350709
linked to: http://stackoverflow.com/q/1197928
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/comment/45021253
type: Comment
comment on: http://stackoverflow.com/a/28337646
type: AnswerComment
has text: Thanks for your reply, but won't it add new organization in that users collection? I just want to update the `displayname` inside related organization. Don't want to add another array with the same `idOrganization` with different `displayname`. And also it is showing there has no method 'add'.
score: 0

http://stackoverflow.com/q/28304131
has title: Close pop-up box with mouse click outside boundary
score: 0
answer count: 2
upvote count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28304221
has comment: http://stackoverflow.com/comment/44959540
has body: I have made this homepage. That has pop up boxes with log-in fields. When there is a pop up the background is dimmed. But the pop up should close if the user clicks any where outside the boundaries of the box. I have created the function closeOverlay, which works when the user hits "esc" on the keyboard, but when the user clicks outside the boundary of the box nothing happens. How can I make it so it works in both cases, when the user hits escape, or takes the mouse outside of the box boundaries and clicks This is the HTML code <?php // Just for displaying the display type for testing echo 'Display type = ' . $display_type . ' '; if ($display_type == 'Start') { echo 'StartPage '; } else if ($display_type == 'SignIn') { echo "StartPage with 'SignIn' popup box "; } else if ($display_type == 'Join') { echo "StartPage with 'Join' popup box "; } else if ($display_type == 'ForgotPassword') { echo "StartPage with 'ForgotPassword' popup box "; } else { echo 'StartPage with no popup box '; } ?> <?php $t = time(); echo (date("Y-m-d H:i:s", $t)); ?> Thompson Rivers University - Question/Answers SIGN IN JOIN FORGOT PASSWORD <img src ="images/question-mark.png" id="moveQuestion" title= "Image moving In Box" alt="ImgInbox" height = "100px" width = "100px" About Us Your email address Password Username (or email address) <input type="text" name="user" autofocus value="<?php echo $username ?>"> <?php echo $error_msg_username; ?> > Username (or email address) <input type="password" name="pass" value="<?php echo $password ?>"> <?php echo $error_msg_password ?> > Password
downvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28304426

http://stackoverflow.com/comment/44999720
has text: Yes Pointy, that's what I'm trying to do. But I'm unsure of how to properly do that.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28325932
score: 0

http://stackoverflow.com/comment/44970249
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28308778
has text: the fiddle works but whenever i copy and paste it in my editor it don't work there
score: 0

http://stackoverflow.com/a/28358114
answers question: http://stackoverflow.com/q/28357794
has body: You can use .offset() values to work for the positioning of the tooltip. Try something like this fiddle $('img').each(function(){ var img = $(this); img.click(function(){ $('.tooltip') .show(100) .text(img.attr('alt')) .offset({ top : img.offset().top + img.height(), left : img.offset().left }); }); });
type: Answer
has comment: http://stackoverflow.com/comment/45412116
score: 0

http://stackoverflow.com/q/28382362
has comment: http://stackoverflow.com/comment/45103320
has comment: http://stackoverflow.com/comment/45103269
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28382436
answer count: 4
has body: I have function: function delMeh() { console.log('prolazi klik'); var did = $(this).attr('data-value'); $.ajax({ url: "delTmeh.php", type: "POST", async: true, data: { vrednostid:did}, //your form data to post goes here as a json object dataType: "html", success: function(data) { $('#tablemeh').dataTable().fnDestroy(); drawMeh(); }, error: function(data) { console.log(data); } }); } and HTML: &lt;i data-value="32" onclick="delMeh();" class="fa fa-times delMeh"&gt;&lt;/i&gt; SO, on click I need to delete row 32 from database, but how I can get data-value of clicked element... I try with:var did = $(this).attr('data-value'); inside delMeh() function but dont work. How to get attr data-value of clicked element when call function like I need to do?
linked to: http://stackoverflow.com/q/7261619
tagged with: onclick
type: Question
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/28382399
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28588853
has title: Get attr when call function inside html
has answer: http://stackoverflow.com/a/28382441
tagged with: attr

http://stackoverflow.com/a/28312221
score: 4
accepted answer of: http://stackoverflow.com/q/28305628
type: Answer
upvote count: 4
has body: You need to rewrite your application in C. This is currently the only way to write Pebble apps that run without a phone.
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28305628

http://stackoverflow.com/q/28305869
possible better answer: http://stackoverflow.com/a/28305995
upvote count: 5
downvote count: 0
has answer: http://stackoverflow.com/a/28305995
tagged with: javascript
tagged with: jquery
answer count: 3
favorite count: 0
has body: I'm resizing a div with jQuery resizable and I only want to resize its height. I managed to only resize while dragging bottom helper : $('div').resizable({ handles: 's', }); But if I hold shift key, width is changing. See http://jsfiddle.net/6p20qjmr/3/ How can I disable this behavior? Edit: The div container width may change after initial resizable call.
tagged with: jquery-ui-resizable
type: AnsweredQuestion
tagged with: jquery-ui
has answer: http://stackoverflow.com/a/28306675
has answer: http://stackoverflow.com/a/50874087
has title: Don't keep aspect ratio with jQuery resizable while holding shift
type: Question
score: 5
accepted answer: http://stackoverflow.com/a/28306675

http://stackoverflow.com/q/28332564
has answer: http://stackoverflow.com/a/28332683
has body: I've created a function that works great but it causes me to have a lot more messy html code where I have to initialize it. I would like to see if I can make it more generic where when an object is clicked, the javascript/jquery grabs the href and executes the rest of the function without the need for a unique ID on each object that's clicked. code that works currently: html: testButton1 testButton1 I'd like to end up having html that looks something like this: testButton1 testButton1 If there is even a simpler way of doing it please do tell. Maybe there could be a more generic way where the javascript/jquery is using an event handler and listening for a click request? Then I wouldn't even need a onclick html markup? I would prefer if we could use pure jquery if possible.
score: 1
has answer: http://stackoverflow.com/a/28333426
type: Question
has answer: http://stackoverflow.com/a/28332848
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 6
possible better answer: http://stackoverflow.com/a/28332657
favorite count: 0
has comment: http://stackoverflow.com/comment/45012895
has comment: http://stackoverflow.com/comment/45013171
has answer: http://stackoverflow.com/a/28332657
accepted answer: http://stackoverflow.com/a/28333426
tagged with: http://stackoverflow.com/tag/html
has title: how to recode my jquery/javascript function to be more generic and not require unique identifiers?
tagged with: generics
has answer: http://stackoverflow.com/a/28332707
tagged with: dry
has answer: http://stackoverflow.com/a/28332754
upvote count: 1
has comment: http://stackoverflow.com/comment/45012238
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45013263

http://stackoverflow.com/q/28421945
has title: Content is not shown at angular.js web application while Hosting
type: AnsweredQuestion
tagged with: web-applications
tagged with: web-hosting
has answer: http://stackoverflow.com/a/28422619
type: Question
has body: I'm new at this, I built an angular.js app and now I want to host it, I tried both on google drive or firebase but in both cases the html is shown, but the information that loads on angular dosen't show.. Do I Have to develop a server side on node.js? What can I do? Thanks.
tagged with: javascript
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/28422619
tagged with: web
has comment: http://stackoverflow.com/comment/45177297
tagged with: angularjs

http://stackoverflow.com/comment/44926227
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28285793
score: 0
has text: I tried JustinYs solution out of jsFiddle and it really fixed the problem. Thanks again, such a newbie mistake did I make.

http://stackoverflow.com/comment/45008746
comment on: http://stackoverflow.com/q/28330736
has text: What is the problem?
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45033903
comment on: http://stackoverflow.com/a/28344838
type: Comment
has text: I think that OP is asking about why the char is not appearing in the ` ` not in the ` `.
type: AnswerComment
score: 0

http://stackoverflow.com/a/28365548
has comment: http://stackoverflow.com/comment/45162446
has body: check if the $on service is triggering. check if SharedFactory.data has the updated value inside the $on function. and you can type this in console to check the createControllers scope expand the scope object and see whether the variable that holds your data has the new data.. angular.element('[ng-controller=createController]').scope()
has comment: http://stackoverflow.com/comment/45075494
downvote count: 1
has comment: http://stackoverflow.com/comment/45145732
answers question: http://stackoverflow.com/q/28363916
score: -1
has comment: http://stackoverflow.com/comment/45153529
type: Answer
upvote count: 0

http://stackoverflow.com/comment/45151882
score: 0
has text: both your examples don't use event delegation that would indeed solve the problem you're addressing
type: AnswerComment
comment on: http://stackoverflow.com/a/28408975
type: Comment

http://stackoverflow.com/a/28346757
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28346221
answers question: http://stackoverflow.com/q/28346221
upvote count: 1
type: AcceptedAnswer
has body: I got it, jQuery was automatically serializing the data object to application/x-www-form-urlencoded, AngularJs wasn't... Working Code: $http({ method: "PUT", url: "https://XXXXXXXXXXXXXX/api.php?rquest=updateUuid", headers: { Accept: "*/*", "Content-Type": "application/x-www-form-urlencoded", Authorization: "Basic " + btoa(email + ":" + password) }, data: jQuery.param({ Email: email, Uuid: login_response.uuid }) }) Anyway this doesn't look so well, but it's working at least.. Anybody knows a better way to get AngularJs to send serialized data as x-www-form-urlencoded?

http://stackoverflow.com/q/28391528
answer count: 3
tagged with: jquery
linked to: http://stackoverflow.com/q/14220321
tagged with: ajax
has comment: http://stackoverflow.com/comment/45120233
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45120244
has answer: http://stackoverflow.com/a/28392360
linked to: http://stackoverflow.com/q/23667086
has comment: http://stackoverflow.com/comment/45120194
has body: I have something like this: var someJSON = function(){ // Calculate some stuff here $.ajax({ dataType: "json", url: "http://somewebsite.com/api/?callback=?", async: false, success: function(data) { return data; // How can I return this so that someJSON gets this value? } }); }(); console.log(someJSON); // I want someJSON to be = data from the ajax call Essentially, I want someJSON to end up being the value of this json data that is returned via ajax. How do I return the value from the nested $.ajax call though? Can I use some sort of callback that the value gets passed back through? Also I'm using async: false with this so that the rest of the script doesn't try to execute until someJSON has a value set. Is that the right way to do this?
has title: Return value from nested $.getJSON?
has answer: http://stackoverflow.com/a/28391570
tagged with: http://stackoverflow.com/tag/json
type: Question
has comment: http://stackoverflow.com/comment/45120248
tagged with: javascript
has answer: http://stackoverflow.com/a/28391565
score: 0

http://stackoverflow.com/a/28324695
answers question: http://stackoverflow.com/q/28322478
has comment: http://stackoverflow.com/comment/45034562
type: Answer
has comment: http://stackoverflow.com/comment/45005938
has comment: http://stackoverflow.com/comment/45044528
has comment: http://stackoverflow.com/comment/45019588
has body: Below is the code to get user's public posts with their GOOGLE PLUS ID with sign-in Note that: You should have Client ID and which can be generated by following the steps in Link1 and Link2 Code: Google+ Sign-in button demo: rendering with JavaScript Hope it helps.
score: 1
upvote count: 1
downvote count: 0

http://stackoverflow.com/comment/45173241
type: QuestionComment
has text: @MichaelVictor: But `.html()` does not offer a callback, it is synchronous. And your notation is wrong anyway, as it did call the jQuery object as a function, which should have thrown an exception. It only is important that the `.chosen()` call is placed inside the `success` callback.
comment on: http://stackoverflow.com/q/28415619
score: 0
type: Comment

http://stackoverflow.com/comment/44942723
has text: The problem is that if saveAll fails (and it does) partway through the "all" bit it doesn't give any clue about how far it got. I then thought "ok so in the saveAll error handler find all the records it did create, subtract them from the original set then save again but it feels like awfully complicated code.
type: Comment
comment on: http://stackoverflow.com/q/28293449
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45118469
type: QuestionComment
has text: I created a chat that we can use to discuss things a bit more http://chat.stackoverflow.com/rooms/70500/discussion-of-javascript-concepts
type: Comment
comment on: http://stackoverflow.com/q/28390322
score: 0

http://stackoverflow.com/q/28350482
has title: JavaScript Increment (Double Checking)
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28350536
type: Question
has comment: http://stackoverflow.com/comment/45045927
upvote count: 0
score: -2
tagged with: javascript
has comment: http://stackoverflow.com/comment/45044712
has comment: http://stackoverflow.com/comment/45044689
answer count: 1
has answer: http://stackoverflow.com/a/28350536
favorite count: 0
downvote count: 2
has body: I seem to have bad internet, and the only site loading is StackOverflow and CodePen. I just wanted to double check: Lets say I have this JS code. var energy = 100; var day = 3; var energyCounter = document.getElementById("energyC"); var dayCounter = document.getElementById("dayC"); var choice = prompt("What is your action? A1, A2, or A3?"); switch(choice) { case 'A1': if(choice === "A1") { energy -- 10; } break; case 'A2': if(choice === "A2") { energy -- 25; day -- 1; } break; case 'A2': if(choice === "A3") { energy ++ 5; } break; default: alert("I didn't understand."); } If it goes as I think, if the user types 'A1', then it should decrease the CURRENT energy by 10, and that's that. If they type 'A2', then it should decrease the CURRENT energy by 25 and the current day by 1, and finally if they type 'A3', it should increase the CURRENT energy by 5, right? (Of course, there's flaws &amp; the default case, but it's a sample.)

http://stackoverflow.com/a/28292150
accepted answer of: http://stackoverflow.com/q/28292024
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28292024
has comment: http://stackoverflow.com/comment/44937515
has comment: http://stackoverflow.com/comment/44937995
type: Answer
has body: Try this - Use Math.Random and parseInt Working Demo Here $(document).ready(function(){ var r1 = (Math.random()*10); var r2 = (Math.random()*10); if(parseInt(r1)==parseInt(r2)) // IF BOTH ARE SAME { if(parseInt(r1)==10) { r2=r2-1; } else { r2=r2+1; } } var allDiv = $('.someDiv'); $(allDiv[parseInt(r1)]).css({'background':'red'}); $(allDiv[parseInt(r2)]).css({'background':'red'}); });
upvote count: 2
score: 2
has comment: http://stackoverflow.com/comment/44937651
has comment: http://stackoverflow.com/comment/44937476

http://stackoverflow.com/a/28327971
has comment: http://stackoverflow.com/comment/45004005
has comment: http://stackoverflow.com/comment/45004326
answers question: http://stackoverflow.com/q/28327854
score: 0
has comment: http://stackoverflow.com/comment/45040669
has comment: http://stackoverflow.com/comment/45004228
has comment: http://stackoverflow.com/comment/45003940
type: Answer
has comment: http://stackoverflow.com/comment/45006263
has comment: http://stackoverflow.com/comment/45005844
has body: You could deserialize the JSON output via json_decode() and then you could try to parse the string to an timestamp with strtotime (http://php.net/manual/de/function.strtotime.php), then you could create a date from thins timestamp using the date() method (http://php.net/manual/de/function.date.php) with a given formatting string an the timestamp. But I'm not sure if your date string is ready to be parsed. In all cases you may to remove the \/Date( and )\/ parts of the string. EDIT: Looks like your string is not a timestamp, strtotime fails. You may have to check what kind of timestamp/ datestamp/ whatever your string is.

http://stackoverflow.com/comment/45113487
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28386970
has text: yes, the php is in the same folder and the relative address worked before I tried ajax.

http://stackoverflow.com/comment/45165308
type: QuestionComment
has text: You you want to select a continuos range of dates you can use [Jquery UI Daterangepicker](http://tamble.github.io/jquery-ui-daterangepicker/)
comment on: http://stackoverflow.com/q/28415958
score: 0
type: Comment

http://stackoverflow.com/comment/45200541
comment on: http://stackoverflow.com/a/28434204
type: Comment
type: AnswerComment
has text: @EliasVanOotegem - True :) - Rephrased
score: 0

http://stackoverflow.com/comment/55275099
score: 0
type: AnswerComment
type: Comment
has text: Thank you. It solved my problem. Do you know why AdBlock treats those images as ads?
comment on: http://stackoverflow.com/a/28878577

http://stackoverflow.com/a/28419765
upvote count: 3
has body: You need to take into account the fact that your query function might take a different time to return depending on the string argument you pass it. Right now, in your example code, if the query for "want" returns before the query for "I", then your translations will be outputted in the same order that the queries return (i.e. translation of "want", translation of "I"). Callbacks can help you get around this problem, because they are a function that will only get called when your query function returns. Then it's up to you to define what your program should do with the result. For instance, your program can output the results in the same order that the original array was in. This could be achieved using an index as suggested by Guffa, or using the async library that we will discuss later on. So, one thing you could try is to pass query a callback like this: function query(string, callback){ db.call.get(query, function(result){ if(result.length&gt;0){ callback(null, result[0].translation); } else { // not found in database callback(null, string); } }); } The canonical way to use callbacks in Node.js, is to give it two parameters, so it looks like: callback(err, result). If there is no error, you can call callback(null, result), while when there is an error, you can call callback(err) or callback (err, result), depending on what you want to report. Once your query function takes a callback, you are able to know when it did return a value, and you can use the async.map function (from the async library), like so: var async = require('async'); var sentence = "I want to translate this"; var words = sentence.split(' '); async.map(words, query, function (err, translations) { console.log(translations); } What this function does, is: run in parallel query on all the items in the words array wait for all the callbacks from all the query functions to return then call async.map's own callback (here the third argument: function (err, translations) {console.log(translations);})
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28417860
has comment: http://stackoverflow.com/comment/45244090
has comment: http://stackoverflow.com/comment/45214643
score: 3

http://stackoverflow.com/comment/45021826
comment on: http://stackoverflow.com/a/28337792
type: AnswerComment
has text: try to get it in a buttonclick event definitely it will get
score: 0
type: Comment

http://stackoverflow.com/a/28336257
score: 8
downvote count: 0
upvote count: 8
type: Answer
has comment: http://stackoverflow.com/comment/45023445
answers question: http://stackoverflow.com/q/28336104
has body: This covers all your cases: var tests = [ 'this is a test', 'foo Bar Baz', ... ] var res = tests.map(function(test) { return test .replace(/_/g, ' ') .trim() .replace(/\b[A-Z][a-z]+\b/g, function(word) { return word.toLowerCase() }) .replace(/^[a-z]/g, function(first) { return first.toUpperCase() }) }) console.log(res) /* [ 'This is a test', 'Foo bar baz', 'Foo bar', 'Foo-bar', 'FooBarBaz' ] */

http://stackoverflow.com/comment/45136480
has text: Thanks to to you (both) I'm finally on the right track. Unfortunately I've been working on it all day, but I'm still somewhat stuck. I've created a jsFiddle though, perhaps you'd be willing to take a look? It's right here: http://jsfiddle.net/Rorschach_/qxcn4zxc/10/ While the 'launch' button does make the ball move in an arc (changed that instead of ellipse because that's what I really wanted) it won't change to the speed typed into the input box. I've looked up the documentation about .val() and input tags but I can't quite put my finger on where things go wrong.
comment on: http://stackoverflow.com/a/28389015
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/42687057
type: Answer
answers question: http://stackoverflow.com/q/28403558
has body: Quiz Questions And Answers Quiz Questions Question 1. He -------------------- it. don't like doesn't like doesn't likes Question 2. They -------------------- here very often. don't come doesn't come doesn't comes Question 3. John and Mary -------------------- twice a week. come comes coming Question 4. I -------------------- mind at all. not isn't don't Question 5. It -------------------- sense. don't make doesn't makes doesn't make Question 6. They -------------------- happy. seem seems seeming Question 7. You -------------------- to do it. don't have doesn't have doesn't has Question 8. She -------------------- a brother. doesn't has don't has doesn't have Question 9. The journey -------------------- an hour. take takes taking Question 10. I -------------------- it now. want wants wanting Question 11. Peggy -------------------- by bus. come comes coming Question 12. She --------------------. don't know doesn't knows doesn't know Question 13. She -------------------- hard. try trys tries Question 14. They -------------------- football every weekend. play plays playing Question 15. The exam -------------------- two hours. last lastes lasts Number of score out of 15 = Score in percentage =
has comment: http://stackoverflow.com/comment/72497608
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/q/28426939
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28427010
accepted answer: http://stackoverflow.com/a/28426976
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28426970
tagged with: jquery
score: 0
has title: How to stop javascript onclick event
has answer: http://stackoverflow.com/a/28427060
possible better answer: http://stackoverflow.com/a/28427043
has body: I have external link which render image with javascript onclick event. I need to stop this click event.How can i do this ? For example: Html is render by external script: &lt;div class="demo-link"&gt; &lt;img alt="" onclick="verifylock();" src="https://example.com" style="cursor:pointer;cursor:hand"&gt; &lt;/div&gt; I have tried this with jquery but not get any luck: $(".demo-link &gt; img").click(function(e){ e.preventDefault(); });
has answer: http://stackoverflow.com/a/28426976
has answer: http://stackoverflow.com/a/28427043
answer count: 5

http://stackoverflow.com/a/28379823
has body: Your problem is not related to angular, but to Javascript. var arr = [] // arr is a pointer to an empty array var things = arr // things is a pointer to the same empty array arr = data // now arr points to data, but things still points to the empty array You can convince yourself of that by running the following code: var a = [1]; var b = a; a = [2]; // Now if you console.log a and b, a === [2] and b === [1] However if you manipulate the property of an object var a = { data: 1 } var b = a; a.data = 2; // Now a.data and b.data are the same: 2 a = { data: 3 }; // Here we changed a, not its property, so a and b are not the same anymore // a.data === 3 but b.data === 2 If you understand that, there are many ways to solve your issue, such as: angular.module('testApp') .factory('Thing', function($http) { var obj = {}; return { things: obj, get: function() { $http.get('/api/things').success(function(data) { obj.data = data; }); } }; }) And in your HTML use things.data. Or if you don't want to use an object property, but directly the array, instead of replacing the pointer you need to only update the content of the array (so arr still points to that same array): angular.module('testApp') .factory('Thing', function($http) { var arr= []; return { things: arr, get: function() { $http.get('/api/things').success(function(data) { for (var i in data) { arr[i] = data[i]; } }); } }; })
answers question: http://stackoverflow.com/q/28378911
score: 7
upvote count: 7
type: AcceptedAnswer
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28378911

http://stackoverflow.com/q/28415844
has answer: http://stackoverflow.com/a/28416869
has body: I have a "select" on my JSP. It is fill by "Region" objects like this : &lt;sf:select id="regionslist" path="region" items="${regions}" itemLabel="nameRegion"/&gt; I want to get the attribute "Region.idRegion" from the selected one on my list. Using this script : $regions.on('change', function(){ var val = $('#regionslist option:selected').val(); console.log(val) } ) i retrieve the object reference not the object in it self (mypackage.Entity.Region@75448e27). I heare about the possibility to use a JSON parser to get the object on the JS script but i'm newbee concerning JS. So can samone help me ? Thank you.
type: UnansweredQuestion
type: Question
tagged with: javascript
has title: Get object from using JS
score: 0
has comment: http://stackoverflow.com/comment/45164997
answer count: 1
tagged with: jquery

http://stackoverflow.com/a/28362961
answers question: http://stackoverflow.com/q/28362818
score: 0
has body: Your problem is with CSS not JS. As far I can tell your code is working, but there's no way of changing this specific style. You could try workarounds: Change Font Color For Disabled Input
type: Answer

http://stackoverflow.com/q/28394400
tagged with: javascript
tagged with: jquery
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45125660
tagged with: css
favorite count: 0
has title: input field value attribute wont change unless type="hidden"
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28394534
has body: I wanted to maintain a input field to keep a variable which does not need to display at the front-end. So I created an input filed like below. html &lt;input id="id" value="" class="hide-element" /&gt; css .hide-element{ display: none; } and in javaScript I change the value by doing below. $('#id').val("Hello"); But when I use Google chrome's inspect element it shows that the value attribute is not changed. &lt;input id="offSet" value="" class="hide-element"&gt; but when I remove the css and use as below. &lt;input id="offSet" value="" type="hidden"/&gt; and then I call $('#offSet').val("Hello"); Now it will show &lt;input id="offSet" value="Hello" type="hidden"&gt; And in both cases I can view that value by using below though it is not showed in the first case. alert($('#offSet').val()); Why is this kind of behavior happens ?
has comment: http://stackoverflow.com/comment/45125422
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/28394818
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45125420

ngroute
tags question: http://stackoverflow.com/q/28404996
type: Tag
tag name: ngroute

http://stackoverflow.com/comment/45104326
type: AnswerComment
comment on: http://stackoverflow.com/a/28382509
type: Comment
has text: @MarksGniteckis Hi, I created a template that uses Affix. You can use the template at http://www.bootply.com/T4nXcARH4V and apply your own content to it. Currently, the sub-navigation appears on the left-hand side of the page, but you can cut & paste it to the right hand side of the page if required. If you wanna save your changes at Bootply, then I recommend to become a new Bootply user. You just need to click 'Login' button in the top right-hand corner of the page, and enter your details and press the 'Sign up' button.
score: 1

http://stackoverflow.com/comment/44980390
type: Comment
type: QuestionComment
has text: You could probably use Masonry layout style that can be done just using Css. Or you can wrap the Col b and Col c into a div and position from there
score: 0
comment on: http://stackoverflow.com/q/28315211

http://stackoverflow.com/comment/45076044
score: 0
has text: Question is unclear .Post the code and problem clearly so that we can help you ..
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28367456

http://stackoverflow.com/a/28331439
has body: You haven't pasted the full html, but it should look something like this: Favorites {{favouriteL.name}} {{sport.name}} {{league.name}} Don't forget to attach the view with your controller using ng-controller.
accepted answer of: http://stackoverflow.com/q/28330237
score: 2
upvote count: 2
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28330237
type: Answer

http://stackoverflow.com/comment/112271387
comment on: http://stackoverflow.com/a/60176969
has text: Thank you. This helped me. I was using <></> inside map() Removing that helped me.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/28385373
upvote count: 1
accepted answer: http://stackoverflow.com/a/28385453
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28385453
tagged with: node.js
type: AnsweredQuestion
downvote count: 0
score: 1
has title: Mysql-nodejs nested queries
tagged with: mysql
has body: It says that cannot read property authorid undefined in socket.broadcast line. setInterval(function(){ db.query("select * from `notifications`", function(err, rows){ if (rows.length&gt;temp){ for (var i=temp; i&lt;rows.length; i++){ console.log('sending room post', rows[i].authorid); db.query("select `name` from `users` where `id`=?", [rows[i].authorid ], function(err, name){ name=name[0].name; socket.broadcast.to(rows[i].authorid).emit('new notification', { authorname:name, dpid:rows[i].followid, read:rows[i].read, type:rows[i].type, followstatus:1 }); }); } temp=rows.length; } }) }, 3000);
has comment: http://stackoverflow.com/comment/45108486
type: Question
tagged with: javascript
tagged with: express

http://stackoverflow.com/comment/44967795
comment on: http://stackoverflow.com/a/28307911
type: AnswerComment
score: 0
has text: I am including a jquery cookie library.
type: Comment

http://stackoverflow.com/q/28320483
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44989997
linked to: http://stackoverflow.com/q/20751110
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28321248
has comment: http://stackoverflow.com/comment/44989310
has comment: http://stackoverflow.com/comment/44990453
type: UnansweredQuestion
tagged with: internet-explorer
has title: Insert a new line to textarea using javascript (IE bug ?)
has comment: http://stackoverflow.com/comment/44991120
type: Question
score: 0
has body: I'm trying to implement following functionality. I would like to be able to catch keystroke of semicolon character and change it to automatically add new line after pressing this key. In code it looks like this : var keyCode = e.keyCode ? e.keyCode : e.which; if (keyCode == 59){ e.preventDefault(); var tmpStyle = j$("#styleEditor").val(); tmpStyle += ";\n"; j$("#styleEditor").val(tmpStyle); } So, firstly i'm catching this key (with "keypress" event), then I'm stopping it normal behaviour and at the end I'm adding semicolon and new line character to the end of textarea content. Now, everything works fine on FF, Chrome. However on IE 9 it behaves really strange - instead of adding new line it adds .. white space. Then, if backspace this white space and type ";" again it works as expected. You can reproduce it by firstly typing some other characters and then typing semicolon. I've also noticed that removing e.preventDefault() removes this issue, although then it paste two semicolons into textarea. Can somebody help me with it ? You can chceck my small demo on DEMO
has comment: http://stackoverflow.com/comment/44989923
tagged with: textarea
has comment: http://stackoverflow.com/comment/44989342

http://stackoverflow.com/q/28283963
type: Question
has title: Delayed state checking in Meteor
has answer: http://stackoverflow.com/a/28289444
tagged with: design-patterns
score: 4
answer count: 1
tagged with: mongodb
has body: Delayed state checking tl;dr - What are some good design patterns for reacting when an action has not taken place for a specified duration? Problem Setup I'm making a Farmville-like application. In this application, users have gardens that they take care of. There's a few variables that are tracked about each garden -- humidity, temperature, ph, nitrate, etc. The application guides you through taking care of the garden, creating tasks for you to do. It informs you if any of those variables are too low or too high based on readings you've submitted. In addition, it reminds you to take a reading for a variable if you haven't taken it in some specified amount of time. The garden data looks like // garden object { name: "Home garden", variables: { nitrate: { currentValue: 1.7, lastMeasuredAt: // some Date }, nitrite: { currentValue: 0.5, lastMeasuredAt: // some Date } } } So let's say there's a task called "Add fertilizer". The trigger for this task is the condition where nitrate is below 2.5ppm. Let's say that task data looks like // task object { name: "Add fertilizer", instructions: "Open bag, dump on garden", condition: { variable: "nitrate", operator: "$lt", threshold: 2.5 } } I build a search query with the condition data, and query the Gardens to see if any match that condition. I'm using MongoDB, so can form that query using plain old Javascript objects, and Meteor, so I have a live-updating cursor. query = { variables.nitrate.currentValue: { $lt : 2.5 }}; Gardens.find(query).observe({ added: function( garden ) { // add the task to the garden's task list }, removed: function( garden ) { // remove the task from the garden's task list } }); The problem The good news, this pattern works for the task I described. But what about when the task is based on a duration of time having passed? // time-based task object { name: "Take a nitrate reading", instructions: "Insert the nitrate probe", condition: { variable: "nitrate", operator: "$lt", interval: 2880 // 2 days in m…
tagged with: javascript
type: UnansweredQuestion
upvote count: 4
downvote count: 0
tagged with: meteor
favorite count: 0

http://stackoverflow.com/a/28363156
score: 3
answers question: http://stackoverflow.com/q/28362908
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28362908
type: Answer
has body: Your code itself is good! But when you select $("button"), the browser hasn't actually got to processing the button tag itself yet, so it doesn't exist at that point and the click event is not registered. There are two solutions: Move the &lt;script&gt; tags to the end inside the &lt;body&gt; tag, in which case the &lt;button&gt; will exist by the time the script is parsed. You can keep your &lt;script&gt; tag where it is, but wrap the entire script in jQuery's $(document).ready() handler, which executes its callback function when the entire document is parsed and ready to read: &lt;script type="text/javascript"&gt; $(document).ready(function() { $("button").click( function() { $.getJSON( "json_data.json", function(obj) { $.each(obj, function(key, value) { $("ul").append("&lt;li&gt;"+value.name+"&lt;/li&gt;"); }); }); }); }); &lt;/script&gt;
upvote count: 3

http://stackoverflow.com/q/28299497
tagged with: jquery
has comment: http://stackoverflow.com/comment/44950636
favorite count: 0
has title: Second scroll function not working? (Using ternary operators as flag)
has comment: http://stackoverflow.com/comment/44950971
answer count: 0
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44950720
has comment: http://stackoverflow.com/comment/44951502
score: 2
has comment: http://stackoverflow.com/comment/44952759
has comment: http://stackoverflow.com/comment/44953136
has body: Any idea why this isnt working? I have two scroll functions but it doesnt work. I tried combining them but that didnt really do the job either. Im wondering if the first scroll is interfering with the second scroll and why is that? Love to learn the cause and if someone will answer with a solution it would be great if you comment the code so that I can learn from it. UPDATED CODE where I combined the two functions: var status = 0; $(window).scroll(function () { var content_height = $(document).height() content_scroll_pos = $(window).scrollTop() percentage_value = content_scroll_pos * 100 / content_height newStatusA = percentage_value &gt; 5 ? 2 : 1; newStatusB = percentage_value &gt; 30 ? 2 : 1; if (newStatusA == status) return; switch (newStatusA) { case 1: TweenMax.to("#corner-menu", 2, { left: "-100%", ease: Power2.easeOut }); break; case 2: TweenMax.to("#corner-menu", 2, { left: "0%", ease: Power2.easeOut }); break; } if (newStatusB == status) return; switch (newStatusB) { case 1: TweenMax.to(".bar", 2, { right: "-125%", ease: Power2.easeOut }) break; case 2: TweenMax.to(".bar", 2, { right: "0", ease: Power2.easeOut }) break; } status = newStatusA; status = newStatusB; }); OLD CODE: var status = 0; $(window).scroll(function () { var content_height = $(document).height() content_scroll_pos = $(window).scrollTop() percentage_value = content_scroll_pos * 100 / content_height newStatusA = percentage_value &gt; 5 ? 2 : 1; if (newStatusA == status) return; switch (newStatusA) { case 1: TweenMax.to(".corner-menu", 2, { left: "-100%", ease: Power2.easeOut }); break; case 2: TweenMax.to(".corner-menu", 2, { left: "0%", ease: Power2.easeOut }); break; } status = newStatusA; }); $(window).scroll(function () { var content_height = $(document).height() content_scroll_pos = $(window).scrollTop() percentage_value = content_scroll_pos * 100 / content_height newStatusB = percentage_value &gt; 25 ? 2 : 1; if (newStatusB == status) return; switch (newStatusB) { case 1: TweenMax.to…
type: Question
has comment: http://stackoverflow.com/comment/44950609
has comment: http://stackoverflow.com/comment/44950747
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44951004

http://stackoverflow.com/q/28341390
has body: I use RequireJS to load my modules in one of my projects. I see around the web different ways to require modules using the require call (and not define). Lets assume I have a module named "JQuery" and I would like to require it. Two ways are possible as I saw in examples: This: require(["JQuery"], function($){ $.doSomething(); }) And this: var $ = require("JQuery"); $.doSomething(); My question is if the load is async as RequireJS documantation says it is, how can the second convention work? How can I say for sure that $ is defined and that the first row completed before the second row executes?
has answer: http://stackoverflow.com/a/28343254
tagged with: javascript
tagged with: require
answer count: 3
has title: When is RequireJS' require call asynchronous? When is it synchronous?
downvote count: 0
tagged with: asynchronous
score: 8
favorite count: 0
upvote count: 8
accepted answer: http://stackoverflow.com/a/28343254
has answer: http://stackoverflow.com/a/28341719
possible better answer: http://stackoverflow.com/a/28341654
tagged with: requirejs
has answer: http://stackoverflow.com/a/28341654
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/45115986
score: 0
type: Comment
has text: Could you post the full error on pastbin and then a link to it here? You can find it in the logs (`storage/logs/laravel...`).
comment on: http://stackoverflow.com/a/28386983
type: AnswerComment

html-framework-7
tag name: html-framework-7
tags question: http://stackoverflow.com/q/28397612
type: Tag

http://stackoverflow.com/comment/45162251
comment on: http://stackoverflow.com/q/28412970
score: 0
type: Comment
type: QuestionComment
has text: Jeremy - thanks. that seemed to work.

http://stackoverflow.com/q/28429579
accepted answer: http://stackoverflow.com/a/28431410
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28430590
tagged with: internet-explorer-11
has body: In IE11 Version 11.0.9600.16428 and below some WebGL Methods are not working correctly (as mentioned here: https://github.com/mrdoob/three.js/issues/3600) One Example is the method clearStencil. The Problem is that the method exists, but it's not working correctly. I would like to detect that and give the user some feedback. I tried the Detector.js from Three.js but it only checks if the browser and graphic card support WebGL and not if they support all relevant features. I tried to do a WebGL check like this: var supportsWebGL=function(){ if(Detector.webgl){ var _canvas = document.createElement( 'canvas' ); var _gl = _canvas.getContext( 'webgl' ) || _canvas.getContext( 'experimental-webgl' ); try{ _gl.clearStencil( 0 ); }catch(e){ return false; } return true; }else{ return false; } } In IE11 (11.0.9600.16428) the method supportsWebGL returns true, but gives me an Error like this: WEBGL11095: INVALID-OPERATION: clearStencil: Method not currently supported. Now I want my Method supportsWebGL to detect that incompability and return false. Does anyone knows how to do that?
tagged with: webgl
upvote count: 1
type: Question
answer count: 2
tagged with: browser-support
downvote count: 0
tagged with: javascript
has title: How to identify IE11 WebGL compatibility (clearStencil,shaders) correctly
has answer: http://stackoverflow.com/a/28431410
score: 1
favorite count: 0
tagged with: three.js
possible better answer: http://stackoverflow.com/a/28430590

http://stackoverflow.com/comment/45151122
has text: Any errors in the console? Have you checked the HTML, do all the elements exist with the given `id`?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28408606
score: 1

http://stackoverflow.com/comment/45043103
type: QuestionComment
type: Comment
score: 2
comment on: http://stackoverflow.com/q/28349596
has text: Where do `people` and `passwords` come from in your code? Are these filled with all the previous values already? (And what sense does a sign-up that is processed only client-side make anyway …?)

http://stackoverflow.com/comment/45100791
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28380324
has text: @janfoeh thanks for your help. I will try to do vulcanization and see if that will help. But if you can take a look at [Polymer Web-site](https://www.polymer-project.org/docs/start/getting-the-code.html), they don't have such flashing of white screen at all when switching between html pages, so I'm wondering is there anything left I've missed.
score: 0

http://stackoverflow.com/q/28317248
tagged with: image
score: 0
answer count: 2
tagged with: javascript
has title: Can't get entire png from PhantomJs render command
tagged with: http://stackoverflow.com/tag/html
tagged with: http://stackoverflow.com/tag/png
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28319638
type: Question
has body: I am using PhantomJS for converting html file into png. Actually, my html file is bit lengthier in horizontal way.PhantomJs do not capture its image entire up to last horizontal scroll.I'm using render command for converting html into png.What exactly I am missing or is there any limitation phantomJS has ?
tagged with: phantomjs
has answer: http://stackoverflow.com/a/28319638
has answer: http://stackoverflow.com/a/28409719
accepted answer: http://stackoverflow.com/a/28409719

http://stackoverflow.com/comment/45088873
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28374131
has text: At the moment the event handler is called, `checked` is true because you just intended to select the checkbox. The default action is only performed *after* all handlers have been executed. Only at that point the DOM will be updated to *not* check the checkbox.
type: Comment

http://stackoverflow.com/comment/45106561
type: Comment
comment on: http://stackoverflow.com/a/28384362
has text: It's `myArray[1] += 2;` tho.
type: AnswerComment
score: 0

encoding
tags question: http://stackoverflow.com/q/28322815
tags question: http://stackoverflow.com/q/28421578
type: Tag
tags question: http://stackoverflow.com/q/28293926
tag name: encoding
tags question: http://stackoverflow.com/q/28331383

http://stackoverflow.com/q/28394378
tagged with: jquery
has answer: http://stackoverflow.com/a/28395113
favorite count: 0
has title: AngularJS not working with JQuery displayed html
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
type: UnansweredQuestion
type: Question
tagged with: c#
score: 1
upvote count: 1
answer count: 1
has body: I have a Html page with a text box and am using a bit of AngularJS to display the count of characters remaining - @Html.TextArea("Description", htmlAttributes: new { @class = "form-control", placeholder = "Description, ng_model = "descMessage" }) {{ 500 - descMessage.length }} This works fine when I am simply displaying it as a partial view. I get correct count of chars remaining. @Html.Partial("~/Views/Desc/Index.cshtml") But does not work when I display it via JQuery. Instead of chars remaining, it always displays the actual text as - {{ 500 - descMessage.length }}. var options = { url: "/Desc/Index", type: "get", dataType: "html" }; $.ajax(options).done(function (data) { var $target = $("#displayform"); $target.html(data); }); The AngularJS expression was supposed to be evaluated here. Why does this not happen? I have used JQuery a lot in my experience, but first time using AngularJS along with it. How can I go about fixing this?
tagged with: javascript

http://stackoverflow.com/comment/45026583
comment on: http://stackoverflow.com/a/28340652
type: Comment
score: 0
type: AnswerComment
has text: Thank you! I added following code into the `main.js` and it works now: `panel.on("show", function() { panel.port.emit("show"); });`

http://stackoverflow.com/comment/45155509
type: QuestionComment
has text: Hm, would that elemnts id, be my entrire cssmenu? Or would I have to add an id for all my anchor tags? Or maybe my text, wich is the only part I am changing with ajax? :)
comment on: http://stackoverflow.com/q/28410898
score: 0
type: Comment

http://stackoverflow.com/comment/45069775
score: 0
has text: Where is your js?? and please make a fiddle and replicate problem.
comment on: http://stackoverflow.com/q/28360725
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45120191
comment on: http://stackoverflow.com/q/28388022
has text: I use a form action. Also hopefully in the future I will be using a database.I want to show the data under the submit button without going to another page. Any advice?
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/45126744
has text: no errors. the thumbnail preview shows up but there's no base64 code in the textarea. in ANY other browser it works
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28394959

http://stackoverflow.com/comment/45015703
comment on: http://stackoverflow.com/a/28334382
type: Comment
has text: Scroll down and you will se a blue section with the buildings image and the link to open the video.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/60358143
has text: Path needs to be absolute, e.g. `/home/myUser/someFile.csv`
comment on: http://stackoverflow.com/a/28437896
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45113470
comment on: http://stackoverflow.com/q/28375372
has text: Also, I'm using Angular 1.4-beta3, and the latest ui-router.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45159254
score: 0
type: AnswerComment
has text: Please edit your answer, and explain why this is a good solution.
type: Comment
comment on: http://stackoverflow.com/a/28411916

web-scraping
tags question: http://stackoverflow.com/q/28407372
tags question: http://stackoverflow.com/q/28289699
tags question: http://stackoverflow.com/q/28310577
tags question: http://stackoverflow.com/q/28281782
tag name: web-scraping
type: Tag
tags question: http://stackoverflow.com/q/28329807
tags question: http://stackoverflow.com/q/28338024

http://stackoverflow.com/a/43371633
has body: I rencently try to create an app for blind using NW and I came across the same issue. You can look at https://github.com/nwjs/nw.js/issues/1661. For production build (win64) : it works fine, using the system voices (Narrator). For development (archlinux) : In run mode on linux, I have to use Cylon Speech to plug system voices into speechSynthesis. Then, I launch nw command with this flags to enable speech : nw . --enable-speech-dispatcher With this method, I can have tts both on linux (for dev) and windows (for users) working fine.
type: Answer
answers question: http://stackoverflow.com/q/28328946
score: 0

http://stackoverflow.com/comment/45168067
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28415848
has text: I've updated my answer to show how to handle the click event in javascript. You could add your regex logic inside the event handler to generate the desired URL.
score: 0

http://stackoverflow.com/comment/45010862
comment on: http://stackoverflow.com/q/28331252
score: 0
has text: No no you misunderstood me. Can you paste pls all of your php? or if its long then only the captcha check's statement and the else
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28340947
type: Answer
answers question: http://stackoverflow.com/q/28339297
has body: The reason is (as per docs) this method will return the value of the given attribute, unless that attribute is not present, in which case the value of the property with the same name is returned (for example for the "value" property of a textarea element). If neither value is set, null is returned. getAttribute first of all looks for the attribute in the DOM, where if you can see href contains the complete web url. For example: in the answers you are getting on this question if you inspect the active tab you could see href="/questions/28339297/why-does-selenium-change-the-elements-href?answertab=active#tab-top", but if you have a look at the DOM there you can find this href is appended to http://stackoerflow.com.
score: 0

http://stackoverflow.com/a/28309712
answers question: http://stackoverflow.com/q/28309085
score: 1
upvote count: 1
has body: Change Close function to function pop_closed() { $link = $(this).find('a'); $link.popover("hide"); $that.html($url); }
downvote count: 0
has comment: http://stackoverflow.com/comment/45001439
type: Answer

http://stackoverflow.com/q/28314432
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/44978769
has comment: http://stackoverflow.com/comment/44978705
has body: I'm just getting started with Ember. I went through the starter kit video and practice app. Now I'm creating my own app. I can't for the life of me get it to render my about template. I keep getting "Uncaught Error: There is no route named about". Obviously, it doesn't think I have a router set up, but in the starter kit, they put in static text for their about section and were able to get it to show up without writing router extension code like: App.AboutRoute = Ember.Route.extend({ //code would go here. }); what am i missing? it's driving me crazy! here's my index.html: PickUp and here's my app.js code: App = Ember.Application.create(); App.Router.map(function(){ this.resource('about'); }); the rest of the code in the starter kit example relates to post and posts routes. any help is much appreciated, thanks!
has comment: http://stackoverflow.com/comment/44978728
has title: Ember 'no router named'
tagged with: javascript
score: 0
tagged with: ember.js
answer count: 0

http://stackoverflow.com/comment/44967599
type: QuestionComment
type: Comment
has text: This is the JS creating the new ones: function addGuest() { var id = makeid() var fieldset = $('.guest-fieldset:first').clone().appendTo('#guest-fieldset-container'); fieldset.attr('id', id); var guest = fieldset.find('input.guest-name'); guest.val(''); var attending = fieldset.find('select.attending'); attending.after(""); }
comment on: http://stackoverflow.com/q/28308249
score: 0

http://stackoverflow.com/comment/45066743
has text: @Christian.tucker Bracket notation accepts string only.
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28362141

http://stackoverflow.com/a/28325798
has comment: http://stackoverflow.com/comment/45008738
answers question: http://stackoverflow.com/q/28325061
has comment: http://stackoverflow.com/comment/44999447
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45005568
has body: Here is a similar ember.js question: Ember.js dates a day early Also make sure your javascript ISO-8601 date has the timezone. I had a similar issue with web api where the ISO-8601 dates were not sending any timezone info and no Z for UTC and the receiver assumed they were not converted to UTC and made them a day earlier '2012-07-27T18:51:45.53403Z // UTC'. You could use Fiddler or Chrome dev tools to see the format of date you are sending to the server make sure the Z or offset '2012-07-27T11:51:45.53403-07:00 // Local' is there.

http://stackoverflow.com/a/28319326
type: Answer
has body: It is some sort of hack but you can do it using ng-init. We can track last element is rendered on DOM or not by checking $last inside ng-repeat. Only you need to add ng-init="$last && domRendered()" inside ng-repeat div. Code changes template: ' ' + ' ' + ' 64x64 ' + ' ' + ' {{course.name}} ' + ' ' + ' ' + ' ' + ' ' + ' ', link: function(scope, element){ scope.domRendered = function(){ element.children(); //you can get element children here }; } Or more better way you can try this link. for that you need to add one more directive. Hope this could help you. Thanks.
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28315106
has comment: http://stackoverflow.com/comment/50177281
upvote count: 1

http://stackoverflow.com/comment/45102669
type: Comment
type: QuestionComment
has text: What's the result you're looing to achieve?
comment on: http://stackoverflow.com/q/28380976
score: 0

http://stackoverflow.com/q/28404996
type: AnsweredQuestion
tagged with: javascript
has comment: http://stackoverflow.com/comment/45144403
score: -1
has comment: http://stackoverflow.com/comment/45144388
upvote count: 0
has answer: http://stackoverflow.com/a/28405202
answer count: 1
favorite count: 0
has title: Angularjs Facebook Login: Cannot read property 'appendChild' of null
tagged with: angularjs
tagged with: facebook
tagged with: ngroute
tagged with: restangular
has body: I am using angular-facebook module for adding Facebook Login capability to my application. Generally I get the following error while loading the page: The "fb-root" div has not been created, auto-creating Cannot read property 'appendChild' of null When I get this error the facebook login popup comes empty/blank or unable to login. My angular module dependencies are below: angular.module('myApp', ['ngResource', 'ngRoute', 'facebook', 'restangular', 'LocalStorageModule']) My index.html: .. ..
accepted answer: http://stackoverflow.com/a/28405202
downvote count: 1
has comment: http://stackoverflow.com/comment/45198660
type: Question

http://stackoverflow.com/q/28414398
accepted answer: http://stackoverflow.com/a/28415034
favorite count: 0
has body: I am new to JavaScript, and I need some ideas/help to, how I could make my script work. So the idea is, you roll two dices, that is rolled by pressing a "roll" button and then a reset button that resets everything, in the whole HTML. So here is the deal, lets say both of eyes shows "5", so "5" should be remove from the array/function, if the "roll" button is pressed agian, the two dices should only be able to land on 1,2,3,4 and 6, and then it would keep removing the numbers from the array/function, if both dices showed the same number. And the rest button, just reset everything, completly. function rollDice() { //var points = new Array(1,2,3,4,5,6); var a = new Array(1,2,3,4,5,6); var die1 = document.getElementById("die1"); var die2 = document.getElementById("die2"); var status = document.getElementById("status"); var d1 = a[Math.floor(a.length * Math.random())]; var d2 = a[Math.floor(a.length * Math.random())]; var diceTotal = d1 + d2; die1.innerHTML = d1; die2.innerHTML = d2; if(d1 == d2){ function nyroll() { var b = new Array(1,2,3); var die1 = document.getElementById("die1"); var die2 = document.getElementById("die2"); var status = document.getElementById("status"); var d1 = b[Math.floor(b.length * Math.random())]; var d2 = b[Math.floor(b.length * Math.random())]; var diceTotal = d1 + d2; die1.innerHTML = d1; die2.innerHTML = d2; } This it my function so fare. I was wondering, if I could make it with some kind a variable function, for the onClick button, so the function it would run, would depend on which numbers ever removed.
score: 0
upvote count: 1
downvote count: 1
type: AnsweredQuestion
has title: Dices, variable function(s), array slice, new button, different function
type: Question
has answer: http://stackoverflow.com/a/28415034
tagged with: dice
tagged with: function
answer count: 1
tagged with: arrays
tagged with: javascript
tagged with: variables

http://stackoverflow.com/a/28335265
has body: It is often a good idea to keep the number of files the browser needs to request to a minimum. The browser may have to open one connection per HTTP request, but if you put all your JavaScript code in one big file it will only have to do one request and thus only one connection needs to be opened to fetch your js code.
score: 1
type: Answer
answers question: http://stackoverflow.com/q/28335219
has comment: http://stackoverflow.com/comment/45016862
upvote count: 1
downvote count: 0

http://stackoverflow.com/q/28379253
downvote count: 1
has comment: http://stackoverflow.com/comment/45098121
has comment: http://stackoverflow.com/comment/45098376
tagged with: internet-explorer
upvote count: 5
has answer: http://stackoverflow.com/a/28784705
tagged with: javascript
score: 4
type: Question
linked to: http://stackoverflow.com/q/18077217
has title: Getting browsers to source and recompile script for live editing
tagged with: firefox
favorite count: 0
has answer: http://stackoverflow.com/a/28553327
has body: How could one trigger script sourcing and recompilation from from client side code only without involving browser specific extensions or browser specific debugging protocols? I'm talking live editing, where a change to an objects prototype would affect instances already created.
has comment: http://stackoverflow.com/comment/45098191
answer count: 4
has comment: http://stackoverflow.com/comment/45343662
has comment: http://stackoverflow.com/comment/45875306
has comment: http://stackoverflow.com/comment/45883281
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28689345
has answer: http://stackoverflow.com/a/28435747
tagged with: google-chrome

http://stackoverflow.com/comment/45104606
has text: @shershen It is very similar to http://stackoverflow.com/questions/20689481/recreating-jquerys-ajaxstart-and-ajaxcomplete-functionality. By changing in navtive code is only option ?
score: 0
comment on: http://stackoverflow.com/q/28383104
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28339369
downvote count: 0
answers question: http://stackoverflow.com/q/28339346
score: 1
has comment: http://stackoverflow.com/comment/45024934
has comment: http://stackoverflow.com/comment/45024635
has comment: http://stackoverflow.com/comment/45024378
has body: is function a object in javascript? Yes. Does foo has a property named proto pointing to the Function 's prototype? Not named proto, no. This is a bit of a confusing area: All objects have an underlying prototype object they inherit from. From ES5 onward, you can get a reference to that object via Object.getPrototypeOf (e.g., var p = Object.getPrototypeOf(blah) gives you a reference to blah's prototype). Some engines (including Firefox's SpiderMonkey) also make underlying prototype available via the pseudo-property __proto__, and that will be in the spec as of ES6, but officially only when JavaScript is used in browsers. Separately, all normal functions have a property called prototype, which is not that function's underyling prototype (see above). Instead, it's the object that will get assigned as the underlying prototype of objects created using that function as a constructor via the new keyword. Since this is a bit confusing, let's draw a picture. Suppose we have this code: function Foo() { this.name = "xx"; } var f = new Foo(); (Since I used it as a constructor, I've used the name Foo rather than foo to stick to conventions.) Here's what we now have in memory: +------------+ | Function | | (function) | +------------+ +-----------+ | __proto__ |----+->| (object) | This is the object assigned to functions | prototype |----/ +-----------+ as their underyling prototype +------------+ | | call | | | apply | | | bind | | | ... | | +-----------+ +------------+ | | Foo | | | (function) | | +------------+ | | __proto__ |----+ | | +----------+ | prototype |----+---->| (object) | This is the object assigned to +------------+ | +----------+ objects created via `new Foo` | | (blank) | | +----------+ +-----------+ | | f | | | (object) | | +-----------+ | | __proto__ |-----+ | name: xx | +-----------+ (I've left off the references to Object.property above to keep things simpler.) How can I see this property. See above, either __proto__ (on only some engines for now, will be st…
has comment: http://stackoverflow.com/comment/45058516
upvote count: 1
has comment: http://stackoverflow.com/comment/45025033
has comment: http://stackoverflow.com/comment/45024964
has comment: http://stackoverflow.com/comment/45025000
type: Answer
has comment: http://stackoverflow.com/comment/45024075

http://stackoverflow.com/a/28310214
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28310020
has comment: http://stackoverflow.com/comment/44971792
answers question: http://stackoverflow.com/q/28310020
score: 1
has body: Both are good options, but the difference between them is that HTML is parsed a lot faster than JS since it does not need to be interpreted after the page loads. But javascript will also lockdown the element so that it cannot be manually altered. For example, this answer you are reading will take about 2 ms to load onto the page... but if you did: var answer = createElement('div'); answer.innerHTML = "Both are good options..."; document.body.appendChild(answer); each line would take about 5 ms, adding up to 15 ms in total. Making it a little slower. But it wont be drastic if you only do it to a few elements. now if you are in chrome/firefox/safari try doing CTRL+SHIFT+I or F12... you should see developer tools popup.. and if you set this answer to hidden, you will not see this answer. but you can still alter the code of it. and when you unhide it, it will show you the new code. Javascript will prevent this from happening, but if the element is already made, or has a lot of content in it then just use hidden
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44971758
has comment: http://stackoverflow.com/comment/44971557

http://stackoverflow.com/a/28388123
answers question: http://stackoverflow.com/q/28388101
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45117495
accepted answer of: http://stackoverflow.com/q/28388101
has comment: http://stackoverflow.com/comment/45114992
type: Answer
has comment: http://stackoverflow.com/comment/45114614
downvote count: 0
score: 3
has body: $.get('makemeastring.html').then(function (data) { console.log(data); }).fail(function () { // Error occurred, handle it here }); jQuery's .load() function puts data into a DOM element. You don't want that, so .get() will be fine. http://api.jquery.com/jquery.get/
has comment: http://stackoverflow.com/comment/45114627
has comment: http://stackoverflow.com/comment/45114770
upvote count: 3
has comment: http://stackoverflow.com/comment/45114764

http://stackoverflow.com/a/28396840
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
has body: To begin with: Do not use regex to parse HTML, it is not a good idea, since it is impossible to build regex parsing HTML :) But back to your question: var str=" Open opens openes \"Open opens openes\" clopened "; var words=str.match(/(\bopen\b|\bopens\b|\bopenes\b)(?=[^>]*<)/ig); This will search for your words followed by anything except for > and then followed by <. That solution is not the best but you cannot expect regex to do something it was not designed for.
accepted answer of: http://stackoverflow.com/q/28396697
upvote count: 2
answers question: http://stackoverflow.com/q/28396697

http://stackoverflow.com/comment/44932958
has text: I can't upvote since it requires 15 reputation. I don't know why people gave my question downvote. Considering that it's a very basic question :(
type: Comment
comment on: http://stackoverflow.com/a/28288927
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44988533
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28319970
has text: I just want to get the GET value from the URL the `values=test&value2=tes2` to be display
score: 0

http://stackoverflow.com/a/28307540
answers question: http://stackoverflow.com/q/28307483
has body: You have the jQuery tag so it sounds like you are using jQuery? Add a class name to each A tag then: toggle No need for your toggle code.
upvote count: 3
type: Answer
downvote count: 0
score: 3

http://stackoverflow.com/comment/45039458
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28333480
score: 1
has text: @NietzscheProgrammer, a lot of people are new to X language/framework/technology - that is why SO is a great resource. But to keep it great means that questions need to be carefully constructed, thinking not only about your own issue, but also about future visitors that may have similar problems. Not to mention, that trying to reduce and simplify an example, carefully examining what is relevant or not, would help *you* to understand things better and solve issues on your own.

http://stackoverflow.com/comment/45479468
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28309784
has text: Question is not about how to mark a model as edited, but about how to pass not all the fields(cells), but only specific one. Because the Model on UI is not the same entities in database. Making them equal and passing entities from ORM to UI without Entity to Model mapping (or known as a Model in MVC) is a monkey code.
score: 0

http://stackoverflow.com/q/28309547
score: 0
type: UnansweredQuestion
has body: I have some json along the lines of { "user1": [{"distance": 1, "pace": 100 }, {"distance": 4, "pace": 120}, {"distance": 9, "pace": 110}], "user2": [{"distance": 1, "pace": 110 }, {"distance": 7, "pace": 130}, {"distance": 14, "pace": 140}], } In total there are up to 30 users, with each user having up to 500 'frames'. I want to animate an icon (svg or png or css) for each user simultaneously so that all 30 users can go across the screen. How can I do this, ideally in a way that would play nicely with react.js as I will probably be using that to handle other things on the screen. Alternatively, can I do it purely in react.js and with natively javascript?
tagged with: animation
type: Question
tagged with: reactjs
has answer: http://stackoverflow.com/a/28316485
answer count: 1
has comment: http://stackoverflow.com/comment/44972100
tagged with: javascript
has comment: http://stackoverflow.com/comment/44970179
has title: How can I animate multiple objects across a web page in Javascript based on json data?

http://stackoverflow.com/comment/45086498
type: Comment
score: 0
type: AnswerComment
has text: 1. Where should this communication take place in the script? It's currently the last thing triggered by "onReady: {}" 2. Am I calling port on the right object? I tried self, tabs, and tab. 3. Can you give me a sample of what the code in TryFA should look like?
comment on: http://stackoverflow.com/a/28367806

http://stackoverflow.com/comment/45120554
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28391582
has text: @priyam, I can't give you a definitive answer without knowing more about what you actually doing, but as a suggestion, if the user navigates back to a previous answer and tries to post it, in the controller check if they have already answered it then redirect them to an error page with the message, or add a ModelState error and return the view. Or better, prevent caching and in the GET method, do the check and redirect to an error page. There a numerous ways you could handle this.

http://stackoverflow.com/comment/45114128
type: Comment
type: QuestionComment
has text: Your code works fine! look at this [jsFiddle](http://jsfiddle.net/5L1ukvzx/). Note that 800px is a lot of scrolling.
score: 0
comment on: http://stackoverflow.com/q/28388268

http://stackoverflow.com/comment/44962203
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28305340
has text: i tried your code and this one also works, wow didnt know there are a lot of approaches to my question; id love to vote up your answer but unfortunately i dont have enough reputation to do that but your answer is highly accepted to :)

http://stackoverflow.com/q/28379881
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28379887
tagged with: javascript
has title: Angular .config not being called
answer count: 3
downvote count: 0
score: 1
favorite count: 0
tagged with: angularjs
has body: I've been beating my head against what is probably a stupid mistake for the last couple hours. My angular .config module isn't being called and I can't figure out why. In an effort to eliminate potential sources of trouble, I've reduced my app down to only the entry point index.js file and and am not injecting any dependencies other than ngRoute. All the files are being loaded just fine and I can trace code execution to the app.config line but breakpoints inside the passed function never get hit and neither of the console.logs ever fire. What am I doing wrong here? I've made angular apps before and never had this issue. I've probably got a typo somewhere that I'm missing but damned if I can find it. My index.html: ... ... My index.js: 'use strict'; /*global angular*/ var app = angular.module('pagednaApp', ['ngRoute'/*, 'pagednaApp.services', 'pagednaApp.controllers'*/]); app.config(function($scope, $routeProvider){ console.log('test'); console.log($scope); $routeProvider .when('/', { templateUrl: 'content.html', controller: 'mainController' }); });
has answer: http://stackoverflow.com/a/28379887
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28381205
possible better answer: http://stackoverflow.com/a/28379895
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28379895

http://stackoverflow.com/q/28407507
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28412094
tagged with: ajax
has comment: http://stackoverflow.com/comment/45150642
has comment: http://stackoverflow.com/comment/45149740
has comment: http://stackoverflow.com/comment/45149197
has comment: http://stackoverflow.com/comment/45149379
has title: js getting remote div content into variable
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45152397
has answer: http://stackoverflow.com/a/28412094
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45149309
has comment: http://stackoverflow.com/comment/45149458
type: Question
has comment: http://stackoverflow.com/comment/45149541
has comment: http://stackoverflow.com/comment/45149642
tagged with: javascript
has body: I have a webpage where I put status of my webservice task. It looks like this: <c:out value="${size}"/> <c:out value="${isRunning}"/> <c:out value="${intIsRunning}"/> <c:out value="${status}"/> after rendering I get this: 100 false 0 0 size is the size of a job and can be any int value. isRunning is true or false and intIsRunning is 1 or 0. status is percentage completion of the job. I'd like to be able to get content of those ids and put them into js variables on my other web page however I'm not js aficionado myself. For now I have this: $(document).ready(function() { $('.progress .bar').progressbar(); var fetch = setInterval(loadStatus, 500); var isRunning; function loadStatus() { $.get('/status #intIsRunning', function (data) { console.log(data); console.log("!"); console.log("--->("+$(data).index("#status")+")"); }); isRunning = 0; console.log(">>" + isRunning); // console.log($('.progress .bar').prop(['data-transitiongoal'])); // $('.progress .bar').prop(['data-transitiongoal']).load('/status #status'); // $('.progress .bar [data-transitiongoal]').load('/status #status'); // $('.bar').attr('data-transitiongoal', i.toString()); // console.log("progress: "+progress); if (isRunning == 0) { clearInterval(fetch); } } }); This script should query my status page for aforementioned values and put status into my progress bar as long as running is true. If running is false this script should stop but right now I can't extract those variables. Could anyone provide help? EDIT: I got it to work that way: I'll check posted answer later this week.
score: 0
has comment: http://stackoverflow.com/comment/45149842
answer count: 1

http://stackoverflow.com/q/28310767
tagged with: javascript
has answer: http://stackoverflow.com/a/28315041
has body: We have a mongo collection messages that is in the following format... /* 0 */ { "text" : "A message to John", "created" : ISODate("2015-01-29T23:50:10.488Z"), "to" : { "id" : ObjectId("54bf1dc6c65b030c00faec0d"), "name" : "John Smith" }, "from" : { "id" : ObjectId("54bf1e1ceb5bf8800b0f5a8c"), "name" : "Martin Fowler" }, } /* 1 */ { "text" : "Another message to John", "created" : ISODate("2015-01-30T00:37:38.106Z"), "to" : { "id" : ObjectId("54bf1dc6c65b030c00faec0d"), "name" : "John Smith" }, "from" : { "id" : ObjectId("54bf1e1ceb5bf8800b0f5a8c"), "name" : "Martin fowler" }, } /* 2 */ { "text" : "Just another message to Jerry", "created" : ISODate("2015-01-30T00:37:38.106Z"), "to" : { "id" : ObjectId("54bf1e80eb5bf8800b0f5a8d"), "name" : "Jerry Jones" }, "from" : { "id" : ObjectId("54bf1e1ceb5bf8800b0f5a8c"), "name" : "Martin Fowler" }, } /* 2 */ { "text" : "Message to Martin Fowler", "created" : ISODate("2015-01-30T00:37:38.106Z"), "to" : { "id" : ObjectId("54bf1e80eb5bf8800b0f5a8d"), "name" : "Martin Fowler" }, "from" : { "id" : ObjectId("54bf1e1ceb5bf8800b0f5a8c"), "name" : "Jerry Jones" }, } We need to display the data above in a conversation format where we group each of the conversations together. A conversation meaning that it can either be to or from. An example of what we need this to data to look like is the following format: { "result":[ { "id":"54bf1dc6c65b030c00faec0d", "name":"Jerry Jones", "messages":[ { "text" : "A message to John", "created" : ISODate("2015-01-29T23:50:10.488Z"), "to" : { "id" : ObjectId("54bf1dc6c65b030c00faec0d"), "name" : "John Smith" }, "from" : { "id" : ObjectId("54bf1e1ceb5bf8800b0f5a8c"), "name" : "Martin Fowler" }, } { "text" : "Another message to John", "created" : ISODate("2015-01-30T00:37:38.106Z"), "to" : { "id" : ObjectId("54bf1dc6c65b030c00faec0d"), "name" : "John Smith" }, "from" : { "id" : ObjectId("54bf1e1ceb5bf8800b0f5a8c"), "name" : "Martin fowler" }, } ] }, { "id":"54bf1e80eb5bf8800b0f5a8d", "name":"John Smith",…
favorite count: 0
accepted answer: http://stackoverflow.com/a/28316952
tagged with: node.js
linked to: http://stackoverflow.com/q/26725658
upvote count: 1
has answer: http://stackoverflow.com/a/28316952
possible better answer: http://stackoverflow.com/a/28315041
type: AnsweredQuestion
tagged with: underscore.js
score: 1
type: Question
tagged with: mongodb
answer count: 2
has title: Mongo query and response 'GroupBy' implementation using Mongoose and/or underscore.js
downvote count: 0
tagged with: mongoose

http://stackoverflow.com/q/28347374
score: 1
has title: d3.js replacing random() data function with asynchronous function
has body: I'm trying to adapt Mike Bostock's swimlane calendar http://bl.ocks.org/bunkat/1962173 and replace the random data generation function with a JSON file. d3.json("random.json", function(data) { // console.log(d3.entries(data)); //var data = randomData() var lanes = data.lanes; var items = data.items; var now = new Date(); ..... }); where the data file looks like the output of the random() function: {"lanes":[{"id":0,"label":"lane 0"},{"id":1,"label":"lane 1"},{"id":2,"label":"lane 2"},{"id":3,"label":"lane 3"},{"id":4,"label":"lane 4"}],"items":[{"id":0,"lane":0,"start":"2012-01-21T18:00:00.000Z","end":"2012-01-26T21:00:00.000Z","class":"past","desc":"This is a description."},{"id":1,"lane":0,"start":"2012-01-28T18:00:00.000Z","end":"2012-02-02T21:00:00.000Z","class":"past","desc":"This is a description."},{"id":2,"lane":0,"start":"2012-02-05T13:00:00.000Z","end":"2012-02-10T18:00:00.000Z","class":"past","desc":"This is a description."},{"id":3,"lane":0,"start":"2012-02-13T15:00:00.000Z","end":"2012-02-15T13:00:00.000Z","class":"past","desc":"This is a description."},{"id":4,"lane":0,"start":"2012-02-17T16:00:00.000Z","end":"2012-02-22T13:00:00.000Z","class":"past","desc":"This is a description."},{"id":5,"lane":0,"start":"2012-02-23T13:00:00.000Z","end":"2012-02-23T21:00:00.000Z","class":"past","desc":"This is a description."},{"id":6,"lane":0,"start":"2012-02-24T18:00:00.000Z","end":"2012-03-01T14:00:00.000Z","class":"past","desc":"This is a description."} the error I get is: TypeError: n.getFullYear is not a function
possible better answer: http://stackoverflow.com/a/28348874
answer count: 2
has answer: http://stackoverflow.com/a/28348874
accepted answer: http://stackoverflow.com/a/28364261
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: asynchronous
type: AnsweredQuestion
tagged with: d3.js
has answer: http://stackoverflow.com/a/28364261
upvote count: 1
type: Question

http://stackoverflow.com/comment/45146992
comment on: http://stackoverflow.com/q/28405541
has text: You didn't answer my question. What if the window changes size after the fact? Why are you trying to do this? It sounds like an [XY Problem](http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem).
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44930033
comment on: http://stackoverflow.com/q/28287906
type: Comment
type: QuestionComment
has text: your `controllers` should be an empty object since you don't `require: ` any. Even if it was, it would be an object (or an array of objects), not a function to be invoked
score: 0

http://stackoverflow.com/comment/45033352
type: QuestionComment
has text: Do you have other function which can close dialog ?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28344430

http://stackoverflow.com/q/28399311
tagged with: http://stackoverflow.com/tag/xml
has body: In Titanium Alloy I have made a Picker that consists of 'rows'. Users can select one of these rows and click a button to continue to the next window. What I want is that the button sends the user to the right window depending on the selected row in the picker. My code is as follows: Alloy: &lt;Alloy&gt; &lt;Window&gt; &lt;Picker id="picker"&gt; &lt;Column id="rows"&gt; &lt;Row title="Row1" /&gt; &lt;Row title="Row2" /&gt; &lt;Row title="Row3" /&gt; &lt;Row title="Row4" /&gt; &lt;/Column&gt; &lt;/Picker&gt; &lt;Button id="button" title="Confirm" bottom="10%" width="115" height="50" /&gt; &lt;/Window&gt; &lt;/Alloy&gt; JavaScript/jQuery: $.picker.addEventListener('change',function(e) { var selectedrow = e.rowIndex; // e.rowIndex determines row number }); $.button.addEventListener('click',function(e) { if(selectedrow = "3") { $.tabs.open(); } else { $.tabs2.open(); } }); The problem is that every selection sends the user to the same new window, like the else-statement is being ignored. How can I fix this?
type: UnansweredQuestion
tagged with: titanium
tagged with: titanium-alloy
has answer: http://stackoverflow.com/a/28403436
has answer: http://stackoverflow.com/a/28462188
type: Question
answer count: 2
has title: Get selected row from Picker in Titanium Alloy
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/comment/45162547
type: AnswerComment
has text: @somethinghere - Thank you very much for the great answer, coupled with exquisite pedagogical information. I hope good intentions of people like you keep bubbling up. --- But, then, might I ask: why do you have `highlighted` at 1 instance, whereas all other classes in your code use `higlight`?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28412828

http://stackoverflow.com/comment/45119310
type: AnswerComment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/70504/discussion-between-thefourtheye-and-jsbisht).
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28390818

http://stackoverflow.com/comment/45053634
has text: Oh, I see what you mean. I did assume there was more than one.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28354884
type: AnswerComment

http://stackoverflow.com/comment/51815595
type: Comment
type: QuestionComment
has text: raix:handlebar-helpers serves a similar purpose
comment on: http://stackoverflow.com/q/28369798
score: 0

http://stackoverflow.com/comment/121019809
type: Comment
has text: Thanks for your response. Maybe you find useful to use `customRegex.test(termToMatch)` It returns true if there are coincidences, false if not.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28280976

http://stackoverflow.com/comment/47887842
has text: @SinuVarghese Try what Aaron said, it worked for a hybrid app for me.
comment on: http://stackoverflow.com/a/28544639
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/comment/44915079
comment on: http://stackoverflow.com/q/28280334
has text: You need to bind the onload event for the reader, e.g: http://jsfiddle.net/dcxegcco/
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28311658
has answer: http://stackoverflow.com/a/28311817
accepted answer: http://stackoverflow.com/a/28311817
has comment: http://stackoverflow.com/comment/44973991
tagged with: nan
type: AnsweredQuestion
downvote count: 1
type: Question
score: -1
tagged with: function
upvote count: 0
has title: What am I getting NaN with my fucntion?
answer count: 1
has body: The following 'find' selectors is getting a value NaN if the value contained alphabetical characters: form.find('input[name="product_name"]').val(); //results in NaN if alphabets Code: &lt;script type="text/javascript"&gt; $("document").ready(function(){ $('.add_to_cart').click(function() { var form = $(this).closest('form'); var product_id = form.find('input[name="product_id"]').val(); var product_price = form.find('input[name="product_price"]').val(); var product_name = form.find('input[name="product_name"]').val(); //Alphanumeric value var product_qty = form.find('input[name="product_qty"]').val(); var data = { "action": "AddItem", "product_id": +product_id, "product_price": +product_price, "product_name": +product_name, "product_qty": +product_qty, }; $.ajax({ type: 'POST', dataType: "html", url: "cart_array.php", data: data, success: function(data) { $("#cart_total").html(data); } }); return false; }); }); &lt;/script&gt;
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/a/28386874
score: 0
has comment: http://stackoverflow.com/comment/62335697
type: Answer
has body: To define a isolate scope, just put '@' into scope definition and use the atribute name in your directive. .directive('ggThumbnail', function() { return { restrict: 'E', scope: { thumbnailSrc: '@', thumbnailWidth: '@', thumbnailHeight: '@' }, link: function(scope, element, attrs, ctrl) { ctrl.init(element); attrs.$observe('thumbnailSrc', function() { if (attrs.thumbnailSrc) { ctrl.prepareImage(); } }); } }; });
answers question: http://stackoverflow.com/q/28386753

http://stackoverflow.com/comment/45072051
comment on: http://stackoverflow.com/q/28365391
score: 0
type: Comment
type: QuestionComment
has text: Is the JS file loaded ? Can you check from browser...

security
tags question: http://stackoverflow.com/q/28417831
tags question: http://stackoverflow.com/q/28280950
tags question: http://stackoverflow.com/q/28352160
tags question: http://stackoverflow.com/q/28348587
tags question: http://stackoverflow.com/q/28379806
tags question: http://stackoverflow.com/q/28284765
type: Tag
tags question: http://stackoverflow.com/q/28301617
tag name: security

http://stackoverflow.com/a/28352638
type: Answer
has comment: http://stackoverflow.com/comment/45049463
has comment: http://stackoverflow.com/comment/45112296
has comment: http://stackoverflow.com/comment/45049391
has comment: http://stackoverflow.com/comment/45051096
answers question: http://stackoverflow.com/q/28352512
has comment: http://stackoverflow.com/comment/45049164
has body: Where your comment is I think you need to add something like this: expect(Provider.SSN()).toBe(/*whatever you expect it to be*/);
score: 0
has comment: http://stackoverflow.com/comment/45058600

http://stackoverflow.com/q/28287870
has body: I've got a little problem with filtering. I make a few buttons: Advertising Branding Packaging Print And I've got array of course: $scope.selects = [ {terms: 'Advertising | Web',}, {terms: 'Branding | Packaging',}, {terms: 'Print | Video',}, {terms: 'Branding | Print',} ]; So as You can see I've got few terms in one key. I know that I can use search box to filter, and it'll works fine. But I've to use buttons for this. This method: Works only if I use same string as It is in array, but I need to filter items with similar to them. I tried to create hidden input, then send button id to input value, but then I need to do any change in this input to run filter. Rest of code: {{ select.name }} {{ select.terms }} More Details <dir-pagination-controls boundary-links="true" on-page-change="pageChangeHandler(newPageNumber)" template-url="<?php echo get_template_directory_uri(); ?>/templates/pagination.tpl.html"></dir-pagination-controls> So.. My question is how to filter this terms using part of array key string? Grettings, W
score: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44930808
has comment: http://stackoverflow.com/comment/44931587
has comment: http://stackoverflow.com/comment/44929853
has title: Angular filter contain
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28289195
tagged with: angularjs
type: Question
accepted answer: http://stackoverflow.com/a/28289195
has comment: http://stackoverflow.com/comment/44930448

http://stackoverflow.com/a/28302506
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28302469
answers question: http://stackoverflow.com/q/28302469
type: Answer
upvote count: 1
score: 1
has body: You need to clone() once per iteration, so put that line within the for: var values = [12,11,15]; $('td.to').empty(); for (var i = 0; i &lt; values.length; i++){ var cloned = $('div.from').find('label').clone(); cloned.find('input').val(values[i]); $('td.to').append(cloned); }
type: AcceptedAnswer

http://stackoverflow.com/q/28376617
upvote count: 2
has answer: http://stackoverflow.com/a/28474732
has body: How i could bind Spring DATA REST which outputs HAL, with ExtJS (v4.1) client, ExtJS do not have support for HAL, but how i could integrate libraries like Hyperagent.js or any JS library supporting HAL, with Extjs data model, to link Stores with the server through HAL. Whats are the pros and cons of a such architecture ?
type: AnsweredQuestion
score: 1
has title: Integrate Extjs with HAL
downvote count: 1
has comment: http://stackoverflow.com/comment/45236729
type: Question
accepted answer: http://stackoverflow.com/a/28474732
tagged with: javascript
tagged with: extjs
tagged with: spring-data-rest
answer count: 1
favorite count: 0
tagged with: backbone.js
tagged with: rest

http://stackoverflow.com/comment/45103200
has text: A simple ajax call isn't going to rerender the page. If you want to change the language of a rendered page you need to search and replace all items with the new language strings.
comment on: http://stackoverflow.com/q/28382221
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/28332164
has body: In my experience, simply calling remove() and unbind()/off() is enough to prevent "zombies" hanging around. The only thing I would add is that if the parent view (the one that contains the subviews inside of this._views) is being referenced from another part of your application, then you have to make sure that you remove those references by simply assigning those variables to null. It is totally fine to have a this._views array inside of the parent to save its subviews in. However, as your application grows you might want to create some sort of Subview Manager and a Core View that all other views inherit from. Here is what I've done in the past; I hope it helps: CoreView: // Probably all views should inherit from CoreView. define([ 'jquery', 'backbone', 'subviews' ], function($, Backbone, Subviews) { var CoreView = Backbone.View.extend({ $main: $('#main'), // Create an empty `subviews` property on all views. constructor: function() { this.subviews = new Subviews(this); // Since we're overriding `constructor` here, // we need to delegate to Backbone Backbone.View.prototype.constructor.apply(this, arguments); }, // Views should be attached to the DOM only with the `attach` method to have the right events thrown. // Attach the view's element only if it's not already in the DOM. attach: function() { if (!this.isAttached()) { this.$main.append(this.el); this.trigger('dom:attach'); } return this; }, isAttached: function() { return $.contains(document.body, this.el); }, // Remove each view's subviews and clean up various properties before // calling Backbone's remove() method. remove: function() { if (this.subviews.size()) { this.subviews.removeAll(); } // Remove the DOM element (jQuery makes sure to clean up DOM element's data) Backbone.View.prototype.remove.apply(this, arguments); // Fire a helpful `dom:detach` event when the view is removed from the DOM. this.trigger('dom:detach'); this.off(); return this; } }); return CoreView; }); Subview Manager (not complete): // Si…
accepted answer of: http://stackoverflow.com/q/28331215
upvote count: 1
answers question: http://stackoverflow.com/q/28331215
score: 1
has comment: http://stackoverflow.com/comment/45023146
has comment: http://stackoverflow.com/comment/45051678
has comment: http://stackoverflow.com/comment/45025171
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45061687
has comment: http://stackoverflow.com/comment/45032575
type: Answer

http://stackoverflow.com/comment/45014572
has text: sidenote: I'm not very familiar with `broccoli`, but it looks like `gulp` could replace it as an asset builder? I use `gulp` to minify/uglify/concat/rename, etc for my assets.
comment on: http://stackoverflow.com/a/28333803
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28413038
accepted answer of: http://stackoverflow.com/q/28412964
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28412964
type: Answer
score: 2
has body: when you attach the click handler it's possible that your anchor doesn't exist, try using this: $(function (){ $(document.body).on('click', 'a.folder', function() { // code goes here ... }); }); using this event delegation the click event will fire even if your anchor created dynamically after this code.
downvote count: 0
has comment: http://stackoverflow.com/comment/112543687
has comment: http://stackoverflow.com/comment/45159884
upvote count: 2

http://stackoverflow.com/comment/45203378
has text: Can you provide a sample of the string in the `href` variable?
score: 0
comment on: http://stackoverflow.com/q/28436535
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29936522
score: 0
type: Answer
has body: For back-end you can use ASP.NET Web-API which supports ASP.NET Identity with OAuth login like Facebook, Twitter etc. and on front-end you can you use IonicFramework with AngularJs to call those API. Helpful resources: ASP.NET IonicFramework AngularJS Restangular (Restful operations made easy for angular)
answers question: http://stackoverflow.com/q/28414595

http://stackoverflow.com/comment/45190494
comment on: http://stackoverflow.com/a/28429700
type: Comment
score: 0
has text: This code is replacing each value but I need each button value in textarea on click according to the cursor's postion
type: AnswerComment

http://stackoverflow.com/q/28391458
has comment: http://stackoverflow.com/comment/45121627
tagged with: javascript
has body: I want to send php variable value to JavaScript popup window. My JavaScript popup Code and PHP code is in the same page. Within this same page, I want to call JavaScript popup with PHP variable value. So basically I have 2 different PHP variable values in a form of 2 buttons, user can click any button and I want only 1 popup window appears based on the PHP variable value. Here is what I am doing in code: Hire Person Hire <?php echo $array_other_new[1] ?> But my Popup is not appearing if I do something like this href="#login?h_id=123" as shown above. My Popup only appears when it calls like href="#login" without any ?id=123. Now here is my Bootstrap based popup Code: × LogIn <input type="hidden" id="get_hire_id" value="<?php echo $get_id ?>"> Email * Password * Not Registered Yet ? Sign Up Now Cancel Please propose any working solution.
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/45120226
score: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/28392831
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45120318
tagged with: php
has title: Send PHP variable value to JavaScript popup window in same page
tagged with: css
has comment: http://stackoverflow.com/comment/45120201
has comment: http://stackoverflow.com/comment/45120329
linked to: http://stackoverflow.com/q/23740548
upvote count: 1
accepted answer: http://stackoverflow.com/a/28392831
has comment: http://stackoverflow.com/comment/45120300
answer count: 1
has comment: http://stackoverflow.com/comment/45120139

http://stackoverflow.com/comment/136747292
score: 0
type: Comment
has text: @PiyushRaj Seems you are using Beego V2 and the answer is for Beego v1
comment on: http://stackoverflow.com/a/48098559
type: AnswerComment

http://stackoverflow.com/comment/45034562
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28324695
type: Comment
has text: this one ` ` @manjunathH

http://stackoverflow.com/comment/45093561
has text: The function goes to that file first. What is in the file is it the commented code?
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28376477

http://stackoverflow.com/comment/130269076
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28354808
type: AnswerComment
has text: what if dere is a record multiple times in the original array? how to get unique only

http://stackoverflow.com/comment/45051203
score: 0
has text: Check out your Dev Tools. You're still getting dependency errors. "Uncaught Error: [$injector:modulerr] Failed to instantiate module AuthApp due to: Error: [$injector:nomod] Module 'AuthApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument."
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28351958

http://stackoverflow.com/q/28286899
type: Question
answer count: 2
has body: I want to query some data from the database, from a for loop. The problem is, the query is processed after the end of the loop. This code: ret = []; first = rows[0]; first.device_firsttime = first.device_lasttime; first.alerts = []; for(var i = 0; i &lt; 5; i++) { console.log("!"+i); (function(i) { query("SELECT EXTRACT('epoch' FROM alert_time)::integer alert_time, alert_id, alert_lat, alert_lon, alert_str, alert_cc, alert_distance FROM blitz_device_former_alerts WHERE alert_locid = $1", [first.device_locid], function(error_a,rows_a,result_a) { console.log(i+"!"); ret.push(i); }); })(i); } console.log("-END---"+JSON.stringify(ret)); ret.push(first); res.end(JSON.stringify(ret)); Writing this to the console: !0 !1 !2 !3 !4 -END---[] POST /userlogs 200 140.110 ms - - 0! 1! 2! 3! 4! The correct output should be !0 0! !1 1! !2 2! !3 3! !4 4! -END---[0,1,2,3,4] POST /userlogs 200 xxx.xxx ms - -
tagged with: javascript
has title: Node.JS: Asyncronous Postgres query in for loop
possible better answer: http://stackoverflow.com/a/28287242
tagged with: asynchronous
has answer: http://stackoverflow.com/a/28287242
has answer: http://stackoverflow.com/a/28287227
tagged with: node.js
type: AnsweredQuestion
score: 0
tagged with: loops
accepted answer: http://stackoverflow.com/a/28287227

http://stackoverflow.com/q/28387256
tagged with: datatables
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/28496640
has comment: http://stackoverflow.com/comment/45295605
type: UnansweredQuestion
tagged with: legacy-code
has body: I am working on a legacy code. Right we are using DataTable 1.8.0. It seems like this version is not supporting aoServerParams. I have also tried "fnServerData": function ( sSource, aoData, fnCallback ) { aoData.push( { "name": "data1", "value": $("#data1").val() } ); aoData.push( { "name": "data2", "value": $("#data2").val() } ); $.getJSON( sSource, aoData, function (json) { fnCallback(json); } ) But it doesn't work. Can someone please help. NOTE: I have to make a POST request.
has title: Datatable 1.8.0 adding server parameter doesnt work
type: Question
has comment: http://stackoverflow.com/comment/45148857
tagged with: javascript
score: 0

http://stackoverflow.com/q/28336810
score: 0
accepted answer: http://stackoverflow.com/a/28337190
type: AnsweredQuestion
has body: I have a function that uses .slidetoggle to collapse 2 paragraphs, and create a div to "expand". The code is working correctly but I am trying to optimize it to where I don't need to construct the query each time. any suggestions?
has title: Need query to be constructed only once
type: Question
has answer: http://stackoverflow.com/a/28336864
answer count: 2
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28336864
has answer: http://stackoverflow.com/a/28337190

ember-cli
tags question: http://stackoverflow.com/q/28288445
tags question: http://stackoverflow.com/q/28295582
tag name: ember-cli
type: Tag
tags question: http://stackoverflow.com/q/28375282

http://stackoverflow.com/q/28290460
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28940681
favorite count: 0
has comment: http://stackoverflow.com/comment/44937889
upvote count: 3
answer count: 1
has body: I am attempting to use the HTML5 validity check to determine whether the field contents are indeed valid. I have a textbox field that I have set to type "number". Reason for setting to "number" is to display the numeric keyboard on touch devices when the field gets focus. However, I am finding that in Internet Explorer (both IE10 and IE11) the validity check always returns true regardless of whether I have a number or a letter in the field. Basically what I wish to achieve is to be able to use the validity check to then call my own custom validation (we have a custom error bubble that needs to appear, cannot just use the browser out of the box error bubble). Here is a JSFiddle example. http://jsfiddle.net/1samnzoo/16/ HTML5 Form Validation Tester Result: var numberField = document.getElementById("numberField"); var r = document.getElementById("result"); numberField.addEventListener("input", function() { var value = numberField.value; r.innerHTML = " value=" + value + ", " + " checkValidity()=" + numberField.checkValidity() + ", " + " validity.valid=" + numberField.validity.valid; }); The behavior in each browser is as follows: Chrome: Enter a number '1' Number placed into the textbox. Getting the "value" in Javascript returns "1" Validity check returns true Enter invalid character 'a'. Character is placed into the textbox, now shows '1a'. Getting the "value" in Javascript returns "". Validity check returns false Tab away from the field, contents remain in the textbox. Firefox: Same as Chrome IE: Now IE has some very different behavior. Example 1 Enter a number '1' Number placed into the textbox. Getting the "value" in Javascript returns "1" Validity check returns true Enter invalid character 'a'. Character is placed into the textbox, now shows '1a'. Getting the "value" in Javascript returns "1a". Validity check returns true Tab away from the field, contents remain in the textbox. Example 2 Enter invalid character 'a'. Character is placed into the textbox Getting the…
has comment: http://stackoverflow.com/comment/45909954
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46002711
has comment: http://stackoverflow.com/comment/44967566
downvote count: 0
tagged with: javascript
has title: HTML5 validity check always returns true in IE
type: Question
score: 3

http://stackoverflow.com/a/28433892
upvote count: 3
has body: I would still suggest you put that file through bundling, advantages you get: It will get minified for production Should you add more javascript files later, it will be just a matter of adding those to a bundle, without ever making changes to your HTML template
type: Answer
downvote count: 0
score: 3
answers question: http://stackoverflow.com/q/28433851
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28433851

http://stackoverflow.com/a/28333651
type: Answer
accepted answer of: http://stackoverflow.com/q/28286185
answers question: http://stackoverflow.com/q/28286185
score: 1
upvote count: 1
has body: Yes, according to the documentation, that's a possibility. Off that same page... (make sure you return the stream from your tasks to ensure the browser is reloaded at the correct time) If it's an async task it will just fire and not return anything, and the watcher will not know to refresh. Or it may reload before the process is done. To get around this, you should be adding callbacks to your tasks. gulp.task('somename', function() { var stream = gulp.src('client/**/*.js') .pipe(minify()) .pipe(gulp.dest('build')); return stream; }); Just return the stream so Gulp knows what is up. Then set the watch for the task you want: gulp.task('default', ['browser-sync'], function () { // Watched tasks are run in parallel, not in series. gulp.watch(['*.js'], ['somename', browserSync.reload]); }); This is all included in the documentation: https://github.com/gulpjs/gulp/blob/master/docs/API.md#async-task-support
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/44947963
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28296427
has text: added some code on top. old_pageid is simply fetched from current page with class page-show. pageid is send along with the function call containing the code above. both pageid are correctly set, tested that part already. as i said, it works, once i add ".delay( 200)" between .one and .removeClass at the very last line.
score: 0

http://stackoverflow.com/q/28409664
score: 0
has answer: http://stackoverflow.com/a/28409899
has answer: http://stackoverflow.com/a/28410782
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/28409899
tagged with: javascript
tagged with: ajax
has body: First off, here's my code: HTML ("formdata-index-test.html"): Test page JS ("formdata-fields-control-test.js"): var form = document.getElementById("the-form"); form.onsubmit = function() { var q = document.getElementById("the-text").value; var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function() { if ((xhr.readyState == 4) && (xhr.status == 200)) { alert(xhr.responseText); } } xhr.open("POST", "formdata-validation-test.php", false); xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); xhr.send("q="+q); } PHP ("formdata-validation-test.php"): <?php $example = $_POST['q']; echo $example; if (empty($example)) { echo "Empty"; } ?> Now, at the beginning, I wasn't getting anything as response, but after a few tries and changes in my code, I'm being able to receive that alert in the JS file. The weird thing is that, even receiving the alert, I'm still getting the "Empty" echo when the PHP page is loaded after the form submission. Does anyone know why is it happening? My final goal is just to send the text from the HTML file to the PHP file, and then to database (that is, the "responseText" is not really necessary, and it's here just with test purposes), but apparently, PHP is not really receiving what JS sends, while JS receives what PHP sends. Does it make any sense?
has title: Unable to receive something in PHP from XMLHttpRequest's "POST"
tagged with: php
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28410782

http://stackoverflow.com/comment/45141248
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28402519
type: Comment
has text: Well, everything i posted came out from personal experiments. You better start implementing stuff, and look for the solutions you face while doing the same. You can always post a question in case of any issues..

http://stackoverflow.com/comment/45056480
type: QuestionComment
comment on: http://stackoverflow.com/q/28356531
score: 0
type: Comment
has text: can you inspect element and check they are being wrapped in ` ` tags.

http://stackoverflow.com/comment/45083640
comment on: http://stackoverflow.com/a/28371345
score: 0
type: Comment
has text: You can also try setting the z-index to really low to hide it under the current page. `$("#webcam").css('z-index', -3000);`
type: AnswerComment

node.js
tags question: http://stackoverflow.com/q/28363847
tags question: http://stackoverflow.com/q/28283590
tags question: http://stackoverflow.com/q/28382367
tags question: http://stackoverflow.com/q/28356623
tags question: http://stackoverflow.com/q/28399265
tags question: http://stackoverflow.com/q/28359243
tags question: http://stackoverflow.com/q/28286073
tags question: http://stackoverflow.com/q/28362909
tags question: http://stackoverflow.com/q/28418136
tags question: http://stackoverflow.com/q/28407372
tags question: http://stackoverflow.com/q/28312229
tags question: http://stackoverflow.com/q/28404019
tags question: http://stackoverflow.com/q/28333347
tags question: http://stackoverflow.com/q/28374889
tags question: http://stackoverflow.com/q/28391814
tags question: http://stackoverflow.com/q/28337372
tags question: http://stackoverflow.com/q/28376058
tags question: http://stackoverflow.com/q/28351813
tags question: http://stackoverflow.com/q/28330574
tags question: http://stackoverflow.com/q/28399838
tags question: http://stackoverflow.com/q/28381218
tags question: http://stackoverflow.com/q/28371561
tags question: http://stackoverflow.com/q/28312041
tags question: http://stackoverflow.com/q/28415318
tags question: http://stackoverflow.com/q/28340833
tags question: http://stackoverflow.com/q/28336601
tags question: http://stackoverflow.com/q/28393674
tags question: http://stackoverflow.com/q/28310418
tags question: http://stackoverflow.com/q/28284624
tags question: http://stackoverflow.com/q/28324651
tags question: http://stackoverflow.com/q/28309014
tags question: http://stackoverflow.com/q/28395681
tags question: http://stackoverflow.com/q/28359128
tags question: http://stackoverflow.com/q/28287253
tags question: http://stackoverflow.com/q/28389684
tags question: http://stackoverflow.com/q/28287943
tags question: http://stackoverflow.com/q/28413820
tags question: http://stackoverflow.com/q/28286899
tags question: http://stackoverflow.com/q/28354709
tags question: http://stackoverflow.com/q/28310767
tags question: http://stackoverflow.com/q/28291747
tags question: http://stackoverflow.com/q/28430276
tags question: http://stackoverflow.com/q/28321015
tags question: http://stackoverflow.com/q/28336424
tags question: http://stackoverflow.com/q/28314936
tags question: http://stackoverflow.com/q/28329175
tags question: http://stackoverflow.com/q/28419269
tags question: http://stackoverflow.com/q/28396830
tags question: http://stackoverflow.com/q/28366199
tags question: http://stackoverflow.com/q/28421799
tags question: http://stackoverflow.com/q/28358424
tags question: http://stackoverflow.com/q/28375998
tags question: http://stackoverflow.com/q/28421400
tags question: http://stackoverflow.com/q/28280338
tags question: http://stackoverflow.com/q/28350098
tags question: http://stackoverflow.com/q/28366718
tags question: http://stackoverflow.com/q/28413209
tags question: http://stackoverflow.com/q/28349548
tags question: http://stackoverflow.com/q/28306740
tags question: http://stackoverflow.com/q/28401465
tags question: http://stackoverflow.com/q/28322803
tags question: http://stackoverflow.com/q/28365433
tags question: http://stackoverflow.com/q/28366798
tags question: http://stackoverflow.com/q/28387775
tags question: http://stackoverflow.com/q/28344272
tags question: http://stackoverflow.com/q/28388369
tags question: http://stackoverflow.com/q/28402595
tags question: http://stackoverflow.com/q/28335245
tags question: http://stackoverflow.com/q/28294515
tags question: http://stackoverflow.com/q/28328830
tags question: http://stackoverflow.com/q/28391482
tags question: http://stackoverflow.com/q/28331378
tags question: http://stackoverflow.com/q/28389953
tags question: http://stackoverflow.com/q/28343951
tags question: http://stackoverflow.com/q/28351168
tags question: http://stackoverflow.com/q/28326921
tags question: http://stackoverflow.com/q/28373838
tags question: http://stackoverflow.com/q/28316907
tags question: http://stackoverflow.com/q/28409377
tags question: http://stackoverflow.com/q/28370994

http://stackoverflow.com/comment/45035681
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28345336
has text: point taken - i've opened a secondary question - http://stackoverflow.com/questions/28345745/google-maps-map-reload

http://stackoverflow.com/comment/45170704
type: Comment
has text: In a lot of cases this error seems to be caused by the browser cache. Are you doing anything with template caching in any other parts of your code? For example using `$templateCache` to pre-load templates can get this result if the template isn't being loaded for any reason.
type: QuestionComment
comment on: http://stackoverflow.com/q/28416551
score: 0

http://stackoverflow.com/comment/44921659
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28283731
has text: I mean to use common class on click handler not inside its....like `#abilities-scroll` should be replaced with common class...
type: Comment

http://stackoverflow.com/a/31443211
answers question: http://stackoverflow.com/q/28357808
score: 0
has body: Here is what i just wrote really quick. It may help you. But you can just do some basic math to get your conversions and handle the remainder. Like so: function countDown(future_date_in_millis) { var date = new Date(); var current_time = date.getTime(); //get the future date and time var future_date = future_date_in_millis.getTime(); //1438077258047; //date.getTime(); // get the duration in milliseconds // 1 day = 86400000 millis var duration = future_date - current_time; var dd = Math.floor(duration / 86400000); var remainder = duration % 86400000; var hh = Math.floor(remainder / 3600000); remainder = remainder % 3600000; var mm = Math.floor(remainder / 60000); remainder = remainder % 60000; var ss = Math.floor(remainder / 1000); var days = document.getElementById("dd"); var hours = document.getElementById("hh"); var minutes = document.getElementById("mm"); var seconds = document.getElementById("ss"); days.innerHTML = dd.toString(); hours.innerHTML = hh.toString(); minutes.innerHTML = mm.toString(); seconds.innerHTML = ss.toString(); } window.setInterval(function () { /// call your function here var d = new Date("July 15, 2015 4:52:00 PM"); countDown(d); }, 1000);
type: Answer

http://stackoverflow.com/a/28435747
upvote count: 2
downvote count: 1
has comment: http://stackoverflow.com/comment/45700311
has comment: http://stackoverflow.com/comment/45583236
type: Answer
has comment: http://stackoverflow.com/comment/45241788
has body: The only thing I have found is telling your webserver to send a refresh parameter with a value of, say, 5 seconds. I have not had the time to test this though.
score: 1
answers question: http://stackoverflow.com/q/28379253
has comment: http://stackoverflow.com/comment/45215579
has comment: http://stackoverflow.com/comment/45229230
has comment: http://stackoverflow.com/comment/45207544

http://stackoverflow.com/comment/45126329
comment on: http://stackoverflow.com/q/28394949
score: 1
has text: Just call method `textAreaAdjust(document.getElementById('text'));` from `click1()` method once value set
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28371657
has comment: http://stackoverflow.com/comment/45083899
type: Question
has comment: http://stackoverflow.com/comment/45084064
has comment: http://stackoverflow.com/comment/45083906
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45083888
has comment: http://stackoverflow.com/comment/45084375
has comment: http://stackoverflow.com/comment/45084255
score: 0
has comment: http://stackoverflow.com/comment/45084024
has comment: http://stackoverflow.com/comment/45085296
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45090847
tagged with: events
has comment: http://stackoverflow.com/comment/45085642
has body: I'm trying to make a jquery mouse event apply on another html page not using php. Is it possible ? I have for example that: Page 1: element 1 element 2 and the Jquery : $("#e1").hover(function(){ show.("#o1"); }); $("#e2").hover(function(){ show.("#o2"); }); page 2 : object 1 object 2 Thanxxx
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45117738
has title: How one javascript event can apply on one different html page
has comment: http://stackoverflow.com/comment/45088774
answer count: 0

http://stackoverflow.com/comment/45102889
comment on: http://stackoverflow.com/a/28381992
has text: @kushdilip, Not quite, The first and main problem was the submitting of the form. Secondly the `diff` function wasn't working what I already found out. I was looking into `moment.js` and was updating my question with the complete and correct code.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/28407551
upvote count: 1
answers question: http://stackoverflow.com/q/28406978
score: 1
downvote count: 0
has body: --> setTimeout(callbackFunction[, interval]) This can be understand as you are going to call a function with the specified name(Given by you) after an specified time. --> You cannot do like this setTimeOut(1000); because 1000 will be treated as callback function As the first parameter of setTimeout() is callback function. You cannot define a function like function 1000() { // Code Resides here. } because java script does not allow these type of function names. --> You can pass anonymous function to setTimeout() like setTimeout(function() { // Code resides here. }[, interval]); The above function code will be executed after the given interval. If no interval is given then it will executed immediately. Note:- Parameters given in square brackets ([, ]) are optional to pass. --> You can refer the below mentioned thread for your use: JavaScript sleep/wait before continuing As this thread contains a function definition which works like sleep() in other languages.
type: Answer

http://stackoverflow.com/q/28422312
score: 1
upvote count: 1
type: Question
tagged with: javascript
has title: Custom API in Azure
has body: I have a table of temperatures and dates in Azure. I have a client Windows 8 App. I was wondering how do I pass a date argument from the app into a custom API in Azure. For example, if the user has selected the 4th July in the app - the date is passed into a custom API in Azure, pulling out the temperatures for that date.
tagged with: azure
downvote count: 0
tagged with: azure-api-management
tagged with: .net
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/96120093
has comment: http://stackoverflow.com/comment/45177906
has comment: http://stackoverflow.com/comment/45220582
has comment: http://stackoverflow.com/comment/45177775
answer count: 0

http://stackoverflow.com/q/28336581
tagged with: css
has comment: http://stackoverflow.com/comment/45019226
has answer: http://stackoverflow.com/a/28336604
has comment: http://stackoverflow.com/comment/45019212
linked to: http://stackoverflow.com/q/826782
tagged with: twitter-bootstrap
type: UnansweredQuestion
downvote count: 2
upvote count: 1
has title: How to avoid this with CSS?
duplicate of: http://stackoverflow.com/q/826782
type: Question
score: -1
has body: I have a table, and in the first td I have a glyphicon: I added a onclick event on it, which will toggle the class, but when I do: As you can see, I can accidentally "select" extra areas. That looks really bad. Is there any suggestion on it?
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/28336613
favorite count: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/45130940
score: 0
type: Comment
has text: I'm not familiar with ajax at all, could you give me an example on how I would use it in this situation?
comment on: http://stackoverflow.com/a/28397392
type: AnswerComment

http://stackoverflow.com/a/47295346
has body: Alternate method to innerHTML if(document.getElementById("element_id").lastChild) { //Has content } else { //No content }
type: Answer
answers question: http://stackoverflow.com/q/28327989
score: 0

http://stackoverflow.com/a/28301692
score: 0
type: Answer
has body: group.users is an array of rows - not a model you can call methods on. If you want to filter the users you should use Array.filter and do the filtering in plain javascript
answers question: http://stackoverflow.com/q/28291747

http://stackoverflow.com/comment/45055490
has text: I'm voting to close this question as off-topic because the OP, in the comments, said he'd already solved the problem.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28353979
type: Comment

http://stackoverflow.com/q/28294696
has answer: http://stackoverflow.com/a/28295604
favorite count: 0
type: AnsweredQuestion
has body: I am building a Login page in meteor. It has a facebook login button, gmail login button and linkedin login button. Then I have a Meteor's default login form. Everything is fine so far. The only challenge is, I need to put all these social networking login buttons below my Meteor's default login form. How would I do that? Thanks and regards.
accepted answer: http://stackoverflow.com/a/28295604
upvote count: 1
tagged with: meteor-accounts
has title: Customizing LoginButtons in meteor
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
score: 1
tagged with: meteorite
tagged with: meteor
tagged with: meteor-blaze

http://stackoverflow.com/q/28356862
has body: I'm quite confused about this pattern in React. I have seen it in other places it but it does not seem correct. Given the below code: /** @jsx React.DOM */ var React = window.React = require('react'), Item = require("./ui/Item"); var ItemApp = React.createClass({ getInitialState: function() { return { items: [ "Example Item" ] // we want one thing to render initially }; // so prepopulate with one thing }, getDefaultProps: function () { return { index: 1 } }, onAddItem: function (e) { var debts = this.state.debts.push( "New Item " + this.props.index); this.setState({ items: this.state.items }); this.props.index++; }, onRemoveItem: function (i) { // splice here this.state.items.splice(i, 1); this.setState({ items: this.state.items }); this.props.index--; }, render: function () { var items = this.state.items; var closeFn = this.onRemoveItem; return ( Add New Debt {items.map(function (item, i) { return <Item name={item} closeFn={closeFn.bind(null, i)} key={i} />; })} ); } }); The example above works like intended (it's a list and you can add and remove things at will) however whenever I add something renders the whole thing over again. So after only adding one component the whole thing has rendered 3 times. After clicking twice it will have rendered 5 times. You can see why this might be a problem. This seems really inefficient is there a better way to do this?
tagged with: javascript
tagged with: reactjs
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/28258517
has comment: http://stackoverflow.com/comment/45057204
has comment: http://stackoverflow.com/comment/45057528
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/28357839
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/45057597
has title: Simple Add / Remove Component Pattern
accepted answer: http://stackoverflow.com/a/28357839
upvote count: 1
tagged with: design-patterns
answer count: 1
has comment: http://stackoverflow.com/comment/45057800
has comment: http://stackoverflow.com/comment/45057419

http://stackoverflow.com/comment/45029453
score: 0
has text: Besides my answer, check also your javascript binding, you're missing closing double quotes for the `"click"` event you're binding.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28342375

http://stackoverflow.com/q/28292700
has body: Error:This Source is black boxed: its break point disabled and stepping skips through it. how to avoid This source is blackboxed? I am using 3rd Party Plugins from JQGRID. Error showing in jquery.jqgrid.min.js file
score: 2
upvote count: 2
accepted answer: http://stackoverflow.com/a/28293504
type: AnsweredQuestion
has title: Black Boxed in Mozilla firefox
tagged with: jquery-plugins
type: Question
tagged with: firefox
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28293504

http://stackoverflow.com/q/28329602
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45019131
has body: I am implementing server-side sorting and pagination, and I need to pass the current page that the user is on so that if they sort and are on a page different than the first page (ex. sort by "least votes" on page 5 does not show the resorted results from page 1 on page 5 but shows the resorted results that should be on page 5). Basically, I need in place sorting but can't figure out how to get the current page. Server side paging is working without issue, and I believe I am missing something simple here. HTML (please note that I am using this custom directive: https://github.com/michaelbromley/angularUtils/tree/master/src/directives/pagination) {{article.articlevotes}} {{article.articletitle}} {{article.articlecategoryid}} {{article.articletitle}} <dir-pagination-controls on-page-change="pageChanged(newPageNumber)"></dir-pagination-controls> Controller $scope.articles = []; $scope.totalArticles = 0; $scope.articlesPerPage = 10; // this should match however many results your API puts on one page $scope.currentPage = 1; // sort options $scope.sortoptions = [ { label: 'Most Votes', value: 'articlevotes desc', }, { label: 'Least Votes', value: 'articlevotes asc', } ]; var sortBy = $scope.sortoptions[0].value; var currPage = $scope.currentPage; // Get current page console.log(currPage); // Initial page load getResultsPage(1, sortBy); $scope.update = function (articleSortOrder) { // get value of sort and log it console.log(articleSortOrder.value); sortBy = articleSortOrder.value; // log current page and pass as parameter console.log(currPage); getResultsPage(currPage, sortBy); // need to make dynamic so it gets current page } $scope.pageChanged = function (newPage) { getResultsPage(newPage, sortBy); }; function getResultsPage(pageNumber, sortorder) { // currently skipping by page number * articles per page pfcArticles.query({ $skip: (pageNumber - 1) * $scope.articlesPerPage, $top: $scope.articlesPerPage, $orderby: sortorder, $inlinecount: 'allpages' }, function (data) { …
favorite count: 0
has title: AngularJS Pagination - Get Current Page and Pass to Controller
accepted answer: http://stackoverflow.com/a/28346253
tagged with: angularjs
type: AnsweredQuestion
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/45035737
tagged with: pagination
type: Question
has comment: http://stackoverflow.com/comment/45025110
has answer: http://stackoverflow.com/a/28346253
answer count: 1

http://stackoverflow.com/q/28315810
tagged with: javascript
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/28315838
answer count: 3
has comment: http://stackoverflow.com/comment/44981467
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: In CSS there are many attribute selectors like a[href$=mp3] { // this means that if there is a &lt;a&gt; and it has href attribute and the href ends-with mp3 then apply my style .... my style } So What if I want to do something like this in JQuery $("a[href$=mp3]").click(function ()) { alert("An audio link is clicked !!"); }); But it is giving me an error/exception at first line Uncaught SyntaxError: Unexpected token ) Can anybody fix it or give me a work around ??
has answer: http://stackoverflow.com/a/28315844
has answer: http://stackoverflow.com/a/28315837
upvote count: 2
downvote count: 3
type: AnsweredQuestion
has title: CSS Attribute Selectors in JQuery
score: -1
type: Question
accepted answer: http://stackoverflow.com/a/28315837
has answer: http://stackoverflow.com/a/28315838

http://stackoverflow.com/q/28280286
type: Question
tagged with: stripes
has title: Update data on submit button and stay on the same page
has body: I have the following jsp page in which there is a table populated with data from arraylist in java code. I put table rows in input tag to be able to edit them. what I want to do now is to save data after editing them and still stay on the same page. I think I can use either javascript/jquery or ajax call and I've read about some solutions using them, but don't know actually how to use it to make it work! Any hints or suggestions would be appreciated alot! <stripes:form beanclass="SaveStudent.action"> <c:forEach var="array" items="${actionBean.importExcel }"> </c:forEach> <stripes:submit name="saveExcel" value="save"/> </stripes:form> Edited version: I have an array in java which I passed to jsp to be displayed as a table to user. when user change a value in the page, I need that value get updated(done by Ajax call(answered already, see following!)) and then shown to the user and at the same time get updated in the array in java code. My problem now is that how to pass variable from JQuery to jstl/jsp. I tried following, but not working, I don't know what I'm doing wrong! <% String pnr = request.getParameter("pnr"); out.println(pnr);//For test %> <c:forEach var="array" items="${actionBean.importExcel }"> <c:choose> <c:when test="${request.getParameter('pnr')=='null'}"> </c:when> <c:otherwise> </c:otherwise> </c:choose> </c:forEach>
downvote count: 0
has answer: http://stackoverflow.com/a/28280642
tagged with: jsp
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/28280550
answer count: 3
score: 2
has answer: http://stackoverflow.com/a/28280550
upvote count: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28281070
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28280642

http://stackoverflow.com/comment/65630168
comment on: http://stackoverflow.com/q/28401940
has text: same here. Any solution on this?
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45050144
comment on: http://stackoverflow.com/q/28353226
type: Comment
type: QuestionComment
score: 1
has text: What's a dynamic div? And it sounds like you need to use `this`.

http://stackoverflow.com/a/28332404
has body: You can delete that element from the array: delete data[300]; The full example: var data = []; data [300] = 1; data [600] = 1; data [783] = 1; delete data[300]; var result = ""; for (var x in data) { result += "&lt;div&gt;" + x + "&lt;/div&gt;"; } document.getElementById("output").innerHTML = result; &lt;div id="output" /&gt;
answers question: http://stackoverflow.com/q/28332315
type: Answer
has comment: http://stackoverflow.com/comment/45012131
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/45013106
downvote count: 0
has comment: http://stackoverflow.com/comment/45013257

http://stackoverflow.com/comment/45123860
type: Comment
comment on: http://stackoverflow.com/a/28388948
has text: Um, using an `else` instead of two `return`s woud be clearer :-)
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44992775
has text: Any example code would be helpful.
comment on: http://stackoverflow.com/q/28322138
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45029056
type: Comment
type: QuestionComment
has text: didn't work same result. it work fine in all browsers but only in IE7
comment on: http://stackoverflow.com/q/28342156
score: 0

http://stackoverflow.com/a/28363793
type: Answer
score: 0
has body: Yes Vanilla Js var btn = document.getElementById('video-btn'), graph = document.getElementById('graph'); btn.onclick = function () { graph.style.display = 'none'; }; Here is the jsFiddle. jQuery You will need to look add a click event to #video-btn, and run the hide() method on #graph. $('#video-btn').click(function (){ $('#graph').hide(); }); #graph{ width: 100px; height: 100px; background-color: rgb(172, 206, 6); margin-left: 220px; } #video{ width: 100px; height: 100px; background-color: rgb(9, 182, 223); margin-left: 400px; margin-top: -100px; } #video-btn { background-color: rgb(64, 186, 195); width: 100px; height: 30px; color: white; margin-top: 50px; } Button Graph content Video content
answers question: http://stackoverflow.com/q/28363705

http://stackoverflow.com/comment/44972565
type: AnswerComment
has text: Please edit your answer, and explain why this is a good solution.
comment on: http://stackoverflow.com/a/28309902
type: Comment
score: 2

http://stackoverflow.com/q/28415190
favorite count: 0
type: Question
upvote count: 1
answer count: 1
has body: Within a WinJS website i've got a listView bound to a WinJS.Binding.List which contains the data that needs to be repeated within listView template. This works fine. The issue I have is that within this template I also need to output details from an Object (called localisation) that contains localised text. As this appears outside of the bound data mentioned above trying to access it using the below produces undefined. &lt;h1 data-win-bind="innerHTML: localisation.CertificationAdmin"&gt;&lt;/h1&gt; Put simply is there a way to access data outside of the bound data within a listView template?
has title: WinJS - Accessing data contained outside of bound listView template
tagged with: winjs
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
tagged with: listview
score: 1
has answer: http://stackoverflow.com/a/28443217

http://stackoverflow.com/comment/45153373
type: Comment
type: QuestionComment
has text: Google maps provides a function that calculates the distance (following the curvature). google.maps.geometry.spherical.computeDistanceBetween()
score: 0
comment on: http://stackoverflow.com/q/28409523

http://stackoverflow.com/comment/45166127
type: Comment
has text: Please don't encourage a beginner to use `document.write()`. While it might be useful for a test program, it is rarely what you want to use in a real web page for a variety of reasons.
comment on: http://stackoverflow.com/a/28416475
score: 0
type: AnswerComment

http://stackoverflow.com/a/28398365
type: Answer
answers question: http://stackoverflow.com/q/28398250
upvote count: 15
downvote count: 0
score: 15
has body: Make your marker global, and either hide it or move it to the new location working code snippet: var map; var marker; function initialize() { var mapOptions = { zoom: 12 }; map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); // Get GEOLOCATION if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { var pos = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); map.setCenter(pos); marker = new google.maps.Marker({ position: pos, map: map, draggable: true }); }, function() { handleNoGeolocation(true); }); } else { // Browser doesn't support Geolocation handleNoGeolocation(false); } function handleNoGeolocation(errorFlag) { if (errorFlag) { var content = 'Error: The Geolocation service failed.'; } else { var content = 'Error: Your browser doesn\'t support geolocation.'; } var options = { map: map, position: new google.maps.LatLng(60, 105), content: content }; map.setCenter(options.position); marker = new google.maps.Marker({ position: options.position, map: map, draggable: true }); } // get places auto-complete when user type in location-text-box var input = /** @type {HTMLInputElement} */ ( document.getElementById('location-text-box')); var autocomplete = new google.maps.places.Autocomplete(input); autocomplete.bindTo('bounds', map); var infowindow = new google.maps.InfoWindow(); marker = new google.maps.Marker({ map: map, anchorPoint: new google.maps.Point(0, -29), draggable: true }); google.maps.event.addListener(autocomplete, 'place_changed', function() { infowindow.close(); marker.setVisible(false); var place = autocomplete.getPlace(); if (!place.geometry) { return; } // If the place has a geometry, then present it on a map. if (place.geometry.viewport) { map.fitBounds(place.geometry.viewport); } else { map.setCenter(place.geometry.location); map.setZoom(17); // Why 17? Because it looks good. } marker.setIcon( /** @type {google.maps.Icon} */ ({ url: place.icon, size: new google.ma…

http://stackoverflow.com/a/28315888
answers question: http://stackoverflow.com/q/28315584
has body: I have modified your code a little try doing this: &lt;script&gt; $('.readmore').click(function(){ var idnya = $('#idnya').val(); $.ajax({ type: "POST", url: "readmore.php?idnya="+idnya, data: dataString, success: function(returnedData) { $('#box').html(returnedData); } }); }) &lt;/script&gt; and in your readmore.php file use $_GET['idnya'] to get this value and use it in your query.
score: 0
type: Answer

http://stackoverflow.com/comment/45165831
comment on: http://stackoverflow.com/q/28416333
type: Comment
type: QuestionComment
has text: What do they all start with?
score: 2

http://stackoverflow.com/a/28392180
type: Answer
has body: The easiest way to accomplish what you're trying to do is a combination of some simple jQuery and CSS transitions. We will use JavaScript to check for the windows scroll position on every scroll event and compare it to the distance of the bottom of the #main element; if the scroll position is greater, then we'll apply a class to the body to indicate we have scrolled past #main, and then we will use CSS to define the nav styling for that state. Change the CSS code so it changes opacity when it's past #main. // get the value of the bottom of the #main element by adding the offset of that element plus its height, set it as a variable var mainbottom = $('#main').offset().top + $('#main').height(); // on scroll, $(window).on('scroll', function() { // we round here to reduce a little workload stop = Math.round($(window).scrollTop()); if (stop > mainbottom) { $('.nav').addClass('past-main'); } else { $('.nav').removeClass('past-main'); } }); .nav { background-color: transparent; color: #fff; transition: all 0.25s ease; position: fixed; top: 0; width: 100%; background-color: #ccc; padding: 1em 0; /* make sure to add vendor prefixes here */ } .nav.past-main { background-color: #fff; color: #444; } #main { height: 500px; background-color: red; } #below-main { height: 1000px; background-color: #eee; } [logo] #main #below-main
score: 2
answers question: http://stackoverflow.com/q/28392145
upvote count: 2
downvote count: 0

http://stackoverflow.com/a/28305453
upvote count: 4
has comment: http://stackoverflow.com/comment/44962412
type: AcceptedAnswer
downvote count: 0
score: 4
has comment: http://stackoverflow.com/comment/44962163
has comment: http://stackoverflow.com/comment/44962181
answers question: http://stackoverflow.com/q/28305417
has body: Just slice the elements: $("<selector>").slice(1).each(function () {...}); .slice( start [, end ] ) Description: Reduce the set of matched elements to a subset specified by a range of indices. Another working solution would be to build a spaghetti selector using :not and :first: $("tr").each(function () { $("td:not(:first)", this).each(function () { // do something }); }); Example var colors = ["#f1c40f", "#2ecc71"]; $("table tr").each(function() { $("td", this).slice(1).each(function(i) { $(this).css("background", colors[i]) }); }); setTimeout(function() { $("table tr").each(function() { $("td:not(:first)", this).each(function(i) { $(this).css("background", colors[colors.length - i - 1]) }); }); }, 1000); Name Age Location Alice 19 Europe Bob 20 Europe Carol 15 Australia
type: Answer
has comment: http://stackoverflow.com/comment/44962343
has comment: http://stackoverflow.com/comment/44962284
accepted answer of: http://stackoverflow.com/q/28305417

http://stackoverflow.com/q/28349612
type: Question
answer count: 2
has title: Highlighting select menu with js
linked to: http://stackoverflow.com/q/7208786
tagged with: javascript
has answer: http://stackoverflow.com/a/28350240
has answer: http://stackoverflow.com/a/74039865
score: 0
has body: I have multiple selects for a user to chose from. I need to prevent duplicates and alert user of their duplicates. I don't know if i need to use different id's or i could use just one id for all of the selects. I need the duplicate select to alert red. One Two Three Four Five Six Seven Eight Nine One Two Three Four Five Six Seven Eight Nine One Two Three Four Five Six Seven Eight Nine One Two Three Four Five Six Seven Eight Nine here is my Javascript function checkDropdowns() { var iDropdowns = 4; var sValue; var sValue2; for(var i = 1; i <= iDropdowns; ++i) { sValue = document.getElementById('drop' + i).value; for(var j = 1; j <= iDropdowns; ++j) { sValue2 = document.getElementById('drop' + j).value; if ( i != j && sValue == sValue2 ) { document.getElementById('drop' + j).style.border = "solid 1px red"; return false; } } } return true; } Not sure what i am doing wrong. Any help will be welcome. Here is my Fiddle
type: UnansweredQuestion

http://stackoverflow.com/a/28352392
answers question: http://stackoverflow.com/q/28352264
type: Answer
has comment: http://stackoverflow.com/comment/45048697
has comment: http://stackoverflow.com/comment/45048634
has comment: http://stackoverflow.com/comment/45048722
has body: onsubmit function() in your form should return true. Try putting return true after all conditions have been taken care for validations in function validateForm()
score: 0

http://stackoverflow.com/a/28280894
answers question: http://stackoverflow.com/q/28280713
type: Answer
accepted answer of: http://stackoverflow.com/q/28280713
has comment: http://stackoverflow.com/comment/44931268
has comment: http://stackoverflow.com/comment/44915957
has body: $( ".selector" ).datepicker({ defaultDate: -5 }); 5 day back as default ? http://api.jqueryui.com/datepicker/#option-defaultDate minDate give something else: The minimum selectable date.
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/45121627
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28391458
has text: #hash?param=value is backwards because it is making the hash have a parameter. try this: ?param=value#hash , maybe that helps...
score: 0

http://stackoverflow.com/comment/45203412
has text: I took a quick look at your new question and have a solution for you: http://stackoverflow.com/questions/28426989/how-to-eliminate-image-overlapping-in-canvaskineticjs. Good luck with your project!
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28413585
type: AnswerComment

http://stackoverflow.com/q/28432984
has comment: http://stackoverflow.com/comment/45201356
has comment: http://stackoverflow.com/comment/45196355
has title: Set Textarea cursor to start of textarea
tagged with: javascript
has comment: http://stackoverflow.com/comment/45196040
score: 0
has comment: http://stackoverflow.com/comment/45196780
has body: I am new to this. I recently started learning HTML/JavaScript/PHP. I have created a form that a user can type information into and update any changes they have made. I used the Textarea as the information being requested is quite large. When someone wants to update the information they entered before, a PHP code I wrote displays the information previously written: &lt;textarea class="datainput" row="4" cols="60"&gt;&lt;?php echo $dataInput['data_input'];?&gt;&lt;/textarea&gt; All works fine except, the cursor is not in a fixed position at the start when the user first enters the information. It appears in the middle of the first row of the Textarea. How do I set the cursor position to the top left corner (start)?
duplicate of: http://stackoverflow.com/q/17858174
has comment: http://stackoverflow.com/comment/45196119
tagged with: http://stackoverflow.com/tag/html
tagged with: php
linked to: http://stackoverflow.com/q/17858174
has comment: http://stackoverflow.com/comment/45197757
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45196577
type: Question

http://stackoverflow.com/q/28280895
has comment: http://stackoverflow.com/comment/44916741
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44918579
has answer: http://stackoverflow.com/a/28282766
has body: I have a simple form which when submitted enters data into a meteor mongo collection. I then output the data just submitted into another div, kind of like tweets being submitted and shown in a timeline. I'd like to store the timestamp of when the user submitted the form into the collection and then display the 'feed' ordered by the timestamp descending, so newest first. I'm currently using moment.js to record the timestamp in the collection and then simply use that timestamp on the output, but it doesnt seem the most efficient way to do this. I intend to have users in different time zones submitting the form and therefore would like to be able to display the timestamps submitted in UTC ordered by most recent. Currently I have... Template.form.events({ 'submit form': function(e) { e.preventDefault(); var insertPost = { timestamp: moment().format('DD-MM-YY HH:mm:ss ZZ') // some other stuff as well }; form._id = Posts.insert(insertPost); )}; Then this is being displayed in my post_item.html : {{timestamp}} // some other stuff too Is this way of storing the timestamp ok? I feel storing it in milliseconds is probably better and then formatting that on the output. So I can change my form.events code to store timestamp: moment.utc().valueOf(), and this stores in milliseconds since the epoch, but how do I then convert that within the html template to display the timestamp nicely formatted?
type: Question
score: 0
has title: storing timestamp in meteor mongo collection and then displaying it
linked to: http://stackoverflow.com/q/25393603
answer count: 1
tagged with: javascript
tagged with: meteor
tagged with: momentjs

http://stackoverflow.com/comment/44956422
comment on: http://stackoverflow.com/a/28302507
has text: Please, test both approaches as both should work and if there's anything wrong in my answer (I wrote it without testing anything), feel free to fix or enhance it.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44994040
score: 0
type: AnswerComment
has text: Check the following one. [link] (http://jsfiddle.net/xbtxzaax/4/) @BrianTompsett it is really not easy to add js and html codes to here.
type: Comment
comment on: http://stackoverflow.com/a/28302226

http://stackoverflow.com/comment/45040660
type: QuestionComment
has text: Do you want to just parse it's string value to something and do a new Date(parsedValues)?
score: 0
comment on: http://stackoverflow.com/q/28348227
type: Comment

mongoose
tags question: http://stackoverflow.com/q/28379922
tags question: http://stackoverflow.com/q/28359243
tags question: http://stackoverflow.com/q/28410514
tags question: http://stackoverflow.com/q/28309706
tags question: http://stackoverflow.com/q/28310767
tags question: http://stackoverflow.com/q/28288040
type: Tag
tags question: http://stackoverflow.com/q/28338891
tags question: http://stackoverflow.com/q/28423415
tags question: http://stackoverflow.com/q/28291516
tags question: http://stackoverflow.com/q/28283524
tags question: http://stackoverflow.com/q/28394625
tags question: http://stackoverflow.com/q/28336601
tags question: http://stackoverflow.com/q/28395681
tags question: http://stackoverflow.com/q/28413820
tags question: http://stackoverflow.com/q/28334601
tag name: mongoose
tags question: http://stackoverflow.com/q/28344272
tags question: http://stackoverflow.com/q/28294515
tags question: http://stackoverflow.com/q/28307493
tags question: http://stackoverflow.com/q/28345065
tags question: http://stackoverflow.com/q/28426466
tags question: http://stackoverflow.com/q/28390714
tags question: http://stackoverflow.com/q/28357965
tags question: http://stackoverflow.com/q/28286894
tags question: http://stackoverflow.com/q/28435203
tags question: http://stackoverflow.com/q/28372285

http://stackoverflow.com/a/28311350
has body: I think what you want is to check if request.app.settings.port is defined and assign its value but assign 3000 if it is not defined. In that case you want to do following, var port = ( request.app &amp;&amp; request.app.settings &amp;&amp; request.app.settings.port ) || 3000;
answers question: http://stackoverflow.com/q/28311208
score: 0
type: Answer

http://stackoverflow.com/a/28290493
has body: You need to run the query to save it. I'll answer it to the mysql_* library, even though it is deprecated. This is how the flow is supposed to go: $con = mysql_connect(....) or die(); mysql_select_db('database'); $name = mysql_real_escape_string($_POST['name']); $activity = mysql_real_escape_string($_POST['activity']); $level = $_POST['level']; $sql = "INSERT INTO lottt ". "(name, activity, level) ". "VALUES('$name','$activity', '$level')"; if(!mysql_query($sql)) { die('Error: ' . mysql_error()); } else { echo 'saved'; } You should stop using mysql_* functions. The library is deprecated. You should look into using PDO or MySQLi as they are more modern libraries and while you might have to overcome a hurdle to learn it, being competent in those libraries will do you the world of good! Resources: PDO MySQLi
has comment: http://stackoverflow.com/comment/44934778
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28290422
has comment: http://stackoverflow.com/comment/44934789
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28290422
type: Answer
score: 3
downvote count: 0

http://stackoverflow.com/comment/45194338
comment on: http://stackoverflow.com/a/28431703
score: 0
type: AnswerComment
has text: i Appreciate you help thanx gonna use this code because it easiest...thank you
type: Comment

http://stackoverflow.com/a/28313765
score: 3
type: Answer
answers question: http://stackoverflow.com/q/28313689
upvote count: 3
has body: As I think you know, when you're connected, you're keeping the data up-to-date, but if you have a momentary disconnect and then reconnect, you might have missed some data updates. There are a number of possible strategies for dealing with this. Brute-force. Upon a reconnect, get a fresh copy of all the data as if the device had just been turned on. Less efficient, but easy to implement. Transaction ID or Transaction Time. Each time the server sends an update, it sends either a transaction ID or a transaction server time with that update. The client then keeps track of the last transaction ID or transaction time that it received. When it does a reconnect, it sends an initial message with the last transaction ID or transaction time asking for any updates that have happened since that last transaction. The server can then look through its database to see if there are any newer transactions and, if so, send them to that client. This requires keep track of transactions at your database. It is common that the server can possibly return a "transaction id not supported" type of response which then forces the client back to a brute-force update from scratch. This is a back-stop in case a database rebuild or server crash causes older transaction values to get lost. True Synchronization. The client reconnects and then does a true synchronization with the server where the client essentially says "this is what I have, do you have anything newer". In the interest of efficiency, many synchronization systems solve this problem by implementing the transaction id described in option 2, but there are certainly many other ways to do synchronization. True synchronization is more useful if the client might also be changing the data while it was disconnected. As a simplifying way of implementing option 2, if your database does not already support the notion of journaled transactions, then some servers will implement a transaction log in memory where it keeps track of the last N hours of t…
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28313689

http://stackoverflow.com/comment/45073375
has text: can i increase the dash space and make it look like the example
comment on: http://stackoverflow.com/a/28366081
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/28394237
upvote count: 1
answers question: http://stackoverflow.com/q/28391290
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45125742
has body: If you define property using Object.defineProperty specifying only value instead of get and set, then you are using data descriptor (see here). With data descriptor you can add writable property to specify whether property can be changed or not. By default writable=false. So if you're specifying only value of data descriptor, without writable: true - you can't change that property later. This behavior has nothing with ES6, as Object.defineProperty was introduced in ES5. Correct code: class hasDefault { setValue ( v ) { this.v = v; } } Object.defineProperty( hasDefault.prototype, "v", { value : 5, writable: true, enumerable : true }); let a = new hasDefault; console.assert(a.v === 5); a.setValue(2); console.assert(a.v === 2); <a href="https://google.github.io/traceur-compiler/demo/repl.html#class%20hasDefault%20%7B%0A%20%20setValue%20(%20v%20)%20%7B%0A%20%20%09this.v%20%3D%20v%3B%0A%20%20%7D%0A%7D%0AObject.defineProperty(%20hasDefault.prototype%2C%20%22v%22%2C%20%7B%0A%20%20value%20%3A%205%2C%0A%20%20writable%3A%20true%2C%0A%20%20enumerable%20%3A%20true%0A%7D)%3B%0A%0Alet%20a%20%3D%20new%20hasDefault%3B%0Aconsole.assert(a.v%20%3D%3D%3D%205)%3B%0Aa.setValue(2)%3B%0Aconsole.assert(a.v%20%3D%3D%3D%202)%3B" rel="nofollow">Traceur REPL

http://stackoverflow.com/a/28423476
type: AcceptedAnswer
downvote count: 0
has body: No way to upload file via GET. Even if you will use JSONP. JSONP is working just with GET requests. And you can't upload files with GET request (usually files upload with POST requests). If you wanna send cross domain POST request to some server, then you should be sure in next case: That server should send you header Access-Control-Allow-Origin : *. Also you will may be need Access-Control-Allow-Methods: POST header. If it has those headers, then you are lucky and you can POST your data on this server. P.S. You can try to use other methods to make valid cross domain request. Nice js library easyXDM for cross domain requests, witch uses different ways to do it.
type: Answer
accepted answer of: http://stackoverflow.com/q/28365417
answers question: http://stackoverflow.com/q/28365417
has comment: http://stackoverflow.com/comment/82866053
upvote count: 9
score: 9

http://stackoverflow.com/comment/45174477
has text: What do you mean by "returns multiple promises"?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28413446

http://stackoverflow.com/q/28350387
has title: Display Alert if Checkbox is unchecked and text field is not empty
answer count: 4
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/63913101
tagged with: alert
has body: I have this form when information is being store into DB. I have a checkbox and a text field. Either one are required, but if the text field isn't empty, there's a good chance the checkbox should be checked. So I'd like to display an Alert if the Text Field has a value in it, and the checkbox isn't checked. I'd like this alert to appear when hitting the Submit button. Here's my form: Close this RMA Save and Continue So if checkbox "close" IS NOT checked AND "dateshipped" IS NOT NULL, then display alert when click Submit. Thank you.
type: Question
score: 0
has answer: http://stackoverflow.com/a/28350593
has comment: http://stackoverflow.com/comment/45044617
has answer: http://stackoverflow.com/a/28350559
has comment: http://stackoverflow.com/comment/45044595
has comment: http://stackoverflow.com/comment/45045353
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28351376

http://stackoverflow.com/comment/45154513
comment on: http://stackoverflow.com/a/28410223
type: Comment
score: 2
type: AnswerComment
has text: @micnic: Good one. Yeah, that works if you don't need to shim `Object.create` (as the two-argument form can't be shimmed properly). Also note that you're making `constructor` both non-writeable and non-configurable, which is different from [what the JavaScript engine does](http://www.ecma-international.org/ecma-262/5.1/#sec-13.2) (Step 17) (I think one could argue that non-writeable and non-configurable make good sense, just thought I would flag the difference).

http://stackoverflow.com/a/28386196
accepted answer of: http://stackoverflow.com/q/28385501
has body: I see in your comment that you've settled on putting state in the child component. While that works fine, the power of React is that you reason about state at a level that makes sense for all the interactions in the application. It is perfectly reasonable to hold both counters' state in the parent. I think the typical implementation would have a single update function in the parent, pass it, current counter value, and the counter IDs down as props, and have an update function in the child designed to invoke the parent's update function with the relevant counter ID. Update: Your gist implementing this pattern is close to what I was talking about, keeping state in the parent and creating an onClick handler in the child that in turn calls its parent's update function, passing in parameters that let the parent know which counter to update. You may find it more useful to just pass the "refz" prop as that parameter rather than passing in the entire child React component, but as a proof of concept, you have the idea.
downvote count: 1
score: 0
has comment: http://stackoverflow.com/comment/45112468
answers question: http://stackoverflow.com/q/28385501
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45110560
type: Answer
upvote count: 1

http://stackoverflow.com/comment/44960058
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28304426
type: Comment
has text: I added your code, except the "confirm" portion. But after adding it, none of my pop-ups display at all when I click the links for them

http://stackoverflow.com/comment/44955343
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28300655
has text: Your question is a little confusing because "recurring payments" is actually the name of a similar but different PayPal product; your code snippet shows that you are using PayPal's subscriptions product. Also, it is not clear (at least to me) whether you want to store the details of the subscription when it is agreed to, or you want to store a new record when each payment of the subscription is made. If you can clarify, that may help someone who knows Parse (I do not) help you more easily.
type: Comment

http://stackoverflow.com/q/28308131
has comment: http://stackoverflow.com/comment/44982713
has comment: http://stackoverflow.com/comment/44969074
has comment: http://stackoverflow.com/comment/44983351
possible better answer: http://stackoverflow.com/a/32367587
has comment: http://stackoverflow.com/comment/44983477
accepted answer: http://stackoverflow.com/a/28308596
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/54898274
has body: Bluebird promisifaction is a little magic, and request is quite a mess (it's a function which behaves as an object with methods). The specific scenario is quite simple: I have a request instance with cookies enabled, via a cookie jar (not using request's global cookie handler). How can I effectively promisify it, and all of the methods it supports? Ideally, I'd like to be able to: call request(url) -> Promise call request.getAsync(url) -> Promise call request.postAsync(url, {}) -> Promise It seems as though Promise.promisifyAll(request) is ineffective (as I'm getting "postAsync is not defined").
downvote count: 0
tagged with: javascript
score: 32
has comment: http://stackoverflow.com/comment/44981869
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/44982077
has comment: http://stackoverflow.com/comment/44982644
has comment: http://stackoverflow.com/comment/44968320
upvote count: 32
has comment: http://stackoverflow.com/comment/44967995
has answer: http://stackoverflow.com/a/28308596
has comment: http://stackoverflow.com/comment/44982504
has answer: http://stackoverflow.com/a/55397582
tagged with: promise
has comment: http://stackoverflow.com/comment/44982846
has answer: http://stackoverflow.com/a/32367587
has title: How do you properly promisify request?
tagged with: bluebird

http://stackoverflow.com/q/28356348
has comment: http://stackoverflow.com/comment/45112038
answer count: 1
has body: I made this script for a "reel" that should move up or down on the click of an up or down arrow. However, I have two issues: 1)The up arrow moves it down and the down arrow moves it up 2)After it has executed once I am unable to execute it again, I receive an error saying it was unable to parse "top". Any idea on why this might be happening? I pasted all the code below. it isn't pretty, but it has everything there. Tales of the Hartland: Homepage
type: UnansweredQuestion
tagged with: animation
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28356479
score: 0
has title: Javascript Animation Not Functioning Properly
type: Question
tagged with: javascript

http://stackoverflow.com/comment/45239125
score: 0
type: Comment
has text: @David, where and how will I call this php script, in the answer, on the `onClick` action?
type: AnswerComment
comment on: http://stackoverflow.com/a/28433479

http://stackoverflow.com/q/28305960
answer count: 1
downvote count: 0
tagged with: jquery
has title: Prevent touchmove default (browser scrolling) until condition is met?
favorite count: 0
has body: The objective is to have a component, in this case a carousel, that responds to the touchmove event when the user is moving his finger from left to right, but does not prevent the default scrolling up and down, even if the touch originates on the component in question, provided the user moves his finger on the y axis beyond a certain threshold. Or, more plainly, I need to disable the browser scroll on touch devices, until the touchmove even says its OK, and re-enables it. Despite several hours of tinkering, I've only been able to disable browser scroll completely or not disable it all. Conditionally disabling does not seem to want to work. The basic logic is: Record the coordinates on finger down (touch start). On touchmove, check to see if the Y difference is greater than 200px. If so, allow the default of browser scrolling, disable the touchmove listener. If not, prevent the default of scrolling, scroll left/right. I've been testing this on a late edition iPad mini. I have discovered the following: Calling preventDefault() in the touchstart handler stops all browser scrolling for that touch, it cannot be re-enabled during drag. Trying to conditionally prevent default in the dragmove handler behaves the same as preventDefault in the touchstart handler. That is, it blocks the drag, and ignores the condition! A condition like this in dragmove: if(Math.abs(MouseMoveDistanceY) &lt; 200){ if(ev.preventDefault){ev.preventDefault();} } ...blocks vertical scrolling permanently, even if the threshold gets exceeded! In any case, how can I, on touch devices and in the dragmove handler, surrender control to the browser scroll when a condition is met? Something like "unPreventDefault()" would be great. Barring that, any ideas?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28306139
score: 1
upvote count: 1
type: Question
tagged with: javascript
tagged with: touch

http://stackoverflow.com/comment/45126064
type: Comment
has text: @VincentVerheyen indeed, that's what i meant by "(and you can do so using **JS** as suggested in other answers)"
type: AnswerComment
comment on: http://stackoverflow.com/a/28393161
score: 0

http://stackoverflow.com/comment/53118389
has text: @Mayur, I have posted the solution that worked for me [here](http://stackoverflow.com/questions/24535799/pdf-js-and-viewer-js-pass-a-stream-or-blob-to-the-viewer/32634740#32634740)
comment on: http://stackoverflow.com/a/28460405
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/a/28305389
answers question: http://stackoverflow.com/q/28305306
has comment: http://stackoverflow.com/comment/45050376
has comment: http://stackoverflow.com/comment/45050405
downvote count: 0
type: Answer
upvote count: 3
score: 3
has body: Which version of ASP.NET? The following certainly works for me*: &lt;script&gt; function txtOnKeyPress() { console.log("txtOnKeyPress"); } &lt;/script&gt; &lt;asp:TextBox ID="txtWriter" runat="server" onkeypress="txtOnKeyPress()" /&gt; *Although, I did add () to the function name. Regardless, if ASP.NET has an issue with that attribute name, you could simply attach a handler on the client-side. Depending upon your needs, the input event may make more sense. It's sort of a live change event which fires as the input value is being edited (via keystroke, cut, paste, etc). Here's a sample: document.querySelector("input").addEventListener("input", function(e) { console.log("value: %o", this.value); }); &lt;input autofocus placeholder="type here"&gt;&lt;/input&gt; Note browser compatibility here. Now, the previous sample fires with every single change to the input value... which can be quite bit, i.e.: 4 times for simply typing, "test". Since you'd (presumably) like it to trigger your server-side code, we'll want to wait for any changes made in rapid succession before actually posting the form: function __doPostBack(name, argument) { // dummy version of ASP.NET's __doPostBack console.log("value: %o", document.getElementsByName(name)[0].value); } var t; // handle for our timeout document.querySelector("input").addEventListener("input", function(e) { // input received... cancel the previous timeout, if any clearTimeout(t); // wait 1000 milliseconds (1 second) for more input before posting t = setTimeout(__doPostBack, 1000, this.name); }); &lt;input autofocus placeholder="type here" name="test-input"&gt;&lt;/input&gt; See also: window.setTimeout(), document.querySelector(), document.getElementsByName, and EventTarget.addEventListener(). In your code behind: protected void Page_Load(object sender, EventArgs e) { if (IsPostBack &amp;&amp; Request.Form["__EVENTTARGET"] == txtWriter.UniqueID) { GridView1.DataSource = /* some data source */; GridView1.DataBind(); } }

http://stackoverflow.com/comment/45088279
comment on: http://stackoverflow.com/a/28370902
has text: Are you trying to POST the changes for each row using ajax?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45117495
type: Comment
has text: Oh ok, I got the problem. Thanks
comment on: http://stackoverflow.com/a/28388123
type: AnswerComment
score: 0

http://stackoverflow.com/a/28502941
type: Answer
has comment: http://stackoverflow.com/comment/55989541
downvote count: 0
score: 3
has body: Here's an idea on how to do it with pure html. You can wrap this concept into a snazzy javascript function to speed things up. The idea is simple border-radius circles: NOTE: only tested on chrome http://jsfiddle.net/9m6fbtxL/ .circle1 { position: absolute; width: 340px; height: 340px; border-radius: 170px; border: 1px solid #4e82bc; background-color: #4e82bc; } .circle2 { position: absolute; top: 110px; left: 60px; width: 220px; height: 220px; border-radius: 110px; border: 2px solid #FFFFFF; background-color: #4e82bc; } .circle3 { position: absolute; top: 212px; left: 120px; width: 100px; height: 100px; border-radius: 50px; border: 2px solid #FFFFFF; background-color: #4e82bc; } .textArea1 { position: absolute; width: 500px; height: 100px; top: 8px; left: 170px; background-color: #FFFFFF; border: 2px solid #4e82bc; } .textArea2 { position: absolute; width: 500px; height: 100px; top: 110px; left: 170px; background-color: #FFFFFF; border: 2px solid #4e82bc; } .textArea3 { position: absolute; width: 500px; height: 100px; top: 212px; left: 170px; background-color: #FFFFFF; border: 2px solid #4e82bc; } .textArea4 { position: absolute; width: 500px; height: 16px; top: 314px; left: 170px; background-color: #FFFFFF; border: 2px solid #4e82bc; } .textArea5 { position: absolute; width: 500px; height: 14px; top: 332px; left: 170px; background-color: #FFFFFF; border: 2px solid #4e82bc; }
accepted answer of: http://stackoverflow.com/q/28403518
has comment: http://stackoverflow.com/comment/56034836
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28403518
upvote count: 3

http://stackoverflow.com/q/28310366
tagged with: angularjs
has body: For some reason this seems easier in IE than Chrome/FF: $scope.download = function() { Restangular.one(myAPI) .withHttpConfig({responseType: 'blob'}).customGET().then(function(response) { //IE10 opens save/open dialog with filename.zip window.navigator.msSaveOrOpenBlob(response, 'filename.zip'); //Chrome/FF downloads a file with random name var url = (window.URL || window.webkitURL).createObjectURL(response); window.location.href = url; }); }; Is there a way to do something similar to how IE10+ works? That is, I can specify a file name/type (will only be zip)?
tagged with: restangular
type: AnsweredQuestion
downvote count: 0
score: 9
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/34026983
tagged with: javascript
has answer: http://stackoverflow.com/a/34026983
accepted answer: http://stackoverflow.com/a/28310576
has title: Angularjs/Restangular, how to name file blob for download?
has answer: http://stackoverflow.com/a/28310576
favorite count: 0
upvote count: 9

http://stackoverflow.com/q/28383558
tagged with: javascript
has answer: http://stackoverflow.com/a/28383819
has answer: http://stackoverflow.com/a/28383823
accepted answer: http://stackoverflow.com/a/28383823
answer count: 2
upvote count: 1
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has title: Centering 2 divs seperatly inside a container div
has body: I'm looking for a solution for this problem: I have a container div which gets its height / width from a div/img inside it with dynamic height. inside that container I want to add another square div 72x72px which will be centered both horizontally and vertically. css solution is preferred thanks for the help current html: &lt;div class="post"&gt; &lt;div class="post-like"&gt;&lt;/div&gt; &lt;img src="dsada"/&gt; &lt;/div&gt; current less: .post:before{ content: ''; display: inline-block; height: 100%; vertical-align: middle; margin-right: -0.25em; /* Adjusts for spacing */ background: #808080; width: 5px; } .post{ background: @white; direction: rtl; overflow: hidden; width: 42%; margin-left: 2%; margin-right: 2%; margin-top: 4%; position: relative; text-align: center; white-space: nowrap; img{ display: inline-block; vertical-align: middle; width: 100%; } .post-like display: inline-block; vertical-align: middle; opacity: 1; cursor: pointer; height: 72px; width: 72px; border-radius: 50%; background: rgba(0,0,0,0.7); }
tagged with: css
has comment: http://stackoverflow.com/comment/45105498
has comment: http://stackoverflow.com/comment/45105173
type: AnsweredQuestion
downvote count: 0
score: 1
possible better answer: http://stackoverflow.com/a/28383819
type: Question

http://stackoverflow.com/a/28429452
score: 1
downvote count: 0
has body: Although there are many acceptable answers here, I want to point out that one unmentionend method of concatenating strings in JavaScript is using Array's join() method: var pagina = ["edi.do?serv=3.C&amp;ids=", value].join();
type: Answer
answers question: http://stackoverflow.com/q/28429116
upvote count: 1

http://stackoverflow.com/q/28390358
type: Question
tagged with: cpu-usage
upvote count: 13
has comment: http://stackoverflow.com/comment/45119468
has comment: http://stackoverflow.com/comment/45123816
score: 12
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45118890
tagged with: requestanimationframe
tagged with: javascript
has answer: http://stackoverflow.com/a/40228560
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45118152
has body: I am facing high CPU usage (30 to 40%) when calling recursively requestAnimationFrame, does anyone has good strategies to lower it down? Simple example: var canvas = document.createElement('canvas'); canvas.width = 100; canvas.height = 20; var canvasContext = canvas.getContext('2d'); document.body.appendChild(canvas) var rafId; function drawLoop(time) { canvasContext.clearRect(0, 0, 100, 20); canvasContext.fillRect(0, 0, Math.random() * 100 * 1.4, 20); rafID = window.requestAnimationFrame(drawLoop); } drawLoop();
tagged with: html5-canvas
has title: High CPU usage with canvas and requestAnimationFrame
has comment: http://stackoverflow.com/comment/45118501
has comment: http://stackoverflow.com/comment/45118690
favorite count: 0
has comment: http://stackoverflow.com/comment/45118524

http://stackoverflow.com/q/28291939
tagged with: asp.net
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44937245
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28291978
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28292053
tagged with: javascript
answer count: 2
has body: simply I've .wav file and I want to run it once the textbox value changed. the textbox is placed on a aspx page. I've an HTML5 tag called : &lt;audio id="audiotag1" src="Sound/Alarm1.wav" preload="auto"&gt;&lt;/audio&gt; &lt;script type="text/javascript"&gt; function play_single_sound() { document.getElementById('audiotag1').play(); } &lt;/script&gt; and the code behind is: System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, GetType(Page), "Script", "play_single_sound();", True) they work fine if the browser support HTML5. So, I need same thing using javascript so that it work with each browser. thanks
has title: how to produce Beep sound in Aspx using JS based on code behind action?
downvote count: 0

http://stackoverflow.com/a/28401618
has comment: http://stackoverflow.com/comment/45155303
upvote count: 7
score: 7
answers question: http://stackoverflow.com/q/28401540
has body: My guess is that the problem lies in code you have removed. More specifically, you probably had a function in the waterfall right before the one you've shown that calls doSomethingAsync(). The way async.waterfall() works is that it passes on any arguments passed to the callback to the next function in the function list. So the previous function is probably doing something like callback(null, { foo: 'bar' }) and your callback argument in the next function is actually { foo: 'bar' } and the second argument is the real callback. It really depends on how many arguments you passed previously to the callback. So assuming you just pass 1 item, you would change the function definition from: function (callback) { doSomethingAsync(session, callback) } to: function (someResult, callback) { doSomethingAsync(session, callback) }
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45157694
accepted answer of: http://stackoverflow.com/q/28401540
type: Answer
has comment: http://stackoverflow.com/comment/45155542

http://stackoverflow.com/comment/45022058
score: 0
type: Comment
has text: I am using the nodejs in the server side.Here is my code
comment on: http://stackoverflow.com/a/28337973
type: AnswerComment

http://stackoverflow.com/a/28296622
downvote count: 0
has comment: http://stackoverflow.com/comment/44950387
has body: When the javascript was inline in the HTML, the &lt;%=%> tags were correctly parsed by ASP.NET. When you extract this javascript verbatim into an external file, the ASP.NET parser will not handle this file, so the id tag will not be translated to the correct id as Rory McCrossan already stated. Now, some possible solutions: You can define a function in the external javascript file that you call in some inline javascript on your web page. This inline javascript can use the &lt;%=%> tags and they will be correctly be replaced by the id of your datepicker element. You can opt for something else than a server-generated ID to correctly identify your datepicker. Consider adding a custom css class, or choose the ID yourself.
type: Answer
has comment: http://stackoverflow.com/comment/44949013
has comment: http://stackoverflow.com/comment/44951220
has comment: http://stackoverflow.com/comment/44950258
has comment: http://stackoverflow.com/comment/44951477
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/28295055

http://stackoverflow.com/a/28480251
has comment: http://stackoverflow.com/comment/45328840
downvote count: 1
accepted answer of: http://stackoverflow.com/q/28421221
upvote count: 2
answers question: http://stackoverflow.com/q/28421221
type: AcceptedAnswer
has body: Annotating optional parameters in the middle of a function's parameter list are almost as challenging as maintaining code that uses this type of method signature. Javascript doesn't truly support optional parameters in the middle of a function's argument list (to do that you need named parameters). Instead, functions that advertise this try to discern which version of the function was called based on the number and values of the parameters. Javascript also doesn't support function overloading. Recognizing these limitations gives the first clues to supporting what is in essence a documentation strategy. Your annotation must support all types of calls - and by doing this you lose a certain amount of type safety when using a tool that enforces or checks types. Let's use one of the jQuery.prototype.bind signatures as an example: jQuery.prototype.bind( eventType [, eventData ], handler ) To document this method, we recognize that two parameters are always required. First let's rearrange and rename the parameters: jQuery.prototype.bind( eventType, eventDataOrHandler, [ handler ] ) With that rearrangement, the JSDoc becomes clearer: /** * @param {string} eventType * @param {(*|function(Event))} eventDataOrHandler * @param {function(Event)=} handler * @return {!jQuery} */ jQuery.prototype.bind = function(eventType, eventDataOrHandler, handler) {}; Unfortunately there is no way to specify that when three arguments are used one set of types is needed, and a different set when two arguments are used. Perusing the Closure-compiler jQuery externs will give you plenty of examples.
type: Answer
has comment: http://stackoverflow.com/comment/45486440
score: 1

http://stackoverflow.com/a/28347264
has comment: http://stackoverflow.com/comment/45042271
upvote count: 1
has comment: http://stackoverflow.com/comment/45052507
accepted answer of: http://stackoverflow.com/q/28309029
has comment: http://stackoverflow.com/comment/45042079
has comment: http://stackoverflow.com/comment/45038995
has comment: http://stackoverflow.com/comment/45041670
answers question: http://stackoverflow.com/q/28309029
has body: Here's a recursive solution: function getCSSAbsolutePosition(el) { var pos= ('absolute relative').indexOf(getComputedStyle(el).position) == -1, rect1= {top: el.offsetTop * pos, left: el.offsetLeft * pos}, rect2= el.offsetParent ? getCSSAbsolutePosition(el.offsetParent) : {top:0,left:0}; return {top: rect1.top + rect2.top, left: rect1.left + rect2.left, width: el.offsetWidth, height: el.offsetHeight }; } In this Fiddle, a red sentence needs to be highlighted. Click the button, and getCSSAbsolutePosition will be called to get its coordinates, width, and height. A new div is placed underneath it (with a negative z-Index), which has a background and border. Notice that the "goal" div is within an absolute-positioned table within a relative-positioned div, with various padding and margins applied.
has comment: http://stackoverflow.com/comment/45039543
has comment: http://stackoverflow.com/comment/45052993
type: AcceptedAnswer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45053770
type: Answer
has comment: http://stackoverflow.com/comment/45053000

http://stackoverflow.com/a/28407717
type: Answer
answers question: http://stackoverflow.com/q/28407046
has body: In case of handling it as a number. var value= 25.50; var integer = Math.floor ( value) ; // = 25 var decimal = value - integer ; // = .50 Also incase of strings var numbers= value.toString().split('.'); then you can perform casting on the array index positions. Like, integer = parseInt(number[0]); fraction = parseInt(number[1]);
score: 0

http://stackoverflow.com/comment/45175811
type: AnswerComment
type: Comment
has text: It doesn't really have to be an object element. All I need is to embed some plain text to my document (preferably from a separate file) so I can read it with JavaScript. I wanted it to be clean and simple and that's why I avoided requests as my first option. Sorry, I should have mentioned that before. Thanks.
comment on: http://stackoverflow.com/a/28420861
score: 0

http://stackoverflow.com/q/28280769
possible better answer: http://stackoverflow.com/a/28280910
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44915584
has answer: http://stackoverflow.com/a/28280910
tagged with: asp.net-mvc
upvote count: 5
has comment: http://stackoverflow.com/comment/44915625
tagged with: javascript
type: Question
has comment: http://stackoverflow.com/comment/44915727
answer count: 2
tagged with: asp.net-mvc-5
score: 5
has comment: http://stackoverflow.com/comment/44916016
has body: I'm trying to latch onto a checkbox change event using jQuery, currently I have this: However in debug when I check/uncheck the box the RunsOnMondays() method is not firing. I have tried using this also but still didn't work: $('IsMonday').prop('checked').change(function () { RunsOnMondays();}); Browser output Monday Monday Start Monday Finish
downvote count: 0
tagged with: jquery
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/44916045
has answer: http://stackoverflow.com/a/28280891
has title: How to subscribe to an MVC checkbox change event in JQUERY
accepted answer: http://stackoverflow.com/a/28280891

http://stackoverflow.com/comment/44978816
type: Comment
comment on: http://stackoverflow.com/q/28314494
score: 0
has text: Was the request succesful? Did you try to output the response?
type: QuestionComment

http://stackoverflow.com/comment/45045301
has text: Updated the code. This is one solution that should work for your needs. The important bit is being able to tie the button click to a particular table which is being done in this case through the `data-target` attribute on the button
type: Comment
comment on: http://stackoverflow.com/a/28332273
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44925285
has text: @MichaelDoleman: I believe that's the problem. Do a simple test: change the name of your rule to `ctl00$PageContent$RecertVFCFormView$ProviderFirstName`
type: AnswerComment
comment on: http://stackoverflow.com/a/28285370
score: 0
type: Comment

http://stackoverflow.com/q/28311398
score: 0
has title: dropzonejs rotates the picture on mobile
has body: Briefly, I'm using dropzone.js for one of my projects and I've realized dropzonejs just ignores a vertical photo taken with a mobile phone. On desktop, there is no problem but when you try to open the original sample and use the uploader with your mobile phone (tested with Android and iOS) you will see the image is rotated. How can I prevent this to happen? Best,
has comment: http://stackoverflow.com/comment/45004311
type: UnansweredQuestion
answer count: 0
type: Question
has comment: http://stackoverflow.com/comment/44989262
tagged with: jquery-mobile
tagged with: upload
tagged with: javascript
tagged with: image
tagged with: dropzone.js
has comment: http://stackoverflow.com/comment/45106506
has comment: http://stackoverflow.com/comment/44973510

http://stackoverflow.com/a/28363597
type: Answer
has body: .css() changes the inline styles of an element - it does not know of, nor can it change media queries, since media queries cannot exist in an inline state. Add a class rather than changing CSS. You can then apply margin to this class, within a specific media query: CSS /*normal css*/ #additem{ margin-left:0; } /*responsive css*/ @media all and (max-width: 1366px) { #additem{ margin-left: 25%; } #additem.small-margin{ margin-left: 10%; } } jQuery $("#open-button").click(function () { $('#additem').addClass('small-margin'); });
answers question: http://stackoverflow.com/q/28363520
has comment: http://stackoverflow.com/comment/45076283
upvote count: 2
has comment: http://stackoverflow.com/comment/45069045
score: 2
has comment: http://stackoverflow.com/comment/45069036
downvote count: 0

http://stackoverflow.com/q/28375690
has body: I'm trying to load 2 differnt .PDE files using essentially the same code. I can't figure out why the CANVAS tag changes on my second example. Does anyone see an/the issue(s)? http://aaronshowingoff.com/exercises/saucer.php works fine. I define the CANVAS tag at 400x400. http://aaronshowingoff.com/exercises/beaver.php changes the CANVAS tag to 100x100. Here is the .PDE that doesn't work: /* @pjs preload="images/cs-ohnoes.png"; */ /* @pjs preload="images/GrassBlock.png"; */ /* @pjs preload="images/Hopper-Happy.png"; */ /* @pjs preload="images/Hopper-Jumping.png"; */ /* @pjs preload="images/Rock.png"; */ /* var pointCheck = function(){ stroke(250, 5, 5); strokeWeight(5); point(this.x + 20, this.y + 30); stroke(0, 0, 0); strokeWeight(1); }; */ // win/lose button var Button = function(config) { this.x = config.x || 0; this.y = config.y || 0; this.width = config.width || 100; this.height = config.height || 25; this.bevel = config.bevel || 5; this.label = config.label || "Click"; }; Button.prototype.draw = function() { fill(0, 234, 255); rect(this.x, this.y, this.width, this.height, 5); fill(0, 0, 0); textSize(19); textAlign(LEFT,TOP); text(this.label, this.x+5, this.y); textAlign(BASELINE); }; // win/lose button click check Button.prototype.isMouseInside = function() { return mouseX > this.x && mouseX < (this.x + this.width) && mouseY > this.y && mouseY < (this.y + this.height); }; var btnWin = new Button({ x: 200, y: 250, label: "Next Level" }); var btnLose = new Button({ x: 200, y: 250, label: "Start Over" }); //beaver object var Beaver = function(x, y) { this.x = x; this.y = y; //this.img = getImage("creatures/Hopper-Happy"); this.img = loadImage("images/Hopper-Happy.png") this.sticks = 0; this.bonusSticks = 0; this.width = 40; this.height = 40; }; Beaver.prototype.draw = function() { fill(255, 0, 0); //94 seems to keep Hopper's feet on the ground this.y = constrain(this.y, 0, height-94); image(this.img, this.x, this.y, 40, 40); stroke(250, 5, 5); strokeWeight(5); //po…
has comment: http://stackoverflow.com/comment/45176579
answer count: 1
score: 1
favorite count: 0
upvote count: 1
tagged with: processing.js
has comment: http://stackoverflow.com/comment/45247771
has title: My Resizes when I load a specific PDE file
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45218643
has comment: http://stackoverflow.com/comment/45213255
has answer: http://stackoverflow.com/a/32568382
type: Question
tagged with: canvas
downvote count: 0
accepted answer: http://stackoverflow.com/a/32568382
tagged with: javascript

http://stackoverflow.com/a/76482841
has comment: http://stackoverflow.com/comment/134876582
has body: I found this and it works for me : /* Fix for flickering carousel */ .carousel-inner .carousel-item { opacity: 0; top: 0; left: 0; width: 100%; display: block; position: absolute; } .carousel-inner .carousel-item:first-of-type { position: relative; } .carousel-inner .active { opacity: 1; } /* End of fix */
score: 0
answers question: http://stackoverflow.com/q/28384414
type: Answer

http://stackoverflow.com/comment/45114073
comment on: http://stackoverflow.com/a/28387859
type: AnswerComment
score: 0
type: Comment
has text: success: function(data) { alert(data); } // in html file

http://stackoverflow.com/comment/45091982
comment on: http://stackoverflow.com/q/28375766
has text: http://jsfiddle.net/93704tw2/ seems to work fine to me
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28483658
score: 0
answers question: http://stackoverflow.com/q/28403056
type: Answer
has body: As Eclecticist already stated. You need to set your html and body to 100% height. That is necessary because the wrapper-element inherits the height of the parent. Therefor setting the wrapper to 100%-height will never get it bigger that it's parent. In addition to Eclecticists answer I would recommend you to set the wrappers min-height to 100% so the content won't run out of the container as soon as it exceeds the window height: html, body { height: 100%; } #wrapper { min-height: 100%; }

http://stackoverflow.com/q/28330674
accepted answer: http://stackoverflow.com/a/28330958
has comment: http://stackoverflow.com/comment/45008773
favorite count: 0
has comment: http://stackoverflow.com/comment/45011310
has comment: http://stackoverflow.com/comment/45012209
upvote count: 1
has comment: http://stackoverflow.com/comment/45011480
type: AnsweredQuestion
has body: I need to convert this working filter gallery from JavaScript JQuery. I'm a complete novice in both these languages so I was hoping someone could give me a little help. Below is the JavaScript that will have to be converted, (function() { var filterButtons = document.querySelectorAll(".filterList a"); imageNodes = document.querySelectorAll("img"); console.log(filterButtons, imageNodes); function staggerImage() { TweenMax.staggerFromTo(imageNodes, 0.7, {opacity:0}, {opacity:1}, 0.3); } function doImageSwitch(event) { console.log("fire"); console.log(event.target.parentNode.id); for(i=0; i<imageNodes.length; i++) { imageNodes[i].style.display = "inline"; if(!imageNodes[i].classList.contains(event.target.parentNode.id)) { imageNodes[i].style.display = "none"; } } staggerImage(); } [].forEach.call(filterButtons, function(el) { el.addEventListener("click", doImageSwitch, false); }); staggerImage(); })(); And this is the HTML code I have set up, <?php include './includes/functions.php'; $conn = connect($config); $result = mysqli_query($conn, "SELECT * FROM main_content"); //echo mysqli_num_rows($result); ?> Filter Gallery Something Menu Right Button with Dropdown Flower Puppy Kitty <?php while($row = $result -> fetch_assoc()) { echo " "; } ?> Any help would be greatly appreciated. Thank you!
has title: JavaScript to JQuery, Converting a Sorting Gallery
has comment: http://stackoverflow.com/comment/45040495
downvote count: 1
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45009057
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/28330958

http://stackoverflow.com/comment/45026030
comment on: http://stackoverflow.com/q/28340449
type: Comment
has text: It's not working because it's not in the correct format. You want your query string to be something like: `?id_delete[]=value1&id_delete[]=value2` PHP will interpret this as an array.
type: QuestionComment
score: 0

http://stackoverflow.com/q/28429021
has comment: http://stackoverflow.com/comment/45189268
has comment: http://stackoverflow.com/comment/45189615
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29323015
answer count: 1
has comment: http://stackoverflow.com/comment/45189584
favorite count: 0
tagged with: parsing
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45189497
score: 2
has comment: http://stackoverflow.com/comment/45189253
tagged with: http://stackoverflow.com/tag/json
has title: Parsing JSON Object in JQuery from the Destiny Api
has body: im trying to parse the JSON-Object in Jquery from the Destiny API: http://www.bungie.net/platform/Destiny/Manifest/InventoryItem/712184834/ var destiny = "http://www.bungie.net/platform/Destiny/Manifest/InventoryItem/712184834/"; $.getJSON(destiny, function (json) { var test = json.Response.data.requestedId; alert(test); }); But unfortunately its not working ;(
type: Question

http://stackoverflow.com/q/28366542
favorite count: 0
tagged with: angularjs
has title: how to add edit option the list
type: UnansweredQuestion
downvote count: 1
type: Question
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/45074953
score: -1
has comment: http://stackoverflow.com/comment/45075010
has answer: http://stackoverflow.com/a/28366796
upvote count: 0
has body: I have just started using angularjs. I am trying to build simple single page app. I have user adding items to list. I display the list using ng-repeat like this.. I have an editor div to add options at the bottom of the list. item1edit item2edit ... .... But when I edit I want to move the editor div right after div that I am editing. I tried using jquery insertAfter method. It works. item1edit .... item2edit ... But when I add a new item, it does not move editor div it does work as expected. Is there a better way to accomplish this using angularjs directive. I thought I can create a class directive and move the editor into a template and load it on click. Will it work? I appreciate any help.
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45074181

http://stackoverflow.com/q/28368164
tagged with: visual-studio-2010
tagged with: vbscript
has comment: http://stackoverflow.com/comment/45077162
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45077362
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45077636
has body: When I created my site in 2005 I used JavaScript, visual basic Script, classic ASP and visual basic.. But My site only works with Internet explorer IE5 or higher. Now I want to make it work all the new browser like Firefox, Chrome and IE11. What is the best way to overcome this?Thanks.
downvote count: 2
has title: What is the best way to overcome multi browser support issue for old web site
upvote count: 1
type: Question
tagged with: asp-classic
has answer: http://stackoverflow.com/a/28368261
tagged with: javascript
score: -1

http://stackoverflow.com/comment/45131735
type: AnswerComment
comment on: http://stackoverflow.com/a/28397880
type: Comment
has text: added the solution for the second problem in another `JSFiddle`.
score: 0

http://stackoverflow.com/q/28304025
answer count: 2
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has answer: http://stackoverflow.com/a/28304228
favorite count: 0
has title: Javascript Function won't work as suppose to do after a few calls
has body: I'm trying to build this app which will generate a random question from two arrays of data: country and questions. So I want to query that question to the HTML and then the user answer the question through a text input and then check if the answer is correct. After a few calls the app works fine, but sometimes won't work as suppose... For example: for the question "Which is the capital of Romania?" the correct answer should be "bucuresti" but for a reason I don't understand the correct answer to pass the question is actually "romania". I'm guessing ther is a problem whit my if/else statement in the chechAnswer()function Array.prototype.random = function (length) { return this[Math.floor(Math.random()*length)]; }; var country = [ {name:"romaniei", capital: "bucuresti"}, {name: "bulgariei", capital: "sofia"} ], questions = [ "Care este capitala ", " este capitala carei tari?" ]; document.querySelector('input').onclick= function() { var q, chosen_country = country.random(country.length), chosen_question = questions.random(questions.length); cc = chosen_country; cq = chosen_question; if(chosen_question == questions[0]){ q = chosen_question + chosen_country.name + "?"; } else if(chosen_question == questions[1]){ q = chosen_country.capital + chosen_question; } document.querySelector('#que').innerHTML= q; document.getElementById("btn").disabled = true; }; checkAnswer = function() { var intrebare; var answer = document.myform.ans.value; if(cq == questions[0] && answer == cc.capital){ alert("corect"); document.getElementById("btn").disabled = false; }else if (cq == questions[1] && answer == cc.name) { alert("corect"); document.getElementById("btn").disabled = false; }else { alert("incorect"); } }; Intrebare:
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28304138
score: 1
possible better answer: http://stackoverflow.com/a/28304228
type: Question
has answer: http://stackoverflow.com/a/28304138
tagged with: javascript

http://stackoverflow.com/a/28311997
upvote count: 1
type: Answer
accepted answer of: http://stackoverflow.com/q/28310418
downvote count: 0
answers question: http://stackoverflow.com/q/28310418
has comment: http://stackoverflow.com/comment/44975210
has comment: http://stackoverflow.com/comment/44975530
score: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44997229
has comment: http://stackoverflow.com/comment/44974651
has body: Express's app and Socket.io have nothing to do with one another. So fundamentally, you can't use socket inside app.post. You need to identify the client. You can use Passport which has a Socket.io plugin that essentially bridges the app.post/get's req.user to socket.request.user. Note: It doesn't have to be an authenticated client with user that's fetched from database, just a client with a temporary user stored in memory would do. Something like this: app.use(function(req, res, next) { if (!req.user) { // if a user doesn't exist, create one var id = crypto.randomBytes(10).toString('hex'); var user = { id: id }; req.logIn(user); res.redirect(req.lastpage || '/'); return; } next(); }); var Users = {}; passport.serialize(function(user) { Users[user.id] = user; done(null, user); }); passport.deserialize(function(id) { var user = Users[id]; done(null, user); }); Then you can attach the client's socket ID to its user session. io.on('connection', function (socket) { socket.request.user.socketid = socket.id }); And then instead of socket.emit use io.emit in app.post using the socketid app.post('/', function (req, res) { io.to(req.user.socketid).emit('whatever'); }); Note: io.to() is used to emit to a room, but every socket is by default joined to the same room named as its socket.id, so it'll work.

http://stackoverflow.com/a/28291104
answers question: http://stackoverflow.com/q/28291042
has comment: http://stackoverflow.com/comment/44959791
has comment: http://stackoverflow.com/comment/44935955
accepted answer of: http://stackoverflow.com/q/28291042
has comment: http://stackoverflow.com/comment/44936050
type: Answer
has comment: http://stackoverflow.com/comment/44959056
has comment: http://stackoverflow.com/comment/44958983
score: 2
has comment: http://stackoverflow.com/comment/44935817
downvote count: 0
has comment: http://stackoverflow.com/comment/44935966
has comment: http://stackoverflow.com/comment/44964869
has body: You can try something like $("#fes-email").on("change keyup", function () { var email = $(this).val(); $("#fes-submit").prop("disabled", email.length == 0 || !isValidEmailAddress(email)); }); function isValidEmailAddress(emailAddress) { var pattern = new RegExp(/^(("[\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); return pattern.test(emailAddress); } Demo jQuery(function($) { $("#fes-email").on("change keyup", function() { var email = $(this).val(); $("#fes-submit").prop("disabled", email.length == 0 || !isValidEmailAddress(email)); }); function isValidEmailAddress(emailAddress) { var pattern = new RegExp(/^(("[\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); return pattern.test(emailAddress); } }) &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;input type='email' id="fes-email" name='fes-email' class='fes-input animate' value='' placeholder='E-mail' /&gt; &lt;input type='submit' id='fes-submit' class='fes-submit animate' value='&gt;' /&gt;
has comment: http://stackoverflow.com/comment/44935729
upvote count: 2
has comment: http://stackoverflow.com/comment/44936020
has comment: http://stackoverflow.com/comment/44935659
type: AcceptedAnswer

http://stackoverflow.com/q/28380626
tagged with: javascript
has answer: http://stackoverflow.com/a/28382910
score: 0
answer count: 1
tagged with: jquery
linked to: http://stackoverflow.com/q/14220321
tagged with: ajax
type: UnansweredQuestion
has title: How to write an Ajax JQuery in Wordpress using promises
tagged with: wordpress
type: Question
has body: I'm working on a Wordpress Google Maps plugin which pulls locations from a database via Ajax and returns an XML file which is then processed by a Javascript script so that they can be plotted them on a Google Map. This all works perfectly but I'd like to be able to restrict the data that it displayed to just those locations that are owned by the currently logged in user. As the WP users id is stored in the table this should be easy ... In my theme functions.php file I have this function: // Same handler function... add_action( 'wp_ajax_get_current_user_id', 'get_current_user_id_callback' ); function get_current_user_id_callback() { if (is_user_logged_in()) { echo get_current_user_id(); wp_die(); } } add_action('template_redirect', 'my_enqueue'); function my_enqueue() { // Enqueue the Javascript file wp_enqueue_script( 'ajax-script', '/ajax/ajax-user.js', array('jquery') ); // in JavaScript, object properties are accessed as ajax_object.ajax_url, ajax_object.we_value wp_localize_script( 'ajax-script', 'ajax_object', array( 'ajax_url' =&gt; admin_url( 'admin-ajax.php' )) ); } In the Javascript file which processes the XML I have the following function: function getUserId() { var data = {'action': 'get_current_user_id'}; jQuery.post(ajax_object.ajax_url, data, function(response) { userId=response; alert ('Within JQuery userId=' + userId); return userId;} ); } Which is called by this when the script loads: var userId; function load () { userId=getUserId(); alert ('Outside of JQuery UserId=' + userId); } The problem is that getUserId runs and returns undefined before it's had time to get the response from the database. I know the solution to this is to user Ajax promises but I cannot find anywhere a working example on how to do this specifically within Wordpress. According to this: How do I return the response from an asynchronous call? I just need to rewrite my getUserId function so that it includes .done and .fail but if I try this I get syntax errors as it's not reall…

http://stackoverflow.com/q/28376372
tagged with: jquery
tagged with: asp.net
favorite count: 0
tagged with: ajax
type: Question
has comment: http://stackoverflow.com/comment/45092963
score: 0
linked to: http://stackoverflow.com/q/5468425
answer count: 3
has comment: http://stackoverflow.com/comment/45093185
upvote count: 1
has body: I have an HTML canvas on my page. When I click the canvas, a simple dot paints. I pass the coordinates into my InsertIntoDB function to enter the x and y coordinates into a MS SQL Server database, but it's not happening. I can, however, place the C# call into an HTML element and get it to work fine, so long as I use dummy xCoord and yCoord numbers and return something (not void). My code is actually popping up the "Success!" alert, but when I run a SQL query, there was no INSERT. Here is the Code from Default.aspx: function insertIntoDB(x, y) { try { $.ajax({ type: 'POST', url: 'Default.aspx/InsertPoints', data: "{'xCoord': '" + x + "', 'yCoord': '" + y + "'}", // '{"xCoord": "' + x + '", "yCoord": "' + y + '"}', success: function (data) { alert("Success!"); }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("Fail: " + textStatus); } }); } catch (e) { alert(e); } } Here is the C# code in Default.aspx.cs: [WebMethod] public static void InsertPoints(int xCoord, int yCoord) { string myConn = "Data Source=MYDATABASEINFO;Initial Catalog=DATABASENAME;Integrated Security=False;User ID=USERID;Password=MYPASSWORD"; SqlConnection myConnection = new SqlConnection(myConn); try { myConnection.Open(); SqlCommand myCommand= new SqlCommand("INSERT INTO DRAW (xCoord, yCoord) " + "Values (" + xCoord + ", " + yCoord + ");", myConnection); myCommand.ExecuteNonQuery(); myConnection.Close(); } catch(Exception e) { Console.WriteLine(e.ToString()); } } Thanks for your help.
downvote count: 1
tagged with: c#
has answer: http://stackoverflow.com/a/28378967
has comment: http://stackoverflow.com/comment/45092944
has comment: http://stackoverflow.com/comment/45093097
tagged with: javascript
has answer: http://stackoverflow.com/a/28379181
has comment: http://stackoverflow.com/comment/45092995
has comment: http://stackoverflow.com/comment/45093558
has title: Why isn't my C# function executing from ajax Javascript code?
has comment: http://stackoverflow.com/comment/45093194
possible better answer: http://stackoverflow.com/a/28378967
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28379157
accepted answer: http://stackoverflow.com/a/28379181
has comment: http://stackoverflow.com/comment/45092968

http://stackoverflow.com/a/28386462
answers question: http://stackoverflow.com/q/28386384
type: Answer
upvote count: 1
score: 1
downvote count: 0
has body: There's nothing wrong with doing the event binding the way you are. The reason you're losing the scope is because you did self = this; which created self as a global variable, in the constructor function. So every time you call the constructor it sets self to that instance. To fix it, set self as a local variable in your init function: MyObject.prototype = { init: function() { var self = this; // &lt;-- this is the fix $(this.element).click(function() { self.myfunct(); }); }

http://stackoverflow.com/comment/45162221
comment on: http://stackoverflow.com/q/28412671
type: Comment
type: QuestionComment
has text: @Xotic750 - Ok, thanks I will sure add the *jQuery tag*. --- Thank you very much for your outstanding help. - Then, when the `classList.add('follow');` appends `follow`, I still have some trouble in following the link afterwards, but can't figure out why (in-code).
score: 0

http://stackoverflow.com/q/28342582
has comment: http://stackoverflow.com/comment/45030320
has comment: http://stackoverflow.com/comment/45030554
type: Question
upvote count: 2
answer count: 2
has comment: http://stackoverflow.com/comment/45029923
has body: I'm trying to create ASP.NET MVC 4 Internet Application, in that application I have View for Registration , According to the selection of Role It should be able to disable few input fields in registration form , Ex: When user select Higher Education Council , It will be able to disable "University","Direct_Number","Mobile" fields Here my CSHTML Code including Jquery @model AFFEMS2_HEC.Models.RegisterViewModel @{ ViewBag.Title = "HEI_Registration"; Layout = "~/Views/Shared/_HEI_Registration.cshtml"; } } @ViewBag.Title. Add New Higher Education Institute @using (Html.BeginForm()) { @Html.AntiForgeryToken() @Html.ValidationSummary() Registration Form @Html.LabelFor(model => model.RoleName,"Please Select Type of the Role ") @Html.DropDownListFor(model => model.RoleName, new SelectList( new List<Object>{ new { value = "" , text = "Select" }, new { value = "HEC_Admin" , text = "Higher Edcuation Council" }, new { value = "HEI_User" , text = "Higher Education Institute"} }, "value", "text", "-"), new { id = "allDay" }) @Html.ValidationMessageFor(model => model.RoleName) @Html.LabelFor(model => model.UserName) @Html.EditorFor(model => model.UserName) @Html.ValidationMessageFor(model => model.UserName) @Html.LabelFor(model => model.University) @Html.EditorFor(model => model.University ,new { id = "University" }) @Html.ValidationMessageFor(model => model.University) @Html.LabelFor(model => model.Title) @Html.EditorFor(model => model.Title) @Html.ValidationMessageFor(model => model.Title) @Html.LabelFor(model => model.First_Name) @Html.EditorFor(model => model.First_Name) @Html.ValidationMessageFor(model => model.First_Name) @Html.LabelFor(model => model.Last_Name) @Html.EditorFor(model => model.Last_Name) @Html.ValidationMessageFor(model => model.Last_Name) @Html.LabelFor(model => model.Email) @Html.EditorFor(model => model.Email) @Html.ValidationMessageFor(model => model.Email) @Html.LabelFor(model => model.Direct_Number) @Html.EditorFor(model => model.Direct_Number ,new { id…
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45031515
has comment: http://stackoverflow.com/comment/45030147
has answer: http://stackoverflow.com/a/28342720
has comment: http://stackoverflow.com/comment/45029917
favorite count: 0
type: UnansweredQuestion
tagged with: razor
has title: disable/ enable input fields by drop down selection mvc 4
has answer: http://stackoverflow.com/a/28343083
has comment: http://stackoverflow.com/comment/45179833
tagged with: asp.net-mvc-4
score: 2
has comment: http://stackoverflow.com/comment/45029888
downvote count: 0
has comment: http://stackoverflow.com/comment/45029852
has comment: http://stackoverflow.com/comment/45030067

http://stackoverflow.com/comment/44967867
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28307735
has text: @Barmar I saw this from w3schools for the add element (http://www.w3schools.com/jsref/met_select_add.asp).

http://stackoverflow.com/comment/44941493
score: 0
comment on: http://stackoverflow.com/q/28294164
type: QuestionComment
has text: your controller `Index` action?
type: Comment

http://stackoverflow.com/q/28304747
has comment: http://stackoverflow.com/comment/44960675
answer count: 2
has comment: http://stackoverflow.com/comment/44960746
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44960768
has title: Why text starts a new line in li tag
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28304820
tagged with: css
has comment: http://stackoverflow.com/comment/44961030
has body: I have drop down menu which i created with the "ul" and "li" tags.But my text in the li tag starts a new line at every space in it.Here's the link to the code. var a=document.getElementById("hide"); var outside="false"; function showjs(){ if(visibil()==="false"){ a.style.display="inline-block"; } } function hidejs(){ if(visibil()==="true" & outside==="true"){ a.style.display="none"; } } function visibil(){ if (a.style.display==="none"){ return "false"; }else{ return "true"; } } ul{ list-style:none; } li{ position:relative } .cl-menu,ul{ margin:0;padding:0 } .cl-menu li a{ display:block; padding:10px } #menu{ background-color:gray; width:20%; } /*li:active>ul{ display:block; }*/ li>ul{ background-color:black } Mis pedidos Mi perfil Descuentos Albumes Here are generated new lines at every space Navidad 2014 Añadir al carrito Articulos seleccionados Finalizar Pedido So, I don't want those new lines and if it possible to be resolved without setting the width.Thank you.
has comment: http://stackoverflow.com/comment/44960686
has comment: http://stackoverflow.com/comment/44962807
accepted answer: http://stackoverflow.com/a/28304820
upvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44960632
score: 1
has comment: http://stackoverflow.com/comment/44960872
possible better answer: http://stackoverflow.com/a/28304813
type: Question
has answer: http://stackoverflow.com/a/28304813

marker
tag name: marker
tags question: http://stackoverflow.com/q/28430553
tags question: http://stackoverflow.com/q/28299256
type: Tag

http://stackoverflow.com/q/28361184
type: AnsweredQuestion
has title: should preloaded images with javascript specify its size on html code?
tagged with: javascript
tagged with: image
type: Question
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28361383
tagged with: http://stackoverflow.com/tag/html
has body: I know that when loading images with html, the image tag should always specify the height and width of the image to prevent problems and to improve the loading of the image. (I know that some developers think different, but this is not the post to argue about that) Currently I'm pre-loading some images with javascript: var flag_fr_path=main_deep+'-images/flag_french.jpg' var flag_fr_image= new Image(45,30); flag_fr_image.src = flag_fr_path; and then, I'm using them on my html code: &lt;img src="'+flag_es_path+'"&gt;&lt;/img&gt; My question is if the html tag should also specify the size of the image to make the browser to save its space? Or the fact of having specify the size in the javascript code makes the browser know everything?
accepted answer: http://stackoverflow.com/a/28361383

http://stackoverflow.com/q/28368689
has comment: http://stackoverflow.com/comment/45078499
downvote count: 0
possible better answer: http://stackoverflow.com/a/31996084
tagged with: javascript
tagged with: gulp-jscs
has answer: http://stackoverflow.com/a/31996084
answer count: 3
has body: I'm a novice at gulp, and trying to play with it. I get this error when I try to use gulp-jscs 'default' errored after 98 ms [16:58:00] TypeError: Object.keys called on non-object at Function.keys (native) at NodeConfiguration.Configuration._throwNonCamelCaseErrorIfNeeded (/home/kbadr/Node_Projects/demo/membership/node_modules/gulp-jscs/node_modules/jscs/lib/config/configuration.js:440:12) at NodeConfiguration.Configuration.load (/home/kbadr/Node_Projects/demo/membership/node_modules/gulp-jscs/node_modules/jscs/lib/config/configuration.js:51:10) at StringChecker.configure (/home/kbadr/Node_Projects/demo/membership/node_modules/gulp-jscs/node_modules/jscs/lib/string-checker.js:66:29) at Checker.configure (/home/kbadr/Node_Projects/demo/membership/node_modules/gulp-jscs/node_modules/jscs/lib/checker.js:26:39) at module.exports (/home/kbadr/Node_Projects/demo/membership/node_modules/gulp-jscs/index.js:31:11) at Gulp.&lt;anonymous&gt; (/home/kbadr/Node_Projects/demo/membership/gulpfile.js:22:15) at module.exports (/home/kbadr/Node_Projects/demo/membership/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:34:7) at Gulp.Orchestrator._runTask (/home/kbadr/Node_Projects/demo/membership/node_modules/gulp/node_modules/orchestrator/index.js:273:3) at Gulp.Orchestrator._runStep (/home/kbadr/Node_Projects/demo/membership/node_modules/gulp/node_modules/orchestrator/index.js:214:10 and here's my gulpfile var gulp = require('gulp'); var jscs = require('gulp-jscs'); gulp.task('default', function () { return gulp.src('src/app.js') .pipe(jscs()); });
tagged with: gulp
favorite count: 0
score: 8
has title: gulp-jscs Object.keys called on non-object
upvote count: 8
has comment: http://stackoverflow.com/comment/45078621
has comment: http://stackoverflow.com/comment/45079065
tagged with: node.js
has comment: http://stackoverflow.com/comment/45079422
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28647277
has comment: http://stackoverflow.com/comment/45078873
has answer: http://stackoverflow.com/a/36672066
type: Question
accepted answer: http://stackoverflow.com/a/28647277
has comment: http://stackoverflow.com/comment/45078392
tagged with: jscs

http://stackoverflow.com/q/28286825
has comment: http://stackoverflow.com/comment/44927820
accepted answer: http://stackoverflow.com/a/28286984
has comment: http://stackoverflow.com/comment/44927961
score: 0
has body: I have a simple table where is a checkbox at each line. If user click on this checkbox it use onClick function and send a information via JS to another PHP file to delete ROW with id = $id, it works correctly. Problem start when I click multiple checkboxes without refreshing a site. This is how HTML looks like: echo '&lt;td&gt;&lt;label class="checkbox-inline"&gt;&lt;input type="checkbox" id="check" value="'.$row["id"].'" onClick="aa()"&gt;&lt;/label&gt;&lt;/td&gt;'; This is how JQuery looks like: function aa() { var xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET", "delete.php?id=" + document.getElementById("check").value, false); xmlhttp.send(null); document.getElementById("d1").innerHTML=xmlhttp.responseText;; } And finaly my .php file: try { $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); $conn-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql = "DELETE FROM table1 WHERE id=$id"; $conn-&gt;exec($sql); echo "Record deleted successfully"; } catch(PDOException $e) { echo $sql . "&lt;br&gt;" . $e-&gt;getMessage(); } I am still just amater so maybe I'm thinking wrong but in my eyes this JS scould always send .php info when user clck ChekBox, so why it's not sending it like that? Thank you all for your advise.
answer count: 4
has comment: http://stackoverflow.com/comment/44927967
tagged with: php
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28286984
possible better answer: http://stackoverflow.com/a/28287066
has title: JS- onClick on multiple things
has answer: http://stackoverflow.com/a/28287066
has answer: http://stackoverflow.com/a/28286980
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28286912

http://stackoverflow.com/q/28325140
tagged with: javascript
has comment: http://stackoverflow.com/comment/45031345
has body: I am looking for a way to make a &lt;textarea&gt; expand as the user types, but when it expands i want it to push down all content below it. I managed to make it expandable as the user types (with javascript) but i can't make it push down content that it's below the textarea i am using a javascript code i took from another post here on stackoverflow: function setNewSize (textarea) { if (textarea.value.length &gt; 5){ textarea.cols = 90; textarea.rows = 15; } else { textarea.cols = 90; textarea.rows = 5; } } and then calling it in &lt;textarea onkeyup="setNewSize(this)"&gt;&lt;/textarea&gt;
has answer: http://stackoverflow.com/a/28325654
linked to: http://stackoverflow.com/q/19170083
answer count: 1
has comment: http://stackoverflow.com/comment/44998020
favorite count: 0
linked to: http://stackoverflow.com/q/5523145
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/28325654
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44998169
linked to: http://stackoverflow.com/q/7745741
score: 0
linked to: http://stackoverflow.com/q/2948230
upvote count: 1
has comment: http://stackoverflow.com/comment/45003713
downvote count: 1
type: Question
has title: Textarea that expands as you type and pushes down content below it

http://stackoverflow.com/a/32198513
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28367663
upvote count: 3
type: Answer
downvote count: 0
has body: The variables and functions are accessible in engine.Global.Properties. It does however also hold 'system variables'. By comparing the entries in the dictionary after you executed your script to the entries before you executed it you can get information about which variables and functions that was added.
score: 3
accepted answer of: http://stackoverflow.com/q/28367663

http://stackoverflow.com/q/28367754
upvote count: 9
tagged with: compound-assignment
has answer: http://stackoverflow.com/a/28367878
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45076542
score: 7
has answer: http://stackoverflow.com/a/28367839
type: Question
answer count: 8
downvote count: 2
has answer: http://stackoverflow.com/a/28367795
has body: Assignment a number to an attribute using the += operator gives me NaN in JavaScript. This code works as expected: &gt; var result = {}; undefined &gt; result['value'] = 10; 10 &gt; result['value'] += 10; 20 But here we get NaN: &gt; var test = {}; undefined &gt; test['value'] += 10; NaN Why does JavaScript behave like this? How can I get this to work without initializing result['value'] = 0?
has comment: http://stackoverflow.com/comment/45076441
tagged with: javascript
has answer: http://stackoverflow.com/a/28367825
has answer: http://stackoverflow.com/a/28367863
linked to: http://stackoverflow.com/q/27509
possible better answer: http://stackoverflow.com/a/28367795
has answer: http://stackoverflow.com/a/28368750
has title: Assigning using += gives NaN in javascript
has answer: http://stackoverflow.com/a/28367815
has answer: http://stackoverflow.com/a/59700608
accepted answer: http://stackoverflow.com/a/28367878
tagged with: nan
favorite count: 0

execution
tags question: http://stackoverflow.com/q/28374381
type: Tag
tags question: http://stackoverflow.com/q/28367604
tags question: http://stackoverflow.com/q/28426375
tag name: execution

http://stackoverflow.com/q/28398250
has answer: http://stackoverflow.com/a/28398365
score: 3
downvote count: 2
has comment: http://stackoverflow.com/comment/45132566
has answer: http://stackoverflow.com/a/58446697
type: Question
tagged with: google-maps
upvote count: 5
tagged with: javascript
has title: Move google maps marker on Places Auto-complete
tagged with: google-maps-api-3
has body: I currently have a map that displays a marker on the users geolocation. I have a text input field set to Places Auto-complete. When a user searches a city name, a new marker is placed on the location. However, the old gelocation marker remains. I want to delete the old marker or move it so only 1 marker is on the map. How can I do this? Here is my code:
answer count: 2
tagged with: google-geolocation
linked to: http://stackoverflow.com/q/12628994
favorite count: 0
tagged with: google-places-api
type: UnansweredQuestion

http://stackoverflow.com/q/28384414
score: 5
downvote count: 0
has answer: http://stackoverflow.com/a/76482841
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has title: UI Bootstrap Fade Carousel flashes white
has answer: http://stackoverflow.com/a/28435298
tagged with: css
answer count: 4
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/37325800
has comment: http://stackoverflow.com/comment/45108798
linked to: http://stackoverflow.com/q/19231678
has comment: http://stackoverflow.com/comment/45199688
type: Question
has answer: http://stackoverflow.com/a/74637977
upvote count: 5
tagged with: javascript
has body: I am trying to create a fade transition carousel for my website created with Bootstrap and AngularJS. I have created the effect but I keep getting this flash to white between each slide instead of a nice fade over the previous image. You can see an example of it here now (until the question is answered or I fix it up): http://development.artlyticalmedia.com/portfolio I am using UI Bootstrap because it makes Bootstrap play nice with AngularJS, which already makes most of the solutions out there inaccurate because my html looks like this: &lt;div class="container-fluid text-center" ng-controller="PortfolioCtrl" id="portfolio"&gt; &lt;carousel interval="interval" class="carousel-fade"&gt; &lt;slide ng-repeat="slide in slides" active="slide.active"&gt; &lt;img ng-src="{{slide.image}}" alt="{{slide.alt}}"&gt; &lt;/slide&gt; &lt;/carousel&gt; &lt;/div&gt; Notice that the &lt;carousel&gt; element is not present in a standard Bootstrap carousel; I believe it is a &lt;div class="carousel"&gt;. My SCSS, which ought to give the correct effect, looks like this: .carousel-fade { .carousel-inner { .item { transition-property: opacity; transition-duration: 1s; opacity: 0; } .active { opacity: 1; } .active.left, .active.right { left: 0; opacity: 0; z-index: 1; } .next.left, .prev.right { opacity: 1; } } .carousel-control { z-index: 2; } } My Javascript is pretty standard, except that I disable $animate because this was a fix I had to implement before. Here it is anyways: angular.module('comartlyticalmediawwwApp') .controller('PortfolioCtrl', function ($scope, $animate) { $scope.interval = 3000; $animate.enabled(false); $scope.animate = null; $scope.animateGlobal = true; $scope.slides = [ { image: 'images/portfolio/websites/3dsailing-Home.png', alt: 'plan' }, { image: 'images/portfolio/websites/3dsailing-SailCoachPro.png', alt: 'act' }, { image: 'images/portfolio/websites/3dsailing-3D-Printing.png', alt: 'done' }, { image: 'images/portfolio/websites/Glass-Planner-Home.png', alt: 'do…

http://stackoverflow.com/q/28319995
has comment: http://stackoverflow.com/comment/44992658
has comment: http://stackoverflow.com/comment/44993914
linked to: http://stackoverflow.com/q/22519784
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44993060
has comment: http://stackoverflow.com/comment/44993514
type: Question
has body: In the below function as you can see in the .save() part there is no response object, I would like to know how do i declare a response object to get a return value. $.when( _this.formWebsitePart.save({ success: function () { console.log("website saved") _this.formWebsitePart.isSaved = true; } }), _this.formAddressPart.save({ success: function () { console.log("address saved") } }) ).then(function () { _this.signupSuccess(); } )
has comment: http://stackoverflow.com/comment/44993102
score: 0
has comment: http://stackoverflow.com/comment/44992870
tagged with: jquery-deferred
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44994104
has comment: http://stackoverflow.com/comment/44992830
tagged with: backbone.js
tagged with: ajax
has comment: http://stackoverflow.com/comment/44992579
tagged with: promise
has comment: http://stackoverflow.com/comment/44994186
has answer: http://stackoverflow.com/a/28333239
has title: Response/request object for .save() in backbone.js

http://stackoverflow.com/q/28303866
tagged with: twitter-bootstrap-3
has title: Apply bootstrap.css/js ot Epub file
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28307826
tagged with: epub
has body: I use Epub.js for render epub files in web-browser. But I need use bootstrap styles in book(also needed popovers). Is this possible? Thank You!
score: 0
accepted answer: http://stackoverflow.com/a/28307826
answer count: 1
tagged with: twitter-bootstrap
type: AnsweredQuestion

http://stackoverflow.com/a/28374536
has body: You can submit a form from your page to an action on another server. This will bypass the login form on the target server all together $("#link").click(function() { var username = getCookie("username"); var password = getCookie("password"); $(" " + " " + " " + " " ).submit()
accepted answer of: http://stackoverflow.com/q/28374381
downvote count: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28374381
type: Answer
score: 3
upvote count: 3

http://stackoverflow.com/comment/45078505
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28368596
has text: It does not mean it is scopeless, it just uses parent scope. You can get it via `scope.vm` itself

http://stackoverflow.com/q/28280135
has comment: http://stackoverflow.com/comment/44914240
has title: JQuery button.click() handler fires without click
type: AnsweredQuestion
score: -1
type: Question
has comment: http://stackoverflow.com/comment/44914426
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: click
has answer: http://stackoverflow.com/a/28280242
accepted answer: http://stackoverflow.com/a/28280242
downvote count: 1
has body: Right now I'm doing some clean up code for my auction game, but my function is fired immediately after endAuction() is called rather than when the button is clicked. I can't seem to figure out why, and I'm not terribly familiar with JavaScript or jQuery, can anyone point out my issue? endAuction:function() { var i = 0; var btnID = "as" + (i).toString(), liID = "asli" + (i).toString(); var cleanBtn = $('li#' + liID + ' button#' + btnID); cleanBtn.text("Sold!"); var btn = $('#' + btnID); btn.off().click(this.cleanUpAuction()); }, cleanUpAuction:function() { console.log("Removing button"); userStats.money += currentBid; currentBid = 0; var i = 0; var liID = "asli" + (i).toString(); var carElement = $('li#' + liID); carElement.remove(); },
has comment: http://stackoverflow.com/comment/44914274
favorite count: 0
upvote count: 0

http://stackoverflow.com/a/28283164
score: 0
has body: You can make the lint task fail when there are lint errors using the emitError option, and then you can make the js task depend on the lint task: gulp.task('lint', function() { return gulp.src(paths.js) .pipe(jslint.run({ node: true, vars: true })) .pipe(jslint.report({ reporter: require(stylish).reporter, emitError: true })); }); gulp.task('js', ['lint'], function() { //js stuff }); gulp.task('watch', function() { gulp.watch(paths.js, ['js']); });
has comment: http://stackoverflow.com/comment/44924681
type: Answer
has comment: http://stackoverflow.com/comment/44963009
answers question: http://stackoverflow.com/q/28283053
has comment: http://stackoverflow.com/comment/45006537
has comment: http://stackoverflow.com/comment/44945230
has comment: http://stackoverflow.com/comment/44921386

http://stackoverflow.com/a/28345758
type: Answer
has comment: http://stackoverflow.com/comment/45037714
has comment: http://stackoverflow.com/comment/45036331
has comment: http://stackoverflow.com/comment/45036930
has comment: http://stackoverflow.com/comment/45036394
has comment: http://stackoverflow.com/comment/45037112
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45035952
has comment: http://stackoverflow.com/comment/45036066
has comment: http://stackoverflow.com/comment/45037793
has comment: http://stackoverflow.com/comment/45037031
has comment: http://stackoverflow.com/comment/45038985
has comment: http://stackoverflow.com/comment/45037216
answers question: http://stackoverflow.com/q/28345628
downvote count: 0
has comment: http://stackoverflow.com/comment/45036166
has body: you cant use id of #messages if there are multiple &lt;div&gt; messages you want to get the text from. instead, use class .messages since you tagged jQuery, im assuming youre open to using it, and .each() is a function that loops through each of the selector elements so something like this: var msgs = []; // initialize array $('.messages').each(function() { msgs.push($(this).text()); // add the text in this specific message div into the array }); if you want just one long string, then construct a string instead of an array.
has comment: http://stackoverflow.com/comment/45037481
has comment: http://stackoverflow.com/comment/45039556
has comment: http://stackoverflow.com/comment/45036498

http://stackoverflow.com/comment/45009524
comment on: http://stackoverflow.com/q/28331148
score: 5
type: Comment
type: QuestionComment
has text: `valueOf` is a function that is called when the object is converted to a number. The result of the conversion is the return value of the function. (your object is an object literal in your case.) If you don't provide such a function, it won't be converted to a number. (In the second case, you don't have an object literal, you have a syntax error, and in the 3rd case, your `valueOf` member is not a function, hence it cannot be called.)

http://stackoverflow.com/comment/45042031
comment on: http://stackoverflow.com/a/28348216
type: AnswerComment
score: 0
type: Comment
has text: kindly have a look at the question, i have updated it with a new plunkr. thanks.

http://stackoverflow.com/comment/45581154
type: Comment
has text: Can you describe what parts of code match to steps of algorithm? I still cannot describe how part 4 works in Sencha code.
comment on: http://stackoverflow.com/a/28355003
score: 1
type: AnswerComment

http://stackoverflow.com/q/28385063
has title: jquery plugin Pace.js not working
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45107956
tagged with: jquery
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/28394646
accepted answer: http://stackoverflow.com/a/28385365
score: 3
tagged with: plugins
has body: i am using jquery plugin pace.js, and i want that when the page is load then first the progress bar is loaded after that the content will shown, this is my code the jsfiddle will define the result of my work. in my case the content and progress bar both will show simultaneously. What i want: i want that first the progress bar will show and after the complition of progress bar the content will show like in this website. Update: This is what i try next but when the progress is complete then it will not show any contents... bk
answer count: 3
has comment: http://stackoverflow.com/comment/45107903
downvote count: 1
has answer: http://stackoverflow.com/a/38670573
has answer: http://stackoverflow.com/a/28385365
tagged with: javascript
upvote count: 4
possible better answer: http://stackoverflow.com/a/38670573

http://stackoverflow.com/comment/45176523
score: 0
type: QuestionComment
type: Comment
has text: Where is your script to handle the upload? You are missing the url property of your ajax config, you have to put your (php) script path in this property and the script has to be set up to handle the upload. Also make sure your html document is html5 or this method won't work. Check the example you cited again.
comment on: http://stackoverflow.com/q/28421278

http://stackoverflow.com/comment/45136416
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28398908
has text: Hi @Sharikov Vladislav, thanks for the comment. I did some research before asking and I found what you mention about services, but I'm following a tutorial where they use $rootScope and it seemed strange that I wasn't able to read the value I stored there. I know that using global variables is not a good idea :) I'm not very familiar with Plunker but I'll give it a try and edit with the results.

http://stackoverflow.com/q/28295139
score: 0
upvote count: 1
has body: I'm trying to change my 'send' button which onClick sends a message from an input box to a div, to also trigger the click of a 'checkbox' input. HTML Post *These buttons are actually in a form JS function copyStory(ch) { if (ch.checked) var text1 = document.getElementById("message-input").value; else text1 = ''; document.getElementById("stry").value = text1; } I've searched around but I can't find a way to make the send button trigger the checkbox, any suggestions?
answer count: 1
downvote count: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28295409
accepted answer: http://stackoverflow.com/a/28295409
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44942767
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44943237
type: Question
has title: Trigger checkbox click with button
tagged with: javascript

http://stackoverflow.com/comment/45014341
type: QuestionComment
score: 0
has text: possible duplicate of [Using HTML5/Javascript to generate and save a file](http://stackoverflow.com/questions/2897619/using-html5-javascript-to-generate-and-save-a-file)
comment on: http://stackoverflow.com/q/28333729
type: Comment

http://stackoverflow.com/a/30565066
answers question: http://stackoverflow.com/q/28412947
has body: I found the solution for this problem, i had to deploy my code to the server, i was trying it on my localhost that is way it always gave me 100%
score: 0
type: Answer

http://stackoverflow.com/comment/45101186
has text: if you have found a solution than request you to Add your findings as an answer. This will help other members to solve similar issues.
comment on: http://stackoverflow.com/q/28375536
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28394118
tagged with: angularjs
upvote count: 1
has body: Directive code mymodule.directive('eicon', function(){ return { restrict: 'E', scope: { attr: '=' }, template: "test " + attr.name } }); Html I've this error: ReferenceError: attr is not defined. What's wrong?
tagged with: angularjs-directive
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/28394192
has answer: http://stackoverflow.com/a/28394154
type: Question
answer count: 2
has title: AngularJS directive scope not resolved ("attr name is not defined" error)
downvote count: 0
possible better answer: http://stackoverflow.com/a/28394154
tagged with: javascript
has answer: http://stackoverflow.com/a/28394192
favorite count: 0

http://stackoverflow.com/comment/45098049
comment on: http://stackoverflow.com/q/28378979
has text: See also: http://stackoverflow.com/questions/475033/detecting-programming-language-from-a-snippet
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45049507
comment on: http://stackoverflow.com/a/28352762
score: 0
type: AnswerComment
has text: @lujcon Yes that is an option too
type: Comment

http://stackoverflow.com/comment/109045647
type: QuestionComment
score: 0
has text: To become less confused: https://gis.stackexchange.com/questions/334002/cesium-projection-system To become more confused: https://groups.google.com/forum/#!topic/cesium-dev/a7QjKQ1Dt1M
type: Comment
comment on: http://stackoverflow.com/q/28358403

http://stackoverflow.com/q/28332778
answer count: 1
type: AnsweredQuestion
downvote count: 0
score: 1
has title: Uncaught TypeError: Cannot set property 'innerHTML' of null- when setting the innerhtml to a string from an array
favorite count: 0
accepted answer: http://stackoverflow.com/a/28332853
type: Question
has body: In the following code I am trying to set the cat names in a way that doesn't hardcode them to the html. Because of that I am using an array. however whenever I try to set the innerHTML properties to catNames[0] or catNames[1] I get an error. I don't know why it doesn't evaluate that array and find the string and put that on the page. HTML Cat Clicker y You have clicked 0 times x You have clicked 0 times Javascript (function(){ var image = document.getElementById('cat'), image2= document.getElementById('cat2'), clicks1= document.getElementById('counter1'),clicks2= document.getElementById('counter2'), counterNumber1=0, counterNumber2=0, catNames=["Javi","Esteban"], name1= document.getElementById('createname1'), name2= document.getElementById('createname2'); name1.innerHTML= catNames[0]; name2.innerHTML= catNames[1]; function imageClickHandler() { counterNumber1++; clicks1.innerHTML= counterNumber1; } function imageClickHandler2() { counterNumber2++; clicks2.innerHTML= counterNumber2; } image.addEventListener('click',imageClickHandler,false); image2.addEventListener('click',imageClickHandler2,false); })();
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/28332853
upvote count: 1

http://stackoverflow.com/q/28391313
has body: Not sure if it's my profound misunderstanding of React events or an actual bug, but mouse events registered on the parents sometimes fire on the children. In the bin below, mousing around the two divs will eventually result in the inner div getting highlighted red, even though it doesn't have an event trigger for attaching the ui-hover class (though its parent does). http://jsbin.com/vemopo/1/edit?css,js,output
tagged with: javascript
tagged with: reactjs
answer count: 1
downvote count: 0
tagged with: dom-events
has answer: http://stackoverflow.com/a/28393037
accepted answer: http://stackoverflow.com/a/28393037
favorite count: 0
has title: React mouse events fired on components not listening for them
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question

http://stackoverflow.com/comment/45133561
comment on: http://stackoverflow.com/a/28398942
has text: Well, _this_ and _that_ selector do the same thing.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28388827
accepted answer of: http://stackoverflow.com/q/28388810
type: Answer
has body: Use plain CSS: .item-input:focus { background-color: yellow; } &lt;input class="item-input" type="text" /&gt; But if you want to use jQuery, listen to the focus event: $('.item-input').on('focus blur', function() { $(this).toggleClass("input-focus"); }); .input-focus { background-color: yellow; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;input class="item-input" type="text" /&gt; I replaced the .addClass() method with the .toggleClass() method under the impression that you want the class removed on blur.
score: 5
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45115186
has comment: http://stackoverflow.com/comment/45115175
has comment: http://stackoverflow.com/comment/45115206
downvote count: 0
answers question: http://stackoverflow.com/q/28388810
upvote count: 5

http://stackoverflow.com/a/28391235
upvote count: 1
has comment: http://stackoverflow.com/comment/45132540
has comment: http://stackoverflow.com/comment/45132544
has comment: http://stackoverflow.com/comment/45132115
has comment: http://stackoverflow.com/comment/45119940
has body: You can use something like this, get the scroll top and scrollHeight if scroll top greater than scrollHeight reset it to 0 jQuery(document).ready(function() { var div = jQuery('#scroll'); setInterval(function(){ var pos = div.scrollTop(); var scrollHeight = div.prop("scrollHeight") - div.height(); if(pos &lt; scrollHeight) { div.scrollTop(pos + 2); } else { div.scrollTop(0); } }, 200) });
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45132853
has comment: http://stackoverflow.com/comment/45133063
has comment: http://stackoverflow.com/comment/45132384
type: Answer
has comment: http://stackoverflow.com/comment/45132580
accepted answer of: http://stackoverflow.com/q/28391172
answers question: http://stackoverflow.com/q/28391172
has comment: http://stackoverflow.com/comment/45120578
score: 1

http://stackoverflow.com/q/28398770
has body: In jquery I am trying to clear a field, but if I do, it throws an error. It does make the field go empty, but also throws an error. How can I fix that? Thanks HTML &lt;input name="file" type="file" accept="image/*"&gt; JS var input = $("#profile-edit-form").find("input[name=file]"); var fileName = input.val(); if(fileName) { // returns true if the string is not empty input.replaceWith(input.val('').clone(true)); } ERROR NotFoundError: Node was not found -jquery.min.js:3:0
possible better answer: http://stackoverflow.com/a/28398942
has answer: http://stackoverflow.com/a/28398942
has comment: http://stackoverflow.com/comment/45133350
accepted answer: http://stackoverflow.com/a/28398861
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/1043957
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28398861
score: 0
tagged with: http://stackoverflow.com/tag/html
has title: how to clear an input file field in jquery?

http://stackoverflow.com/comment/44977190
has text: Still does not load asynchronously though. Could this be an issue with turbolinks?
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28311541
type: AnswerComment

http://stackoverflow.com/comment/45151931
type: Comment
type: QuestionComment
has text: Have you any demo will help more.
score: 4
comment on: http://stackoverflow.com/q/28409120

http://stackoverflow.com/comment/44943033
type: QuestionComment
has text: sorry but I did not quite what your question is. Can you clarify?
comment on: http://stackoverflow.com/q/28295241
score: 0
type: Comment

http://stackoverflow.com/comment/88163678
type: Comment
comment on: http://stackoverflow.com/q/28369836
type: QuestionComment
score: 0
has text: It's a joke that you can't create an accordion with Bootstrap out the box without passing a unique identifier.

http://stackoverflow.com/q/28340633
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45026497
tagged with: css
answer count: 4
score: 2
downvote count: 0
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/28340746
has body: I create the following text input: &lt;input type="text" class="signup-input text-value" name="" placeholder="e.g. example@url.com"&gt; I have to implement a delete function (with an "x" icon which is displayed in the end of the input).
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28340714
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28341109
has title: How to insert a delete icon to text input and implement deleting text
favorite count: 0
has answer: http://stackoverflow.com/a/28340904

http://stackoverflow.com/q/28343261
has comment: http://stackoverflow.com/comment/45033672
has title: PHP Cascading drop downs not working giving mysql_error
has comment: http://stackoverflow.com/comment/45032359
answer count: 0
has comment: http://stackoverflow.com/comment/45032306
has comment: http://stackoverflow.com/comment/45031502
tagged with: mysql
has body: I have build cascading drop downs via ajax but it is not working.... Project * <?php $project_name=mysql_query("select main_unit_id,project_name from main_unit"); ?> --Select Project -- <?php while($rows=mysql_fetch_array($project_name)) { ?> <option value="<?php echo $rows['main_unit_id']; ?>"><?php echo $rows["project_name"]; ?> <?php } ?> ?> </td Project * </td and fetch_activity.php is this. <?php include "conn/conn.php"; $main_unit_id = trim(mysql_escape_string($_POST["main_unit_id"])); $main_unit_id = mysql_real_escape_string($_POST['main_unit_id']); $result = mysql_query("SELECT activity_id, activity_name FROM activities WHERE main_unit_id = '".$main_unit_id."'"); if($result === FALSE) { die(mysql_error()); // TODO: better error handling } ?> -- Select Activity -- <?php while($row = mysql_fetch_array($result)) { ?> <option value="<?php echo $row["activity_id"]; ?>"><?php echo $row["activity_name"]; ?> <?php } ?> <?php } ?> the problem is after fetching the first dropdown values it doesn't show the next, i have see the chrome console there is no errors there also. I have seen it in chrome developer tool, the fetch_activity.php file is accept data in request, but didn't return any response.
type: Question
has comment: http://stackoverflow.com/comment/45031526
has comment: http://stackoverflow.com/comment/45032631
has comment: http://stackoverflow.com/comment/45036802
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45032684
has comment: http://stackoverflow.com/comment/45032671
tagged with: jquery
tagged with: ajax
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45031213
tagged with: php
has comment: http://stackoverflow.com/comment/45032751

http://stackoverflow.com/comment/45151067
has text: Thanks a lot, this solution helped me solve the problem the way i had in mind for now :)
comment on: http://stackoverflow.com/a/28408323
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28401088
type: Answer
accepted answer of: http://stackoverflow.com/q/28401009
upvote count: 4
score: 4
answers question: http://stackoverflow.com/q/28401009
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45137863
has body: e.style refers to the style attribute of the div (style="..."). First time through, there is no style attribute on the div. The condition is false and the code sets a style attribute of: &lt;div style="display: block"&gt; The second time through, the if condition is true, and the style of the block is set to "none". So it disappears.

http://stackoverflow.com/a/28351652
downvote count: 0
score: 3
answers question: http://stackoverflow.com/q/28351515
upvote count: 3
has body: If you are using jQuery, it is very easy - you need just register the right function on the right event :) Here's the code: &lt;input id="foo" /&gt; &lt;input id="bar" /&gt; $(function(){ var $foo = $('#foo'); var $bar = $('#bar'); function onChange() { $bar.val($foo.val()); }; $('#foo') .change(onChange) .keyup(onChange); }); JSFiddle: http://jsfiddle.net/6khr8e2b/
type: Answer
has comment: http://stackoverflow.com/comment/45047023

http://stackoverflow.com/comment/45215112
type: AnswerComment
type: Comment
has text: See http://jsfiddle.net/ztzfn2ur/ This may come close to what you're trying to achieve. However, there may be a bug in how it handles `maxFontPixels`. Note how it overflows on the sentence, "For the next 60 seconds..." Remove `maxFontPixels`, and it no longer overflows, but then you're stuck with the default maximum of 40px.
comment on: http://stackoverflow.com/a/28375201
score: 0

http://stackoverflow.com/comment/45337653
score: 0
has text: I appreciate all of your ideas. Yes, I'm still where I left off, but I've had to move on. The users are just going to have to live with the screen popping back to the top every time. It's interesting that it seems to work for a lot of people. They're probably just a whole bunch smarter!
comment on: http://stackoverflow.com/a/28351299
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/45038457
comment on: http://stackoverflow.com/a/28346957
type: AnswerComment
score: 0
type: Comment
has text: I doesnt have features that i need. I want to have 14custom pins on map, conposer allows only 1, and i have no ability to add api key, for more maps.

http://stackoverflow.com/comment/45181422
has text: I can not get the value of `myLocation` :(
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28424135
type: AnswerComment

http://stackoverflow.com/a/28445705
score: 0
has body: echo xml input ? var xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> 123 "; $.post("/echo/xml/", {xml:xml}, "xml") .then(function(xml) { var res = $(xml).find(":root") , popup = window.open("", "popup", "width=600,height=400"); popup.document.body.innerHTML = res.get(0).outerHTML; popup.focus(); popup.print(); }); jsfiddle http://jsfiddle.net/guest271314/trsvLmhm/ See js window.open then print()
type: Answer
answers question: http://stackoverflow.com/q/28433401

http://stackoverflow.com/a/28399714
has body: $("#getdata-button").click(function() { $.getJSON('json_data.txt', function(read_data) { $("#choise1").html(read_data.result[0].option + read_data.result[0].percent); $("#choise2").html(read_data.result[1].option + read_data.result[1].percent); }); }); Probably the easiest solution for you. If you have more than just 2 entries you might want to iterate over it with "for" like this: for(var i = 0; i &lt; read_data.result.length; i++) { //Access the json like this: //read_data_result[i] }
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28399571
type: Answer
score: 1

http://stackoverflow.com/q/28330285
has title: Destroy constructor instances
tagged with: instances
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28330475
has comment: http://stackoverflow.com/comment/45007976
has answer: http://stackoverflow.com/a/28330475
favorite count: 0
tagged with: constructor
upvote count: 1
has answer: http://stackoverflow.com/a/28330477
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28330477
has body: function ConstructMe(msg) { this.message = msg; } instances = { instance1: new ConstructMe('msg1'), instance2: new ConstructMe('msg2'), instance3: new ConstructMe('msg3'), instance4: new ConstructMe('msg4'), instance5: new ConstructMe('msg5') } If I have this Constructor, and I build instances of it in an object (as shown above), how would I go about destroying them later on? I want to make sure that they are no longer accessible, but also to make sure they are no longer somewhere uselessly. Would deleting the object work? Or the instances would just remain somewhere on the memory nameless? In my case, I create many instances along certain actions in an app, I want to make sure I keep the memory clean and don't leave things hanging around, cluttering... Looking forward to your feedback
tagged with: oop
score: 1

http://stackoverflow.com/a/28408067
answers question: http://stackoverflow.com/q/28407031
score: 4
upvote count: 4
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45156056
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45156181
has body: Use spyOn(mockTranslationService, 'getLanguages').and.returnValue(deferred.promise); instead. It also makes more sense to resolve the promise after the getLocations() has been called rather than before getLocations() returns the promise. You should also check the languages. inject(function($q) { deferred = $q.defer(); mockTranslationService.languages = [ { name: 'slovak' }, { name: 'czech' } ]; mockTranslationService.languagesWithWords = [{ name: 'slovak', words: [{ key: 'Car', translation: 'Auto', createdOn: 0 }, { key: 'Flower', translation: 'Kvet', createdOn: 0 }] }, { name: 'czech', words: { key: 'Plaza', translation: 'Namesti', createdOn: 0 } }]; mockTranslationService.getLanguages = function () { }; spyOn(mockTranslationService, 'getLanguages').and.returnValue(deferred.promise); }); it('should get the language array', function() { createController(); deferred.resolve(); scope.$digest(); expect(translationService.getLanguages).toHaveBeenCalled(); expect(scope.languages).toEqual(translationService.languages); }); Plunkr
accepted answer of: http://stackoverflow.com/q/28407031

http://stackoverflow.com/a/28381825
has comment: http://stackoverflow.com/comment/45103606
has comment: http://stackoverflow.com/comment/45102571
has comment: http://stackoverflow.com/comment/45102992
has comment: http://stackoverflow.com/comment/45102716
has comment: http://stackoverflow.com/comment/45102429
has comment: http://stackoverflow.com/comment/45102956
score: 0
has comment: http://stackoverflow.com/comment/45102835
type: Answer
has comment: http://stackoverflow.com/comment/45102913
has body: Based upon the answers and comments on the page I would suggest this: el.mouseup(function(e){ $('[el-button]').click(function(e){ e.preventDefault(); }); if (($this).prev(".in").length == 0) { var _toolbar = new Toolbar({link: el}); var toolbar = _toolbar.render(); toolbar.addClass('in'); $('body').prepend(toolbar); toolbar.css({ left: el.offset().left, top: el.offset().top - toolbar.height() - 10 }); setTimeout(function(){ $(document).on('mouseup', function(e){ if($(e.target).closest(toolbar).length == 0){ $(el).unbind('click', arguments.callee); toolbar.removeClass('in'); toolbar.remove(); } }); }, 100); } }); The element Toolbar has a class name called in. I don't know the further mark up of that element, so you can change that. If there is an previous sibling on the page (before element el) with class name in do not execute the code.
answers question: http://stackoverflow.com/q/28381524
has comment: http://stackoverflow.com/comment/45102340
has comment: http://stackoverflow.com/comment/45102323

http://stackoverflow.com/comment/45159928
type: Comment
has text: Assume you've registered a `click` event handler and you're also using another plugin that registers its own `click` handler (say Bootstrap dialog / modal for example). Now you want to unbind your handler, simply calling `off('click')` would disable all `click` handlers (including the plugin handler), using a namespace lets you identify the handler specifically, not just simply *the click* handler but *my named click* handler.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28413010

http://stackoverflow.com/a/28350334
upvote count: 5
score: 3
answers question: http://stackoverflow.com/q/28350292
has body: Array has a length property : [].length // 0 [0].length // 1 [4, 8, 15, 16, 23, 42].length // 6
downvote count: 2
type: Answer

http://stackoverflow.com/q/28430403
has title: Get selected items from checkbox list with jQuery
has answer: http://stackoverflow.com/a/28430638
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45191598
has body: How to get the selected items values of checkBoxList in button click event in jquery... &lt;asp:CheckBoxList ID="check_list" runat="server"&gt; &lt;asp:ListItem Text ="One" Value="1"&gt;&lt;/asp:ListItem&gt; &lt;asp:ListItem Text ="Two" Value="2"&gt;&lt;/asp:ListItem&gt; &lt;asp:ListItem Text ="Three" Value="3"&gt;&lt;/asp:ListItem&gt; &lt;/asp:CheckBoxList&gt; &lt;input type="button" id="btn_click" value="Click"/&gt;
upvote count: 1
has comment: http://stackoverflow.com/comment/45191644
downvote count: 1
has answer: http://stackoverflow.com/a/28430452
type: Question
has comment: http://stackoverflow.com/comment/45192677
answer count: 2
tagged with: javascript
tagged with: jquery
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/45191576
score: 0

http://stackoverflow.com/q/28304521
tagged with: php
downvote count: 1
has title: How to get php $_POST['VARIABLE'] where input name is also a variable
has answer: http://stackoverflow.com/a/28304591
score: -1
type: Question
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44960282
tagged with: mysqli
answer count: 1
favorite count: 0
type: UnansweredQuestion
has body: I have a form with JS like document.getElementById("demo").innerHTML = '&lt;input type="hidden" name="qc" value='+qs+'&gt;'; for(count=1; count&lt;=qs; count++) { document.getElementById("demo").innerHTML += '&lt;br&gt;&lt;font style="font-size: 20px"&gt;'+ count+'. &lt;input class="textboxtest" style="width:850px;" type="text" name=" q'+ count +' " placeholder="Question "&gt;&lt;br&gt;' ; } I want to insert the textbox value in database with mysqli and PHP. My PHP code is $count = $_POST['qc']; for($i= 1; $i &lt;= $count ; $i++) { $ques ="q".$i; $qs = $_POST[$ques]; mysqli_query($conn,"INSERT INTO ques ('".$qs."') VALUES ('".$qs."')"); } I am getting error like Undefined index: q1 . Undefined index: q2 and so on as the value of the count increase. My question is how to insert textbox value into database with that textbox name which is a variable.

http://stackoverflow.com/comment/45037295
type: Comment
has text: Thank you, Jonathan Crowe, NietzscheProgrammer and Blex very much! It works now. When I click on the first button, it generates the first table, but when I click on second button, it generates the first table, also. It sounds like it looks for the first class, only. Any idea?
comment on: http://stackoverflow.com/a/28332273
score: 0
type: AnswerComment

http://stackoverflow.com/q/28338962
has body: I would like to dynamically resize iframes based on content size from the parent. I have access to both the parent (source) and child (target) websites/servers. However, they are cross-domain servers. They both are on different domains. I don't really know how to use jQuery. Is there perhaps an easy to follow tutorial?
accepted answer: http://stackoverflow.com/a/28340148
tagged with: php
has comment: http://stackoverflow.com/comment/45054025
has comment: http://stackoverflow.com/comment/45023508
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45023935
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45023936
has answer: http://stackoverflow.com/a/28340148
tagged with: javascript
tagged with: jquery
score: -1
has title: Dynamically resize iframes in a cross-domain site
answer count: 2
upvote count: 0
possible better answer: http://stackoverflow.com/a/28339312
has comment: http://stackoverflow.com/comment/45023541
has answer: http://stackoverflow.com/a/28339312
favorite count: 0

http://stackoverflow.com/comment/101228451
has text: @Jasper, "refused to learn" is an assumption. (I learned and made a conscious decision to add and use `any()`.) One could argue that when there's a flaw in design of tools being used it is perfectly fine to fix them. I agree that extending the prototype can be a problem (if overused, if done in unexpected ways, if does not fail if function being added is already defined, ...). As can be almost anything else (I suppose you don't refuse declaring functions because their names can collide with something in the future?). *continued...*
type: Comment
comment on: http://stackoverflow.com/a/34588812
score: 0
type: AnswerComment

http://stackoverflow.com/q/28329424
linked to: http://stackoverflow.com/q/5045053
answer count: 1
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45006462
has answer: http://stackoverflow.com/a/28330341
has title: read javascript cookie with PHP on the same page
type: UnansweredQuestion
tagged with: php
has body: I have a page, return.php. It has a line of HTML as follows: <a href="#" dataP="<?= $partNumber[$x] ?>" onclick="popup(this)"><?= substr($avgCost[0],0,6) ?> onclick, this calls the following popup function: function popup(windowname) { document.cookie = 'popupPartNumber='+windowname.getAttribute("dataP")+'; expires=Wed, 1 Jan 2070 13:47:11 UTC; path=/' var x = document.cookie; console.log(x); windowname = 'popUpDiv'; blanket_size(windowname); window_pos(windowname); toggle('blanket'); toggle(windowname); } on this same page, this loads: <?php $popupPartNumber = $_COOKIE['popupPartNumber']; echo " "; echo htmlentities($_COOKIE['popupPartNumber'], 3, 'UTF-8'); echo " "; ?> When I start this out and I click on the HTML link, I get a console.log output that says: PHPSESSID=cvbt1gvisul27nccenaeum1hh0; popupPartNumber=123456789 but my php echo output says: null Why is the cookie that I'm setting correctly in javascript not available to php? Update I changed return.php to say: $popupPartNumber = $_POST['popupPartNumber']; //part number line echo " "; echo "value is: " . $popupPartNumber ; echo " "; and I changed the script to read: var x = windowname.getAttribute("dataP"); $.ajax({ type: 'POST', url: 'return.php', data: {popupPartNumber:x}, success:function(data){ alert(data); } }); console.log(x); //outputs the correct number. This isn't working though... I still get no value to the php variable.
tagged with: cookies
has comment: http://stackoverflow.com/comment/45006347
has comment: http://stackoverflow.com/comment/45006414
has comment: http://stackoverflow.com/comment/45006391
has comment: http://stackoverflow.com/comment/45006399
type: Question

http://stackoverflow.com/q/28375766
has title: Javascript working on Safari but not on any other browser
tagged with: css
has comment: http://stackoverflow.com/comment/45091982
has body: I'm using requestAnimationFrame in Javascript for moving an html div by changing its "top" and "left" CSS properties. It works fine on Safari 7.1.2 but the div doesn't move a bit on Firefox, Chrome or Opera. The crazy thing is that, on Chrome and Opera, if you drag the corner of the window (attempting to change its size) the div starts to move... and then immediatly stops moving when you release the mouse from the corner. Here's the source code: exp_2 gallery and here's the CSS class and ids I've been using: body { text-align: center; background-color: #232323; color: white; } #menu_text { font-family: Trebuchet MS, Helvetica, Arial; font-size: 1.5em; padding-top: 2em; } .box_out { box-shadow: 2px 4px 15px black; margin-left: auto; margin-right: auto; position: absolute; text-align: center; width: 6em; height: 6em; background-color: #663300; -webkit-transition: 0.1s ease-out; -moz-transition: 0.1s ease-out; -o-transition: 0.1s ease-out; } .box_out:hover { -webkit-transform: scale(1.4); -moz-transform: scale(1.4); -o-transform: scale(1.4); -ms-transform: scale(1.4); } Is requestAnimationFrame the problem or is there some compatibility issue with my CSS? I even tried leaving out the event listener for the clientWidth but the problem doesn't seem to be here.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28375962
has comment: http://stackoverflow.com/comment/45091876
type: Question
has answer: http://stackoverflow.com/a/28376394
tagged with: requestanimationframe
possible better answer: http://stackoverflow.com/a/28375887
tagged with: javascript
has answer: http://stackoverflow.com/a/28375887
score: 0
answer count: 3
accepted answer: http://stackoverflow.com/a/28375962

http://stackoverflow.com/a/28372234
type: Answer
score: 2
answers question: http://stackoverflow.com/q/28356745
upvote count: 2
downvote count: 0
has body: Which version of the Firebase web client library are you using? Per the Firebase Web Client Changelog, the FirebaseRef.limitToLast() method was added in v2.0.0 / Nov. 4, 2014.

http://stackoverflow.com/comment/45053470
comment on: http://stackoverflow.com/q/28354451
score: 0
has text: Thanks @SimpleJ - pretty obvious!
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28420496
has answer: http://stackoverflow.com/a/28420616
score: 0
answer count: 3
upvote count: 1
has comment: http://stackoverflow.com/comment/45174261
downvote count: 1
tagged with: jquery
favorite count: 0
tagged with: ajax
has body: I'm struggeling making my form to preven double submision if i press rly fast the button that triggers the click call. I tried to disable the button after succes but it still send it twice. Here is my code:
accepted answer: http://stackoverflow.com/a/28420739
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28420720
possible better answer: http://stackoverflow.com/a/28420616
has answer: http://stackoverflow.com/a/28420739
has title: Ajax data form serialize prevent double submit
type: Question
has comment: http://stackoverflow.com/comment/45175713
tagged with: javascript

http://stackoverflow.com/q/28394340
has comment: http://stackoverflow.com/comment/45132797
has comment: http://stackoverflow.com/comment/45136300
has comment: http://stackoverflow.com/comment/45136206
type: Question
score: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45136508
has comment: http://stackoverflow.com/comment/45136398
has body: I want to play a sound file on the client side whenever the space bar is pushed. The client side successfully emits the 'bang' event when the space bar is pressed: $(window).keydown(function(event){ alert(event.keyCode); if (event.keyCode == 32){ socket.emit('bang'); } }); The server side succesfully prints "bang" in the control.log so hopefully it is also emitting 'play': io.on('connection', function(socket){ socket.on('bang', function(){ console.log('bang'); io.emit('play'); }); }); However, back on the client side to play the sound, nothing is happening. The code I am using is: var sound = new Audio('/public/audio/1.mp3'); socket.on('play', function () { sound.play(); }); Do I need to include something in the body to do with audio or a in order to use the Audio object. I have searched this quite thoroughly but I am very new to node.js, html and socket.io. I tried the advice given here: Play Audio from client when message is recieved from socket.io - node.js But when I put in: app.use('/public', express.static('/path/to/public')); 'static' became flagged and upon trying to run the code I recieved an error message: 'express is not defined, even though I put it before: app.get('/', function(req, res){ res.sendFile(__dirname + '/index.html'); }); as advised in that post. I also tried it after and got the same error. Please help me.
linked to: http://stackoverflow.com/q/24186848
tagged with: node.js
favorite count: 0
has comment: http://stackoverflow.com/comment/45135796
has answer: http://stackoverflow.com/a/78765311
has comment: http://stackoverflow.com/comment/50804666
has comment: http://stackoverflow.com/comment/45134859
has comment: http://stackoverflow.com/comment/45132283
downvote count: 2
has comment: http://stackoverflow.com/comment/45130864
answer count: 1
has title: How to play a sound from a socket.io event?
tagged with: socket.io
has comment: http://stackoverflow.com/comment/45130788
has comment: http://stackoverflow.com/comment/45131701
has comment: http://stackoverflow.com/comment/45136050
has comment: http://stackoverflow.com/comment/45133051
has comment: http://stackoverflow.com/comment/45136427
tagged with: audio
has comment: http://stackoverflow.com/comment/45126141
has comment: http://stackoverflow.com/comment/45132541
upvote count: 5
has comment: http://stackoverflow.com/comment/45132408
has comment: http://stackoverflow.com/comment/45137267
has comment: http://stackoverflow.com/comment/45135988
has comment: http://stackoverflow.com/comment/45136334
has comment: http://stackoverflow.com/comment/50804752
has comment: http://stackoverflow.com/comment/45136610
has comment: http://stackoverflow.com/comment/45135718
has comment: http://stackoverflow.com/comment/45132555
has comment: http://stackoverflow.com/comment/45132690
has comment: http://stackoverflow.com/comment/45132932
has comment: http://stackoverflow.com/comment/45135481
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/q/28327510
has answer: http://stackoverflow.com/a/66023818
has answer: http://stackoverflow.com/a/28433113
has answer: http://stackoverflow.com/a/73586890
score: 16
has body: I'm using jsPDF to create a PDF on the client side and I see there are properties to change the color, size, and font of the text, but I need to align the text to the right. So it's all aligned to a right coordinate. Kind of like text-align: right; in CSS. How would I go about doing this? Thanks
upvote count: 16
has title: Align text right using jsPDF
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/70015907
accepted answer: http://stackoverflow.com/a/28433113
type: Question
tagged with: jspdf
downvote count: 0
tagged with: javascript
answer count: 6
favorite count: 0
possible better answer: http://stackoverflow.com/a/66832660
has answer: http://stackoverflow.com/a/66832660
has answer: http://stackoverflow.com/a/73587738

http://stackoverflow.com/comment/45188790
score: 0
has text: yes, sir, i want example
type: Comment
comment on: http://stackoverflow.com/q/28428327
type: QuestionComment

http://stackoverflow.com/q/28301337
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: checkbox
has answer: http://stackoverflow.com/a/28301526
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28301851
upvote count: 1
score: 1
tagged with: forms
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/44954047
has body: function toggle(source) { checkboxes = document.getElementsByName('options[]'); for (var i = 0, n = checkboxes.length; i < n; i++) { checkboxes[i].checked = source.checked; } } Option 1 Option 2 Option 3 Option 4 Option 5 All When I check the All checkbox, of course, it will mark all the checkboxes, but once I uncheck one checkbox, the All checkbox is still checked. This should be unchecked. How should I do that using JS?
has title: Check All checkbox should be unchecked
downvote count: 0
has comment: http://stackoverflow.com/comment/44954035

http://stackoverflow.com/a/28315932
accepted answer of: http://stackoverflow.com/q/28315712
has body: Let me explain the problems of your code, using the same three points you made: Your problem about var hour = 8; is that, if you set the hour inside the setInterval callback, your hour will be set to 8 at any second. Therefore, your setInterval doesn't work only once, but it gets run infinite times setting the time always to 9. To avoid this, you can move the variable outside and make it global, setting it to 8 before starting the setInterval. To change "PM" back to "AM" when it reaches 12PM, just add an if statement (or, better, a ternary operator, like I did in the snippet below) to check if the period is either "PM" or "AM", and behave consequently. Also, be careful with the check: if you check directly on .textContent be sure that the text inside the doesn't have any trailing space: use .trim() to remove extra spaces at the beginning and at the end of the string. This is the same problem of point 1: you should make the variable period global, and then start the setInterval. The logic of the following script is simple: Increase the hour by 1 If the new hour equals 12, then switch to "PM" or back to "PM" If the new hour is greater than 12, then reset it to 1 Display hour and period Change from smile.gif to sleep.gif when it's 8PM, and vice versa when it's 8AM. I also made some little changes to make code easier and faster to read. Here is a working code snippet: var hour = 8, period = "AM"; setInterval(function() { if (++hour >= 12) { if (hour > 12) hour = 1; else period = (period == "PM") ? "AM" : "PM"; } document.getElementById("time").textContent = hour; document.getElementById("period").textContent = period; if (hour == 8 && period == "PM") { document.getElementById("emoticon").src = "sleep.gif"; document.getElementById("emoticon").alt = "sleep"; } else if (hour == 8 && period == "AM") { document.getElementById("emoticon").src = "smile.gif"; document.getElementById("emotion").alt = "awake"; } }, 1000); Life goes on! The current time is: 8 AM Here it is, it wor…
answers question: http://stackoverflow.com/q/28315712
has comment: http://stackoverflow.com/comment/45000707
type: Answer
has comment: http://stackoverflow.com/comment/44981239
has comment: http://stackoverflow.com/comment/45002662
has comment: http://stackoverflow.com/comment/45001284
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/44999284
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44999487

http://stackoverflow.com/tag/json
tags question: http://stackoverflow.com/q/28340466
tags question: http://stackoverflow.com/q/28292318
tags question: http://stackoverflow.com/q/28281759
tags question: http://stackoverflow.com/q/28346897
tags question: http://stackoverflow.com/q/28313043
tags question: http://stackoverflow.com/q/28323906
tags question: http://stackoverflow.com/q/28315168
tags question: http://stackoverflow.com/q/28415859
tags question: http://stackoverflow.com/q/28401254
tags question: http://stackoverflow.com/q/28340619
tags question: http://stackoverflow.com/q/28336080
tags question: http://stackoverflow.com/q/28410948
tags question: http://stackoverflow.com/q/28345029
tags question: http://stackoverflow.com/q/28329807
tags question: http://stackoverflow.com/q/28348614
tags question: http://stackoverflow.com/q/28299901
tags question: http://stackoverflow.com/q/28327792
tags question: http://stackoverflow.com/q/28292532
tags question: http://stackoverflow.com/q/28300033
tags question: http://stackoverflow.com/q/28367734
tags question: http://stackoverflow.com/q/28315126
tags question: http://stackoverflow.com/q/28402418
tags question: http://stackoverflow.com/q/28307456
tags question: http://stackoverflow.com/q/28367314
tags question: http://stackoverflow.com/q/28362908
tags question: http://stackoverflow.com/q/28302943
tags question: http://stackoverflow.com/q/28401180
tags question: http://stackoverflow.com/q/28406536
tags question: http://stackoverflow.com/q/28349095
tags question: http://stackoverflow.com/q/28286319
tags question: http://stackoverflow.com/q/28283590
tags question: http://stackoverflow.com/q/28286073
tags question: http://stackoverflow.com/q/28397609
tags question: http://stackoverflow.com/q/28387312
tags question: http://stackoverflow.com/q/28333694
tags question: http://stackoverflow.com/q/28372112
tags question: http://stackoverflow.com/q/28303654
tags question: http://stackoverflow.com/q/28391607
tags question: http://stackoverflow.com/q/28391528
tags question: http://stackoverflow.com/q/28293399
tags question: http://stackoverflow.com/q/28388449
tags question: http://stackoverflow.com/q/28357117
tags question: http://stackoverflow.com/q/28390357
tags question: http://stackoverflow.com/q/28405677
tags question: http://stackoverflow.com/q/28401423
tags question: http://stackoverflow.com/q/28386927
tags question: http://stackoverflow.com/q/28305833
tags question: http://stackoverflow.com/q/28300586
tags question: http://stackoverflow.com/q/28329013
tags question: http://stackoverflow.com/q/28315307
tags question: http://stackoverflow.com/q/28420522
tags question: http://stackoverflow.com/q/28317670
tags question: http://stackoverflow.com/q/28381901
tags question: http://stackoverflow.com/q/28382007
tags question: http://stackoverflow.com/q/28374595
tags question: http://stackoverflow.com/q/28359761
tags question: http://stackoverflow.com/q/28339930
tags question: http://stackoverflow.com/q/28283345
tags question: http://stackoverflow.com/q/28316478
tags question: http://stackoverflow.com/q/28285372
tags question: http://stackoverflow.com/q/28291768
tags question: http://stackoverflow.com/q/28305627
tags question: http://stackoverflow.com/q/28394297
tags question: http://stackoverflow.com/q/28338537
tags question: http://stackoverflow.com/q/28434845
tags question: http://stackoverflow.com/q/28409066
tags question: http://stackoverflow.com/q/28301428
type: Tag
tags question: http://stackoverflow.com/q/28390643
tags question: http://stackoverflow.com/q/28337641
tags question: http://stackoverflow.com/q/28344102
tags question: http://stackoverflow.com/q/28305205
tags question: http://stackoverflow.com/q/28319094
tags question: http://stackoverflow.com/q/28347379
tags question: http://stackoverflow.com/q/28345214
tags question: http://stackoverflow.com/q/28335858
tags question: http://stackoverflow.com/q/28326921
tags question: http://stackoverflow.com/q/28289970
tags question: http://stackoverflow.com/q/28375791
tags question: http://stackoverflow.com/q/28319357

http://stackoverflow.com/comment/44979240
type: AnswerComment
comment on: http://stackoverflow.com/a/28314383
type: Comment
has text: Thanks.. but got the answer, you can keep $http request method inside another function and pass url as a parameter, then the responses will be identified based on the urls they are mapped to
score: 0

http://stackoverflow.com/comment/44968906
type: Comment
comment on: http://stackoverflow.com/a/28308185
has text: Yes, you should use their id on the redirect url - `viewmore/[id]`. That's how we defined the state. About the structure of the files, take a look here: https://scotch.io/tutorials/angularjs-best-practices-directory-structure. The first structure is pretty common. The states (routing) are usually defined in the app.js file.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/65698226
type: AnswerComment
comment on: http://stackoverflow.com/a/28302507
type: Comment
has text: @AlfonsoML here aczatly what i want http://drupal.stackexchange.com/questions/126486/ckeditor-placeholder-text-doesnt-work-config-js but i didnt get the answer
score: 0

http://stackoverflow.com/a/28285064
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/28284985
type: Answer
score: 2
has body: Assuming you're using express, you should use the req.params object to access URL parameters. app.get('/wgt/:filename',function(req, res){ res.sendFile(path.join(__dirname,'../public/views/widgets', req.params.filename)); });
accepted answer of: http://stackoverflow.com/q/28284985
type: AcceptedAnswer

http://stackoverflow.com/q/28423403
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28510485
accepted answer: http://stackoverflow.com/a/28510485
score: 0
tagged with: google-maps
answer count: 1
tagged with: geography
has comment: http://stackoverflow.com/comment/45209500
tagged with: cartography
has title: How to draw graphics on Google Map from Web Mercator Meters/Feet
type: AnsweredQuestion
has body: I used to draw graphics on Google Map from decimal degrees (latlng), but recently I found a server that only provide Web Mercator meters (or feet perhaps). Then I found the function to draw decimal degrees does not apply to Web Mercator meters: //this works well var marker = new google.maps.Marker({ position: new google.maps.LatLng(40, -100), map: MAP }); //this does not work var marker = new google.maps.Marker({ position: new google.maps.LatLng(-9076798, 3012626), map: MAP }); Please help me solve this problem. I know there is no simple equation to convert decimal degrees to state plane meters/feet. Thanks.
tagged with: gis
has comment: http://stackoverflow.com/comment/45339931

http://stackoverflow.com/comment/45050729
comment on: http://stackoverflow.com/q/28353342
has text: if you're going to store values in custom attributes.. use data attributes http://www.w3schools.com/tags/att_global_data.asp
score: 0
type: Comment
type: QuestionComment

geography
type: Tag
tags question: http://stackoverflow.com/q/28307267
tag name: geography
tags question: http://stackoverflow.com/q/28359690
tags question: http://stackoverflow.com/q/28423403

http://stackoverflow.com/q/28434155
possible better answer: http://stackoverflow.com/a/28434961
tagged with: javascript
has answer: http://stackoverflow.com/a/28434961
has answer: http://stackoverflow.com/a/28434217
upvote count: 3
has comment: http://stackoverflow.com/comment/45199313
downvote count: 1
has body: if (this.name === '') { this.name= 'None'; } if (this.obs === '') { this.obs = 'None'; } Guys, how can i dry this code? I am trying like this: var v = [this.name, this.obs]; for(var i = 0; i &lt; v.length; i++) { if(v[i] === '') { v[i] = 'None'; } }; But is not working at all...
has comment: http://stackoverflow.com/comment/45198916
favorite count: 0
accepted answer: http://stackoverflow.com/a/28434859
answer count: 4
tagged with: node.js
has comment: http://stackoverflow.com/comment/45198387
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28434859
has comment: http://stackoverflow.com/comment/45199338
has comment: http://stackoverflow.com/comment/45198460
has title: How change the value of this.something with a looping
type: Question
has answer: http://stackoverflow.com/a/28435100
has comment: http://stackoverflow.com/comment/45198360
has comment: http://stackoverflow.com/comment/45198526

http://stackoverflow.com/a/28326294
has body: David P has the correct answer. A Date() is composed of a date part, and a time part new Date().setHours(18,0,0) creates a Date at 18:00 today, which will always be greater than 17:30 February 4, 2015, unless you have a time machine. targetDate.getHours() Returns the hour value of the time part, which it sounds like you are looking for.
type: Answer
answers question: http://stackoverflow.com/q/28324831
score: 0

http://stackoverflow.com/comment/62398976
comment on: http://stackoverflow.com/a/28516034
type: Comment
score: 21
has text: Oh Microsoft... could you be any worse
type: AnswerComment

http://stackoverflow.com/q/28397637
has answer: http://stackoverflow.com/a/28398004
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
tagged with: conditional-comments
tagged with: internet-explorer
has body: So I've been using these two combinations of IE conditionals: &lt;!--[if (IE)|(IEMobile)]&gt; &lt;script type="text/javascript"&gt; // Do something &lt;/script&gt; &lt;![endif]--&gt; &lt;!--[if (!IE)|(!IEMobile)]&gt; &lt;script type="text/javascript"&gt; // Do something else &lt;/script&gt; &lt;!--&lt;![endif]--&gt; So could such combinations work in production environment? I tried testing with IE 11 emulated to any previous version of IE and I got these results: The first one worked on IE for PC; The second one failed exposing its contents to IE for PC; I've not tested the IEMobile contrary because I don't have Windows Phone, so I can't be sure if some of these works on it. Any suggestions?
tagged with: windows-phone-7
has title: Internet Explorer + Windows Phone IEMobile Conditional Comments
type: Question
score: 0
answer count: 1

http://stackoverflow.com/comment/47126942
score: 0
comment on: http://stackoverflow.com/a/28296558
type: Comment
has text: They're still indirect dependencies since [boilerplate-generator](https://github.com/meteor/meteor/blob/devel/packages/boilerplate-generator/package.js) depends on them though
type: AnswerComment

http://stackoverflow.com/comment/45009563
comment on: http://stackoverflow.com/q/28331148
has text: You are overwriting the [valueOf](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf) function with a function of your own. This function gets called automatically to change convert an object to a primitive. The second case is a syntax error, and the third you aren't supplying a function.
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/q/28357808
tagged with: javascript
score: 0
has body: I'm a beginner in JavaScript, I wrote a countdown timer, but I don't know how to convert the mins into hours. I think its not to hard, but I can't do it, whenever I wrote new rows its not working. Here is my code: var minutesRemaining; var secondsRemaining; var intervalHandle; function resetPage() { document.getElementById('inputArea').style.display = 'block'; //hide pause button by default document.getElementById("pauseArea").style.display = "none"; //hide resume button document.getElementById("resumeArea").style.display = "none"; } function resumeCountdown() { tick(); intervalHandle = setInterval(tick, 1000); //hide resume button when resuming document.getElementById("resumeArea").style.display = "none"; //show resume button; document.getElementById("pauseArea").style.display = "block"; return; } function pauseCountdown() { clearInterval(intervalHandle); document.getElementById("pauseArea").style.display = "none"; document.getElementById("resumeArea").style.display = "block"; return; } function tick() { //grab h1 var timeDisplay = document.getElementById('time'); //turn seconds into mm:55 var min = Math.floor(secondsRemaining / 60); var sec = secondsRemaining - (min * 60); //add leading 0 if seconds less than 10 if (sec &lt; 10) { sec = '0' + sec; } //concatenate with colon var message = min.toString() + ':' + sec; // now change the display timeDisplay.innerHTML = message; //stop if down to zero if (secondsRemaining === 0) { alert('Done!'); clearInterval(intervalHandle); resetPage(); } // subtract from seconds remaining secondsRemaining--; } function startCountdown() { //get contents var minutes = document.getElementById('minutes').value; //check if not a number if (isNaN(minutes)) { alert("Please enter a number!"); return; } //how many seconds? secondsRemaining = minutes * 60; //call tick intervalHandle = setInterval(tick, 1000); //hide form document.getElementById('inputArea').style.display = 'none'; //show pause when running document.getElementById("pauseArea")…
answer count: 1
tagged with: countdown
linked to: http://stackoverflow.com/q/6312993
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45058882
has answer: http://stackoverflow.com/a/31443211
type: Question
has title: Countdown timer javascript mins into hours

http://stackoverflow.com/comment/45093251
score: 0
type: Comment
has text: Thank you, that's the problem with using tutorials from magazines I think, they ran out of room in the column.
type: AnswerComment
comment on: http://stackoverflow.com/a/28376481

http://stackoverflow.com/comment/44983819
score: 0
comment on: http://stackoverflow.com/q/28317111
type: QuestionComment
has text: But as per the document, the third parameter is a function which gets called when all async tasks are donr
type: Comment

http://stackoverflow.com/comment/45170000
type: QuestionComment
comment on: http://stackoverflow.com/q/28418254
type: Comment
score: 0
has text: Your script is working fine and doing exactly what you tell it to. It creates three variables (choice, numbers, output), assigns their value, and sorts them, assigning the new order to a variable (arr). It then assigns the value of arr to the variable output. If you want output to show up you have to tell it to show up (see Spencer's answer below).

http://stackoverflow.com/comment/45147370
score: 0
comment on: http://stackoverflow.com/a/28371244
type: Comment
has text: Indeed this is a working solution ! Thank you for making me understand the notion of callback and the recursion is a really good idea !
type: AnswerComment

http://stackoverflow.com/q/28288292
has comment: http://stackoverflow.com/comment/44930804
score: 0
has title: How can I manage large input to my RSS endpoint?
has answer: http://stackoverflow.com/a/28299081
accepted answer: http://stackoverflow.com/a/28299081
answer count: 1
tagged with: angularjs
tagged with: rss
type: AnsweredQuestion
has body: I have an Angular + ASP.Net WebAPI Application. I am posting a JSON query to an API and in return getting the RSS formatted feed. $scope.rss = function(query){ $http.post("api/url", query) .success(function(response){ //I have RSS feed (xml string) in response //But cannot publish it as RSS /*response = "&lt;?xml version="1.0" encoding="UTF-8" ?&gt; &lt;rss version="2.0"&gt; &lt;channel&gt; ... &lt;/channel&gt; &lt;/rss&gt;"*/ }) .error(function(e){ //error }); } Now, my API accepts HttpPost, and I cannot use HttpGet because, the query can get really big. Is there any way to solve it?
type: Question
tagged with: asp.net-web-api
tagged with: javascript

http://stackoverflow.com/a/30483338
has body: The answer to my problem was simple: Critical CSS is specific for each HTML page. Thus critical CSS for each individual page should be calculated separately... (I was using the same critical CSS for all my subpages...).
score: 1
upvote count: 1
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28289634
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28289634
type: Answer

http://stackoverflow.com/comment/45053107
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28353831
has text: I updated the code to `today.getMonth()`, its giving me different result in different cases, `http://jsfiddle.net/8f2k679x/`

http://stackoverflow.com/comment/45024459
type: Comment
has text: I tried this but strangely the numbers are still coming out the same. Here's the [live site](http://keebs.com/dax/). You can see that in the console, the numbers come up the same.
comment on: http://stackoverflow.com/a/28339292
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45244537
type: Comment
comment on: http://stackoverflow.com/a/28432229
type: AnswerComment
has text: Thanks but it's not what I'm after. I've got some code working to demonstrate what the problem is (although this code has some additional problems of it's own). http://jsfiddle.net/m1ugpb4o/19/ If I select a number in the first column the 2nd dropdown updates to show the values that have that id in the 2nd array. The problem is if I multi select from the numbers column I want it to show all of the corresponding 'AOCs' but it just updates for the last one selected
score: 0

http://stackoverflow.com/comment/45084928
type: QuestionComment
comment on: http://stackoverflow.com/q/28369123
score: 0
has text: Sorry forgot to mention that. I have tried from multiple applications I have created, tried on multiple operating systems (windows 8, windows 7, Windows XP), tried un plugging and plugging back in. All don't work. Also tried on two different devices and same result. Nothing seems to work apart from restarting the device. Also see the edit I've just made.
type: Comment

http://stackoverflow.com/q/28349746
upvote count: 0
has comment: http://stackoverflow.com/comment/45436127
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45929853
favorite count: 0
has comment: http://stackoverflow.com/comment/45043282
has comment: http://stackoverflow.com/comment/45929125
type: UnansweredQuestion
score: -3
has comment: http://stackoverflow.com/comment/45931294
tagged with: authentication
has comment: http://stackoverflow.com/comment/45044240
tagged with: php
has title: Login function not working
has comment: http://stackoverflow.com/comment/45929080
type: Question
has answer: http://stackoverflow.com/a/28831900
has comment: http://stackoverflow.com/comment/45929625
has comment: http://stackoverflow.com/comment/45043354
downvote count: 3
has comment: http://stackoverflow.com/comment/45931614
has comment: http://stackoverflow.com/comment/45043631
has body: Okay so i made a login button and this is the function code, But it keeps showing the error " Login unsuccessful, Please try again... " Thank you in advance... I didn't really get what you were asking for so i put almost all the code in cause i am trying and trying and can't figure it out... <?php include_once ("php_includesss121/check_login_statusopop.php"); // If user is already logged in, header that user away if ($user_ok == true) { header("location: user.php?u=" . $_SESSION["username"]); exit(); } ?><?php // AJAX CALLS THIS LOGIN CODE TO EXECUTE if (isset($_POST["e"])) { // CONNECT TO THE DATABASE include_once ("php_includesss121/db_conxx12.php"); // GATHER THE POSTED DATA INTO LOCAL VARIABLES AND SANITIZE $e = mysqli_real_escape_string($db_conx, $_POST['e']); $p = md5($_POST['p']); // GET USER IP ADDRESS $ip = preg_replace('#[^0-9.]#', '', getenv('REMOTE_ADDR')); // FORM DATA ERROR HANDLING if ($e == "" || $p == "") { echo "login_failed"; exit(); } else { // END FORM DATA ERROR HANDLING $sql = "SELECT id, username, password FROM users WHERE email='$e' AND activated='1' LIMIT 1"; $query = mysqli_query($db_conx, $sql); $row = mysqli_fetch_row($query); $db_id = $row[0]; $db_username = $row[1]; $db_pass_str = $row[2]; if ($p != $db_pass_str) { echo "login_failed"; exit(); } else { // CREATE THEIR SESSIONS AND COOKIES $_SESSION['userid'] = $db_id; $_SESSION['username'] = $db_username; $_SESSION['password'] = $db_pass_str; setcookie("id", $db_id, strtotime('+30 days') , "/", "", "", TRUE); setcookie("user", $db_username, strtotime('+30 days') , "/", "", "", TRUE); setcookie("pass", $db_pass_str, strtotime('+30 days') , "/", "", "", TRUE); // UPDATE THEIR "IP" AND "LASTLOGIN" FIELDS $sql = "UPDATE users SET ip='$ip', lastlogin=now() WHERE username='$db_username' LIMIT 1"; $query = mysqli_query($db_conx, $sql); echo $db_username; exit(); } } exit(); } ?> Log In <?php include_once ("template_pageTopLoginPageopop.php"); ?> Welcome ... Log In Here Email Address: Password…
has comment: http://stackoverflow.com/comment/45933568
has comment: http://stackoverflow.com/comment/45935300

http://stackoverflow.com/q/28287300
has comment: http://stackoverflow.com/comment/44929149
answer count: 1
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
downvote count: 0
has comment: http://stackoverflow.com/comment/44929018
score: 1
type: Question
has title: Removing Chrome style for input text (list)
tagged with: javascript
has body: I am trying to build a custom input text list. I have an image I would like to use as arrow, so that I can click and show the list of values. I am also using AngularJS. The following code does not work as expected. My issue is: I see a black arrow on the left of the yellow arrow when passing over or clicking (otherwise no arrow) Here's a link to try it (no yellow arrow is shown, but there is some white space on the right of the undesired black arrow): http://jsfiddle.net/wbo3pt9u/ Here's the code. &lt;input type="text" list="typeL" ng-model="tipo" class="list" placeholder="Type"&gt; &lt;datalist id="typeL"&gt; &lt;option ng-repeat="objectType in objectTypes" value="{{objectType.typeWorkOfArt}}" } /&gt; &lt;/datalist&gt; &lt;/input&gt; CSS: .list { background: url('../images/arrow.png') no-repeat top right; border-radius: 20px; width: 160px; height: 33px; -webkit-appearance: none; border: 2px solid #c1c4c6; line-height: 29px; cursor: pointer; font-weight: normal !important; font-style: italic; font-size: 1.250em; padding:0 30px 0 10px !important; color: #58585A; overflow: hidden; margin: 10px; } .input { border-radius: 20px; width: 160px; height: 33px; -webkit-appearance: none; border: 2px solid #c1c4c6; line-height: 29px; cursor: pointer; font-weight: normal !important; font-style: italic; font-size: 1.250em; padding: 0 1em; color: #58585A; margin: 10px; } I also tried to use a , which worked correctly: no black arrow and single click. Now that I switched to this element, it does not work. How can I fix it?
has answer: http://stackoverflow.com/a/28287956
upvote count: 1

http://stackoverflow.com/a/28320558
upvote count: 5
downvote count: 0
has body: You're trying to load an image from a GET request. There is absolutely no reason to complicate things by involving Ajax here. $('#crop').empty().append( $("&lt;img /&gt;").attr( "src", "http://localhost:7741/PrintView/Crop?locate=" + encodeURIComponent(param) ) );
has comment: http://stackoverflow.com/comment/44989651
has comment: http://stackoverflow.com/comment/44989610
type: Answer
answers question: http://stackoverflow.com/q/28320471
score: 5

http://stackoverflow.com/comment/45106840
type: QuestionComment
comment on: http://stackoverflow.com/q/28384490
has text: Your code is doing exactly what it's supposed to. If you don't want to reference `obj1`, then don't equate it to another variable.
score: 0
type: Comment

http://stackoverflow.com/comment/44990232
comment on: http://stackoverflow.com/q/28320074
has text: Trying to find the best solution if someone occurred the same problem
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/79953209
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/32367587
has text: nit: does not have the .tapCatch or other bluebird methods
score: 0

http://stackoverflow.com/comment/44936087
comment on: http://stackoverflow.com/q/28291202
type: Comment
type: QuestionComment
has text: I already corrected myself, Please read up.
score: 0

http://stackoverflow.com/a/28427910
has body: Update: ES6's let solves this pretty trivially, just replace var with let in your original code and it should work. Your this_trans and such variables aren't unique in each iteration of the for-in loop. You might wanna wrap it in a self-executing anonymous function scope ((function(){})()) //find all schedules SchedModel.find({ Day_Of_Week: day }, null, null, function (err, Sched) { if (!err) { //iterate through what we find for (var key in Sched) { (function(key){ // self-executing anonymous function scope if (Sched.hasOwnProperty(key)) { var val = Sched[key]; console.log("val : " + val); var Sched_Descr = day || ' Sched Trans'; var this_trans = new TransModel({ mID: val.K_Id, mDate: today, mDescr: Sched_Descr, mAmt: val.mAmt }); //insert the new trans this_trans.save(function (err, trans) { if (!err) { //when we insert new trans, get the update model MyModel.findById(val.K_Id, function (err, Model) { Model.Balance = Model.Balance + val.mAmt; //save model, this update to the last in the list Model.save(function (err) { if (!err) { console.log("updated"); } else { console.log(err); } }); }); } else { return console.log(err); } }); } })(key); } } else { console.log(err); }; });
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28426466
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28426466
downvote count: 0

http://stackoverflow.com/q/28355677
duplicate of: http://stackoverflow.com/q/22618056
tagged with: browser
score: 0
has comment: http://stackoverflow.com/comment/45055248
tagged with: javascript
has body: We are often interested in obtaining the client's time zone (ex: America/Los_Angeles), for obvious reasons. Unfortunately, this isn't directly available within any widely used browser that I know of. Instead, we have to rely on asking the user, or attempting to detect it - with reasonable accuracy - using some Javascript that examines various date offsets (ex: jstz as described here). My questions is, why not? Obviously the offset is available, which is based on the time zone. It would save the headache of having to use hacks to determine it, and of course one could always use other means to determine it with more confidence (ex: asking the user). Perhaps there are security implications, a lack of agreement in creating a standard solution, or something else I might be missing. I've done a lot of searching before posting this question and haven't found anything definitive.
has comment: http://stackoverflow.com/comment/45058945
tagged with: timezone
has comment: http://stackoverflow.com/comment/45162107
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45058910
has comment: http://stackoverflow.com/comment/45058816
type: Question
linked to: http://stackoverflow.com/q/22618056
has comment: http://stackoverflow.com/comment/45055921
has title: Why is the client time zone (not offset) not available in the browser?

http://stackoverflow.com/comment/45018544
has text: what is it that identifies the page as unique? the name of the page, as in the title, or...?
comment on: http://stackoverflow.com/q/28335858
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44926746
type: QuestionComment
has text: @AAA - It looks like Lars is right: http://bost.ocks.org/mike/join/
comment on: http://stackoverflow.com/q/28286181
score: 0
type: Comment

http://stackoverflow.com/comment/44984244
has text: thanks Stephan, what kinda function should i use with regex in this case. by the way i am not javascript coder. could you please guide me through this....
comment on: http://stackoverflow.com/a/28317621
type: AnswerComment
score: 0
type: Comment

knockout-components
type: Tag
tags question: http://stackoverflow.com/q/28363977
tags question: http://stackoverflow.com/q/28369613
tag name: knockout-components

http://stackoverflow.com/comment/45053373
type: Comment
has text: I think that is something like this: global array= [][] function get_data(){ part = request.part; part_data = request.data; end = part_data.length * part; count = end - part_data.length; for(count; count <= end; count++){ global array[count][part_data[count]]; } } Anyway you need check this logic with your code, but I think that this can run
comment on: http://stackoverflow.com/a/28351874
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44977600
comment on: http://stackoverflow.com/q/28313856
has text: Shouldn't it be `JSON.parse(response.attributes_dim)` as in your screenshot?
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/q/28328381
has title: Toggling Between a CSS class with pure javascript on 'n' elements
type: Question
tagged with: classiejs
has comment: http://stackoverflow.com/comment/45004572
answer count: 1
downvote count: 0
has body: Working on creating functionality where when the user clicks on one of the products (each of the elements have the same assigned ID card-reveal) it adds a CSS class to the container specifically clicked (active state) to show information for that specific item and then finally, when the user clicks the cancel button the CSS class is removed (activate state gone). Unfortunately I have run to a few hiccups where when I click on the 1st element it adds the class to that element but the other elements I click do not add the class, as well the close button does not function at all. I would like to finish the solution in Pure Javascript. Also if you see a few classie() methods, I am using Classie.js to help with CSS class toggling. Any help will be appreciated! Thank You! Html View More Follow {{object.product_website_name}}.com Buy {{object.product_name }} Share CSS .card-cover { width:100%; height: 100%; background: none repeat scroll 0% 0% rgba(255, 91, 36, 0.9); color: #FFF; display: block; position: absolute; opacity: 0; z-index:200; overflow: hidden; -webkit-transform:translate3d(0, 400px, 0); transform:translate3d(0, 400px, 0); -webkit-backface-visibility:hidden; backface-visibility: hidden; -webkit-transition-property:opacity, transform; transition-property:opacity, transform; -webkit-transition-duration:0.2s; transition-duration:0.2s; -webkit-transition-timing-function:cubic-bezier(0.165, 0.84, 0.44, 1); transition-timing-function:cubic-bezier(0.165, 0.84, 0.44, 1); -webkit-transition-delay: 0s; transition-delay: 0s; } .card-cover.card--active { opacity: 1; -webkit-transform:translate3d(0, 0, 0); transform:translate3d(0, 0px, 0); } JS below: var cardContainer = document.querySelector('.card-cover'), cardTargets = Array.prototype.slice.call( document.querySelectorAll( '#card-reveal' ) ), eventType = mobilecheck() ? 'touchstart' : 'click', cardClose = document.getElementById('card-close'), resetMenu = function() { classie.remove( cardContainer, 'card--active' ); },…
tagged with: javascript
has comment: http://stackoverflow.com/comment/45004357
has answer: http://stackoverflow.com/a/28333103
accepted answer: http://stackoverflow.com/a/28333103
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45004472
favorite count: 0
has comment: http://stackoverflow.com/comment/45004539
upvote count: 1
tagged with: css
has comment: http://stackoverflow.com/comment/45004380
type: AnsweredQuestion
score: 1

http://stackoverflow.com/q/28342259
has title: Datatables vertical scroll issue
tagged with: javascript
tagged with: jquery
has body: I've already posted this on the datatables forum but no response after a few days. So I hope someone here can at least come up with a workaround for this. I've been hammering on this problem for the past few days but can't find any solution... I have a website were dataTables is used on a search results page, so it must be able to handle a few records, or many. I wanted to use vertical scrolling to make sure the headers stay visible no matter how many records are found, but this is giving me a headache... See the following jsfiddle which demonstrates my problem: http://jsfiddle.net/kzgq1L25/2/ I initialize datatables like so: $('#example').DataTable({ "scrollX": true , "scrollY" : "500px" , "scrollCollapse": true , "paging": false , "searching": false , "ordering": true }); Which tells it to create a vertical scroll container with a height of 500px. The "scollCollapse": true tells it to not make the vertical scroll container 500px, if the table itself is less high than that (to avoid empty white space). My problem, is as you can see, there is always a vertical scrollbar being added, even when the table height is less than the given height in the scrollYparameter. This is only happens when also using "scrollCollapse": true. In the example the table consists just of 2 rows, and according to Chrome developer tools, the tbody element is just 62px big, and I've given the "scrollY": "500px" parameter to dataTables, so I would expect to NOT have a vertical scrollbar. Any ideas on how to fix this?
has answer: http://stackoverflow.com/a/28342475
answer count: 2
score: 2
downvote count: 0
favorite count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: css
tagged with: datatable
has answer: http://stackoverflow.com/a/36495925
type: Question

http://stackoverflow.com/q/28315815
has answer: http://stackoverflow.com/a/28316175
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: html2canvas
tagged with: jquery
favorite count: 0
has title: Error when saving the canvas element using Html2canvas
type: UnansweredQuestion
upvote count: 1
type: Question
score: 1
has body: I am trying to create a screenshot on a click and save the image in the pc. For this I am using the html2canvas plugin. here is my code Save Me My Name Is SUBHAJYOTI MITRA Its working nice when click on "Save me" and the save the image. but the background of the image became black. Like the above picture. please any one help me.

http://stackoverflow.com/a/28343193
answers question: http://stackoverflow.com/q/28342851
has body: I've changed. However, the system still does not behave as it should. When I click 'submit' the banner just disappears ( doesn't matter if the code is ok or not ). I think the value is not passed because when I do a simple test there's any alert: $("#submit").click(function (){ var value = $('#code').val(); var pass = 'test'; alert(value); if( value == pass ){ SetCookie('is_logged','is_logged',365*10) $("#login-bg").remove(); } else { $('#login-bg').effect( "shake" ); } });
has comment: http://stackoverflow.com/comment/45031236
score: 0
type: Answer

http://stackoverflow.com/comment/45203397
type: Comment
type: QuestionComment
score: 2
has text: Move this logic on the client side, with a confirm dialog, using javascript.
comment on: http://stackoverflow.com/q/28436669

http://stackoverflow.com/comment/44998858
type: QuestionComment
has text: Your code throws an error `Uncaught TypeError: undefined is not a function`, have you looked into this yet? Also, you do not need to use `$(document).ready(function ()` in JSFiddle, it does this automatically.
comment on: http://stackoverflow.com/q/28325576
score: 0
type: Comment

http://stackoverflow.com/comment/44951348
score: 0
has text: Why you have tagged jQuery, when you are not using it.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28299904

http://stackoverflow.com/a/28426617
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28420827
answers question: http://stackoverflow.com/q/28420827
has body: I think I know what you want, but using high order functions for everything is overkill, in my example too. Here we create map2 that is similar to [].map but expects 2 arrays and a functions that takes at least 2 arguments. I recommend learning a bit more about map reduce because here you don t need reduce at all. &lt;script&gt; function sum (a,b) { return a + b; } function map2 (array1, array2, function1) { /*not fully tested*/ var length1 = array1.length, length2 = array2.length, i, array3 = new Array(length1); for (i = 0; i &lt; length1 &amp;&amp; i &lt; length2; i++) { array3[i] = function1(array1[i], array2[i], i); } return array3; } function sumArrays (array1, array2) { return map2(array1, array2, sum); } var a=[1,2,3], b=[7,8,9]; console.log(sumArrays(a,b)); console.log(sumArrays(a,sumArrays(a,b))) &lt;/script&gt;
score: 0

http://stackoverflow.com/a/28379157
has body: Try change : data: "{'xCoord': '" + x + "', 'yCoord': '" + y + "'}", to: data: {'xCoord': x , 'yCoord': y }, and try add datatype: dataType: "json", contentType: 'application/json',
answers question: http://stackoverflow.com/q/28376372
score: 0
has comment: http://stackoverflow.com/comment/45097971
type: Answer

http://stackoverflow.com/q/28435253
tagged with: javascript
favorite count: 0
has title: Disable a specific option boostrap-multiselect
upvote count: 4
possible better answer: http://stackoverflow.com/a/28436118
type: AnsweredQuestion
has body: Question I want to disable a single option with JS. I tried using the following code: var input = $('input[value="' + selectedPriLang + "Sec" + '"]'); input.prop('disabled', false); input.parent('li').addClass('disabled'); It kind of works, but the problem is I can still enable the option using the Select all button. Also, not sure if relevant, I execute the code in a onChange from a different multiselect. Dutch English German French Hope this explanation is clear enough, first question ;D. Answer Although Joe's answer worked I tried it out myself, For disabling: var input = $('input[value="' + selectedPriLang + "Sec" + '"]'); input.prop('disabled', true); var input2 = input.parent('label').parent('a').parent('li'); input4.removeClass('active'); input4.addClass('disabled'); For enabling: var input = $('input[value="' + selectedPriLang + "Sec" + '"]'); input.prop('disabled', false); var input2 = input.parent('label').parent('a').parent('li'); input2.removeClass('disabled'); Just the value of the input selectedPriLang = $('#sel_priLang option:selected').val();
downvote count: 0
tagged with: bootstrap-multiselect
type: Question
has answer: http://stackoverflow.com/a/29112215
accepted answer: http://stackoverflow.com/a/29112215
score: 4
has answer: http://stackoverflow.com/a/28436118
answer count: 2

http://stackoverflow.com/comment/45015272
type: Comment
has text: Yes! Now I need to figure out why mine isn't working like yours! Thank you so much, this was very helpful. :)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28333721

youtube-javascript-api
type: Tag
tag name: youtube-javascript-api
tags question: http://stackoverflow.com/q/28359341

http://stackoverflow.com/q/28376655
has comment: http://stackoverflow.com/comment/45093903
has comment: http://stackoverflow.com/comment/45093563
has comment: http://stackoverflow.com/comment/45093458
has comment: http://stackoverflow.com/comment/45093468
has body: I'm coding a simple form with html w/javascript and have been working on this one aspect for about two days. I've seen numerous ideas across the internet but none seem to give me an idea of what to do. So hoping you guys can help. Basically what has to happen is when USA is selected the form should require that a numeric postal code be entered or else it refuses submission. Below is my code so far, sorry its pretty lengthy. State Select a State Alabama Alaska Arizona Arkansas California Colorado Connecticut Delaware District Of Columbia Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee Texas Utah Vermont Virginia Washington West Virginia Wisconsin Wyoming Country Select a Country United States of America Canada Mexico Postal Code Javascript var lStateLabel; var ddState; var dStateError; var lCountryLabel; var ddCountry; var dCountryError; var lPostCodeLabel; var iPostCode; var dPostCodeError; function validatePostCode() { if((isNaN(iPostCode.value) == false) && (iPostCode.value.length == 5)) { resetPostCode(); return true; } else { lPostCodeLabel.style.color = "red"; dPostCodeError.innerHTML = "Your Postal Code must be numeric and 5 integers long."; return false; } }
answer count: 2
has comment: http://stackoverflow.com/comment/45093659
tagged with: javascript
has answer: http://stackoverflow.com/a/28376786
favorite count: 0
downvote count: 3
has title: How to require a Postal Code to be Numeric if a Certain Country is Selected in JavaScript w/HTML
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28377054
type: AnsweredQuestion
upvote count: 0
score: -3
possible better answer: http://stackoverflow.com/a/28376786
has answer: http://stackoverflow.com/a/28377054
tagged with: postal-code
has comment: http://stackoverflow.com/comment/45093653
type: Question

http://stackoverflow.com/q/28309890
has comment: http://stackoverflow.com/comment/44971257
has comment: http://stackoverflow.com/comment/44970835
upvote count: 1
has body: I'm having an issue where I'm putting jQuery DataTable in an bootstrap 3 panel will cause the search box and page numbers to go off. Here is the design: I have a webpage, and will have multiple jQuery DataTable, however, with a large number of columns, it will make the webpage scrollable horizontally. Hence my idea is to use the bootstrap 3 panel feature, and put the datatable inside, hence it will now only scroll the panel, but not the whole webpage. Hence, the final result is a nice looking table inside the panel. However, when the panel starts to scroll horizontally, the search and page tabs are not placed to the far right side, but in the middle, which it will look like this after it scrolls. Can anyone point me to the right direction on how I could put the search and page tabs to the far right?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44971358
score: 1
has comment: http://stackoverflow.com/comment/44970942
has title: jQuery DataTables - Inside an Bootstrap 3 Panel will cause the Search Box and Page Numbers in the Wrong Position
has comment: http://stackoverflow.com/comment/44970762
type: Question
possible better answer: http://stackoverflow.com/a/28310006
answer count: 2
has answer: http://stackoverflow.com/a/28310006
downvote count: 0
has answer: http://stackoverflow.com/a/28310273
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44971112
has comment: http://stackoverflow.com/comment/44971148
has comment: http://stackoverflow.com/comment/44970798
has comment: http://stackoverflow.com/comment/44970809
has comment: http://stackoverflow.com/comment/44970921
tagged with: css
has comment: http://stackoverflow.com/comment/44971069
favorite count: 0
tagged with: twitter-bootstrap
accepted answer: http://stackoverflow.com/a/28310273

http://stackoverflow.com/q/28346605
tagged with: javascript
has body: The table below identifies successes and failures using color codes:Green means success,Red means failure. mon tue Wed Tom Dick Harry This next table gives a summary of successes and failures per person Name Hits misses % compliance Tom Dick Harry The Javascript below is supposed to get a count of class occurrences per name $(function () { var $rows = $("#summary tbody tr"); $rows.each(function (n) { $("#failed").html('' + $('tr .miss').length + ''); $("#success").html('' + $('tr .hit').length + ' '); var total = $('.hit').length + $('.miss').length; var completed = $('.hit').length; var compliance = parseInt(completed * 100 / (total)); $("#percentage").html('' + compliance + ' % '); }); }); Here is the css td.hit { background-color:#76F33A !important; } td.miss { background-color:#FF0F0F !important; } I want to get css class count per row in the summary table?
score: 0
has title: javascript Count class occurrences per table row and summarize in another table
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28346962
has comment: http://stackoverflow.com/comment/45037584
has answer: http://stackoverflow.com/a/28347059
has comment: http://stackoverflow.com/comment/45037529
possible better answer: http://stackoverflow.com/a/28347059
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45037914
has answer: http://stackoverflow.com/a/28346962
answer count: 2

http://stackoverflow.com/comment/44998726
score: 0
comment on: http://stackoverflow.com/a/28325579
type: Comment
has text: I can't setup the class rule in a stylesheet because I don't know what the width will be prior to runtime. I am trying to get all of my divs to be the width of the largest div.
type: AnswerComment

http://stackoverflow.com/q/28368869
score: 2
has title: Facebook sharer link with text parameters
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28369434
has body: I want to include a link to a URL in a Facebook sharer link, like this one on the Boston Globe: http://www.bostonglobe.com/sports/2015/02/06/for-bruins-brad-marchand-agitation-occupation/zoswHyd3pX2yc1pKk5gOdO/story.html This is the code that I have, but it doesn't show the title: &lt;a aria-label="Share on Facebook" title="Share on Facebook" href="https://www.facebook.com/sharer/sharer.php?u=1http%3A%2F%2Fwww.affinnova.com%2Fconsumer-iq-test%2Fhome.html&amp;t=Do+you+know+what+consumers+want?+Test+your+ability+to+predict+what+new+product+ideas+consumers+want?" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');return false;"target="_blank" title="Share on Facebook"&gt; &lt;img src="img/icon-facebook.png" alt="Facebook" /&gt; &lt;/a&gt; The pop-up shows the title of the HTML page from the link and the url. I'd like this to be more like what the Boston Globe link shows. How can I do that? Do I need an additional script?
favorite count: 0
type: Question
upvote count: 2
answer count: 2
tagged with: facebook
has answer: http://stackoverflow.com/a/53928062

http://stackoverflow.com/q/28416449
has answer: http://stackoverflow.com/a/28416681
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45166064
tagged with: for-loop
has answer: http://stackoverflow.com/a/28416475
has title: javascript for loop won't iterate
has body: novice programmer here, I'm trying an exercise where the objective is to print a string backwards. Here is my code: function firstReverse(str) { for(var i=str.length - 1; i &gt;= 0;i --) { return(str[i]); } }; firstReverse("riyad"); I keep getting the return of letter "d", but not the entire string. Not sure what is wrong here? Please help!
has comment: http://stackoverflow.com/comment/45166055
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45166117
has comment: http://stackoverflow.com/comment/45166084
tagged with: javascript
type: Question

http://stackoverflow.com/comment/44962285
type: QuestionComment
has text: what does it says when you output console.log($scope.timesheets.length)
comment on: http://stackoverflow.com/q/28305494
score: 0
type: Comment

http://stackoverflow.com/a/28331043
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/28330970
has body: Try this: $('.Input').append('&lt;option&gt;' + data[0].abc + '&lt;/option');
upvote count: 3
type: Answer

http://stackoverflow.com/q/28428006
score: 0
has comment: http://stackoverflow.com/comment/45187552
answer count: 1
has comment: http://stackoverflow.com/comment/45188577
has body: I have an Angularjs site that works. However one html file(view) does not integrate with Angular. The flight fields are not show and the button is not active. Can anybody help? &lt;nav class="top-bar" data-topbar="" role="navigation"&gt; &lt;ul class="title-area"&gt; &lt;li class="name"&gt;&lt;h1&gt;&lt;a ui-sref="client.payment"&gt;Pagamento&lt;/a&gt;&lt;/h1&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/nav&gt; &lt;div id="sidePanelContent"&gt; &lt;a ui-sref="^" ui-sref-opts="{reload: true}" class="closeSidePanel"&gt;&lt;img src="images/admin/botao-fechar.png" alt="Fechar"&gt;&lt;/a&gt; &lt;h1&gt;Pagamento do Voo&lt;/h1&gt; &lt;div&gt; &lt;p ng-show="flight"&gt;&lt;strong&gt;Voo:&lt;/strong&gt; {{flight.fromairport.name}} &amp;#10141; {{flight.toairport.name}}&lt;/p&gt; &lt;p ng-show="flight"&gt;&lt;strong&gt;Horário:&lt;/strong&gt; h&lt;/p&gt; &lt;p ng-show="flight"&gt;&lt;strong&gt;Lugares disponíveis:&lt;/strong&gt; {{flight.availableseats}}&lt;/p&gt; &lt;p ng-show="flight"&gt;&lt;strong&gt;Aeronave:&lt;/strong&gt; {{flight.airplane.name}}&lt;/p&gt; &lt;p ng-show="flight"&gt;&lt;strong&gt;Preço atual:&lt;/strong&gt; R$ &lt;/p&gt; &lt;/div&gt; &lt;button class="button" ui-sref="client.payment({flight:flightid})" &gt;Pagar com Paypal&lt;/button&gt; ---------------- Java script ----------------- 'use strict'; /** * @ngdoc function * @name flyvipApp.controller:AboutCtrl * @description * # AboutCtrl * Controller of the flyvipApp */ angular.module('flyvipApp') .controller('PaymentCtrl', function ($scope, SharedData, $rootScope, $state, $stateParams, Authorization, $http) { var api = "http://flyvip.com.br/app/api/"; var userid = Authorization.currentUser().user.id; $rootScope.sidePanel = false; SharedData.selectedMenu.setItem('voos'); $scope.menu = SharedData.selectedMenu; $rootScope.homeClient = false; $scope.orderedFlights = {data: []}; $scope.flag = false; var _flightid = _id; var _airplaneid = $scope.flight.airpl…
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28451325
has comment: http://stackoverflow.com/comment/45188073
has comment: http://stackoverflow.com/comment/45187972
has comment: http://stackoverflow.com/comment/45188065
tagged with: javascript
tagged with: angularjs
type: Question
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45188683
has comment: http://stackoverflow.com/comment/45451222
has title: Angularjs why this html page(view) does not integrate with Angular

http://stackoverflow.com/comment/45157530
has text: Please mark Naeems answer as correct and open a new question for the new problem that arises
score: 0
comment on: http://stackoverflow.com/q/28408978
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28399821
favorite count: 0
has title: Call javascript without function?
answer count: 3
has answer: http://stackoverflow.com/a/28399887
has comment: http://stackoverflow.com/comment/45135442
has answer: http://stackoverflow.com/a/28399885
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28399962
has comment: http://stackoverflow.com/comment/45135295
score: 2
has body: I need to create a script called footer.js to validate the form below. I cannot make any modifications in the index.html file. I need to validate that the name field to be 3 characters with a space, and the age field to be a number between 1 and 110. All fields need to be required. How do I do this? How do I call my footer.js file? There isn't even an onsubmit function, just the . Contact Name Age Select one HTML JavaScript CSS About you: Send
tagged with: forms
type: Question
tagged with: validation
downvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/45004950
comment on: http://stackoverflow.com/q/28328563
type: Comment
score: 0
has text: Did you already check your IFRAMEs Security option "Restrict cross frame scripting where supported"? Also try using different browsers than IE to see if your request is blocked by IE settings.
type: QuestionComment

http://stackoverflow.com/q/28381951
has answer: http://stackoverflow.com/a/28381992
answer count: 2
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28382048
upvote count: 2
type: UnansweredQuestion
has body: This is my form: &lt;form&gt; &lt;input type="text" placeholder="Check in date" id="checkin" /&gt; &lt;input type="text" placeholder="Check out date" id="checkout" /&gt; &lt;input type="submit" onclick="result()" id="submit" /&gt; &lt;/form&gt; And this is my javascript for calculating the money=days*price &lt;script language="javascript" type="text/javascript"&gt; function result() { var a = document.getElementById("checkin").value; var b = document.getElementById("checkout").value; var checkin = moment(a).format('DD-MM-YYYY'); var checkout = moment(b).format('DD-MM-YYYY'); var days= checkout.diff(checkin, 'days'); var price=100; alert("The money you have to pay is: "+days*price); } &lt;/script&gt; This is my test case: checkin date = 05-12-2014, checkout date = 25-12-2014 When I click submit, nothing happens. Can anyone please explain to me why and how can I fix this. Thank you!
has comment: http://stackoverflow.com/comment/45102775
score: 2
has title: Difference between two dates from user input moment js
type: Question
has comment: http://stackoverflow.com/comment/45102544
tagged with: javascript

http://stackoverflow.com/comment/45027901
has text: it was typing mistake Bart, i think the problem is data are not going into java var from php variable, as pundit said.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28341371
score: 0

http://stackoverflow.com/a/28401307
downvote count: 0
has comment: http://stackoverflow.com/comment/45138446
has comment: http://stackoverflow.com/comment/45168538
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/45139192
score: 1
has body: You can do this very simply with jQuery. First create a variable to store the click count, then increment it every time something is clicked. After a number of clicks, navigate to your URL. var clickCount = 0; $('body').click(function() { clickCount++; if (clickCount &gt;= 3) { alert("Going to Google"); //This line won't work because StackOverflow (quite rightly) //restricts it for security purposes document.location = "http://www.google.com"; } }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div id="parent"&gt; Hello, click anywhere 3 times. There's no place like home... &lt;/div&gt;
has comment: http://stackoverflow.com/comment/45138385
answers question: http://stackoverflow.com/q/28401252
accepted answer of: http://stackoverflow.com/q/28401252
type: AcceptedAnswer

http://stackoverflow.com/a/28354685
upvote count: 1
has body: If you are using Visual Studio, then you can install Web Essentials. http://vswebessentials.com/ After it is installed select all the JavaScript files, right click and under the Web Essentials menu select create JavaScript bundle file. Once the bundle is created, then you only need to reference the bundled .js file. Web essentials will update the bundle if you make changes to the individual JavaScript files
answers question: http://stackoverflow.com/q/28353170
downvote count: 0
type: Answer
score: 1

http://stackoverflow.com/q/28322902
answer count: 1
has body: I am sending a List&lt;Item&gt; from google app engine(java) to javascript through google cloud endpoints. Item: public class Item implements Serializable { private String item1; private Integer item2; private String item3; //(...) item (4-39) private String item40; //Constructor, Getters, setters, +functions } In javascript I am receiving the data with the following structure for each Item: {item1:"v1",item2:"v2"} Also at the end of each object I receive a lot of data that I don't understand why is sent. The '?' data is not my defined functions. I think that it is Serializable object functions, but I don't understand why is sent. I need to send data in this format: {"v1","v2"} instead of {item1:"v1",item2:"v2", a lot of functions} to reduce the size of data. I think to solve the problem sending the data in List&lt;String&gt; of java. But it is a bit complicated and "ugly" because for example some properties of the Item object are structured objects. Is there a way described in google cloud endpoints to send data this way? Is there any way to set endpoints only send the "necessary" data?
tagged with: java
has comment: http://stackoverflow.com/comment/45007250
accepted answer: http://stackoverflow.com/a/28371700
type: AnsweredQuestion
tagged with: javascript
has title: Data transport optimization with Google cloud endpoints
tagged with: serialization
type: Question
tagged with: google-app-engine
has comment: http://stackoverflow.com/comment/45011130
tagged with: google-cloud-endpoints
has answer: http://stackoverflow.com/a/28371700
score: 0

http://stackoverflow.com/comment/45178529
type: Comment
has text: if you want to control hiding it with css (ie `visibility:hidden`) you can also use `$('div').toggleClass('hidden');` to simply toggle a class.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28420969

http://stackoverflow.com/comment/45982456
has text: @MatejHostak I have the same problem. Did you find a way around it?
comment on: http://stackoverflow.com/q/28394097
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28294123
tagged with: aem
score: -5
tagged with: widget
type: Question
has comment: http://stackoverflow.com/comment/44977030
downvote count: 5
tagged with: javascript
has body: I have a requirement, which requires me to create a page(as like siteadmin, dam pages) in CQ with two tabs. Each tab should have a different xtype(siteadmin, useradmin). I have included these two xtypes. Any one of the xtype is rendering since the both CQ.wcm.SiteAdmin and CQ.security.UserAdmin xtypes are extending same CQ.Ext.Viewport class as per CQ widget API, There should only be one Viewport(xtype) created in a page. But page has two ViewPorts(siteadmin,useradmin). I don’t know anything about EXT JS. Can some one point me on how to integrate multiple widgets (xtypes) and integrate them into one page/application.
has title: how to integrate multiple widgets (xtypes) in one page
upvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/28302978
favorite count: 0
has comment: http://stackoverflow.com/comment/44944944
tagged with: extjs
type: UnansweredQuestion

http://stackoverflow.com/a/28440257
has body: The problem is that you are wrapping the div element in your custom component so when the ReactGridLayout component tries to set properties on its children it'll be setting them on the SimpleDiv component. You might be able to make it work by passing along the props like: var SimpleDiv = React.createClass({ render() { return ( 1 ); } }); or explicitly: var SimpleDiv = React.createClass({ render() { return ( 1 ); } }); But I'm not too familiar with ReactGridLayout so if that doesn't work you may have to ping them and ask if it's possible.
accepted answer of: http://stackoverflow.com/q/28435952
score: 2
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28435952
type: Answer
upvote count: 2

regex
tags question: http://stackoverflow.com/q/28425631
tags question: http://stackoverflow.com/q/28402904
tags question: http://stackoverflow.com/q/28388705
tags question: http://stackoverflow.com/q/28354441
tags question: http://stackoverflow.com/q/28411263
tags question: http://stackoverflow.com/q/28334756
tags question: http://stackoverflow.com/q/28376287
tags question: http://stackoverflow.com/q/28362982
tags question: http://stackoverflow.com/q/28329190
tags question: http://stackoverflow.com/q/28326950
tags question: http://stackoverflow.com/q/28356553
tags question: http://stackoverflow.com/q/28384718
tags question: http://stackoverflow.com/q/28289071
tags question: http://stackoverflow.com/q/28376921
tags question: http://stackoverflow.com/q/28423056
tags question: http://stackoverflow.com/q/28280920
tag name: regex
tags question: http://stackoverflow.com/q/28400993
tags question: http://stackoverflow.com/q/28408551
tags question: http://stackoverflow.com/q/28421288
tags question: http://stackoverflow.com/q/28380409
tags question: http://stackoverflow.com/q/28404210
tags question: http://stackoverflow.com/q/28415256
tags question: http://stackoverflow.com/q/28405427
tags question: http://stackoverflow.com/q/28305528
tags question: http://stackoverflow.com/q/28311457
tags question: http://stackoverflow.com/q/28315619
tags question: http://stackoverflow.com/q/28377488
tags question: http://stackoverflow.com/q/28377544
tags question: http://stackoverflow.com/q/28304487
tags question: http://stackoverflow.com/q/28322908
tags question: http://stackoverflow.com/q/28354378
tags question: http://stackoverflow.com/q/28349895
tags question: http://stackoverflow.com/q/28289613
tags question: http://stackoverflow.com/q/28378779
tags question: http://stackoverflow.com/q/28358962
tags question: http://stackoverflow.com/q/28419509
tags question: http://stackoverflow.com/q/28292609
tags question: http://stackoverflow.com/q/28374970
tags question: http://stackoverflow.com/q/28292214
tags question: http://stackoverflow.com/q/28347683
tags question: http://stackoverflow.com/q/28298748
tags question: http://stackoverflow.com/q/28290021
tags question: http://stackoverflow.com/q/28303255
tags question: http://stackoverflow.com/q/28421327
tags question: http://stackoverflow.com/q/28409232
tags question: http://stackoverflow.com/q/28347014
tags question: http://stackoverflow.com/q/28342156
tags question: http://stackoverflow.com/q/28312468
tags question: http://stackoverflow.com/q/28325780
tags question: http://stackoverflow.com/q/28285565
tags question: http://stackoverflow.com/q/28423919
tags question: http://stackoverflow.com/q/28374591
tags question: http://stackoverflow.com/q/28332172
tags question: http://stackoverflow.com/q/28408096
tags question: http://stackoverflow.com/q/28299546
tags question: http://stackoverflow.com/q/28412173
tags question: http://stackoverflow.com/q/28383091
tags question: http://stackoverflow.com/q/28316191
tags question: http://stackoverflow.com/q/28383102
tags question: http://stackoverflow.com/q/28313152
tags question: http://stackoverflow.com/q/28402021
tags question: http://stackoverflow.com/q/28436535
tags question: http://stackoverflow.com/q/28402057
tags question: http://stackoverflow.com/q/28388785
tags question: http://stackoverflow.com/q/28433654
tags question: http://stackoverflow.com/q/28293328
tags question: http://stackoverflow.com/q/28377937
tags question: http://stackoverflow.com/q/28326108
tags question: http://stackoverflow.com/q/28396697
tags question: http://stackoverflow.com/q/28355141
type: Tag
tags question: http://stackoverflow.com/q/28351232

http://stackoverflow.com/a/28327267
downvote count: 0
score: 1
has body: Move your theme which I'm presuming is themename.min.css below jquery.mobile-1.4.5.min.css. The way themes work in CSS is usually by overriding selectors, such as class names. If two stylesheets apply styles to the same selector, the last defined instance is the one that's used. Currently, you're defining your theme and overriding it with the main jQuery theme. Reverse the order and your problem should be fixed. Below would be an optimal loading scenario. &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="content-type" content="text/html; charset=UTF-8"&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt; &lt;link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" /&gt; &lt;link rel="stylesheet" href="jquery.mobile.icons.min.css" /&gt; &lt;link rel="stylesheet" href="themename.min.css" /&gt; &lt;script src="http://code.jquery.com/jquery-2.1.3.min.js"&gt;&lt;/script&gt; &lt;script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"&gt;&lt;/script&gt; &lt;/head&gt; For CSS: Load the default jQuery Mobile Theme Load the jQuery Mobile Icon overrides Load your custom theme `thememain.min.css` In addition, it's wise to move the JavaScript below the CSS files. CSS Files are downloaded in parallel whereas JavaScript files are usually downloaded and parsed one at a time.
accepted answer of: http://stackoverflow.com/q/28327182
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28327182
type: Answer

http://stackoverflow.com/q/28360780
tagged with: javascript
has title: Stop Console javascript commands in browser like chrome
tagged with: ajax
has answer: http://stackoverflow.com/a/28360975
accepted answer: http://stackoverflow.com/a/28360975
has comment: http://stackoverflow.com/comment/45064049
has comment: http://stackoverflow.com/comment/45063997
has comment: http://stackoverflow.com/comment/45064016
has body: I have my website which has this issue. It could be hacked easily through javascript.If the hacker types this in his console he can easily add a user in my database and can signup without going through the stuff like checking password length , checking username length and so on ... $.post("extra/includes/signup/register.inc2.php",{username:"user1234",email:"email@live.com",p:"here goes password"}) I want a code that could stop him from using console in my website. And if there is no way to do that then how to fix it by some other means ?
has answer: http://stackoverflow.com/a/28361008
tagged with: php
possible better answer: http://stackoverflow.com/a/28361008
type: AnsweredQuestion
tagged with: post
type: Question
score: 0
answer count: 2

http://stackoverflow.com/comment/45201423
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28425409
has text: I have already checked if the line rasterization works okay and it does. I have noticed the problem only occurs only when there are lines with negative slopes.

http://stackoverflow.com/comment/45125069
type: AnswerComment
has text: What do you mean "access the code"? Are you talking about link function where you can manipulate with `scope.attr` object?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28394154

http://stackoverflow.com/q/28315205
favorite count: 0
has answer: http://stackoverflow.com/a/36808570
has body: Initially I had: &lt;input type="text"id="requested" name="requested" ref="requested" /&gt; which was readonly. changing it to: &lt;input type="text" onChange={function() {}} id="requested" name="requested" ref="requested" /&gt; made it accept input from keyboard. Why does this happen?
has answer: http://stackoverflow.com/a/28315332
has title: Why does react make input[type="text"] fields readonly unless I supply onChange callback?
type: AnsweredQuestion
tagged with: javascript
score: 22
accepted answer: http://stackoverflow.com/a/28315332
type: Question
upvote count: 22
tagged with: reactjs
answer count: 2
downvote count: 0
possible better answer: http://stackoverflow.com/a/36808570

http://stackoverflow.com/q/28326737
answer count: 1
has title: Simple ajax function for a basic html site
favorite count: 0
has comment: http://stackoverflow.com/comment/45001054
accepted answer: http://stackoverflow.com/a/28326837
tagged with: css
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45001129
score: -1
type: Question
has comment: http://stackoverflow.com/comment/45001259
upvote count: 0
has answer: http://stackoverflow.com/a/28326837
tagged with: javascript
tagged with: jquery
has body: I'm a total beginner and I'm trying to build a little project with some friends but I do not know where the problem is. The html site is really simple and looks as following: The Arena of Champions! Welcome to the Arena! START now what I want the ajax function to do is to just reload my main div and replace it with a second page I have that is called player1.html. That site looks as following: Player 1 Where am I going wrong? I've tried to search here for examples but everyone is using different types of code and it confuses me even more. So basically all I want to do is just to update the main div with the contents of the main div in the "player1.html" site. I appreciate all help!
tagged with: ajax
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/50299200
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28333962
type: QuestionComment
has text: @ribsies maybe put all files in one simple file works nice, but maybe I don't need to load so much lines of code if the user just stands on my login web page. So maybe the question is asking for something else.

http://stackoverflow.com/comment/45086183
type: AnswerComment
type: Comment
has text: @CalneRicardoSouza do you have a domain name `www.Iamsouza.com` ?
comment on: http://stackoverflow.com/a/28372740
score: 0

http://stackoverflow.com/q/28300033
score: 0
upvote count: 1
answer count: 1
downvote count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/28300103
has body: I have the following structure in my Javascript which then outputs Json: request.on('row', function(columns) { trans.push({ key : columns[0].value, value :columns[1].value, locale : columns[2].value }); }); The current format which it creates: { "key": "keyname1", "value": "some value in here", "locale": "ar_AE" }, { "key": "keyname2", "value": "some value in here", "locale": "ar_AE" } But would like the structure of the json to be like the following: { "keyname1": { "value": "some value in here", "locale": "ar_AE" }, "keyname2": { "value": "some value in here", "locale": "ar_AE" } Seem to be a bit stuck on how to this, can anyone help??
linked to: http://stackoverflow.com/q/3515523
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/44951628
has answer: http://stackoverflow.com/a/28300103
type: Question
tagged with: javascript
has title: How do you format json and then output it via Javascript?

http://stackoverflow.com/a/28317556
has comment: http://stackoverflow.com/comment/44986037
score: 0
has comment: http://stackoverflow.com/comment/45027538
has comment: http://stackoverflow.com/comment/44984936
type: Answer
has body: Added the javascript file. In visual studio : drag and drop the js file to the aspx and it will make a tag like &lt;script src="~/Scripts/jquery.min.js"&gt;&lt;/script&gt; Calling Javascript from codebehind in codebehind ScriptManager.RegisterStartupScript(this, GetType(), "displayalertmessage", "Showalert('test');", true); ScriptManager.RegisterStartupScript(this, GetType(), "importingdone", "ImportingDone();", true); calls this scripts in the front &lt;script type="text/javascript"&gt; function Showalert(name) { alert('Profile not parsed!!' + name); window.parent.parent.parent.location.reload(); } function ImportingDone() { alert('Importing done successfull.!'); window.parent.parent.parent.location.reload(); } &lt;/script&gt; Note : first call is with parameter, second without. If you need otherwise read the article below. http://www.codeproject.com/Tips/850541/JqueryAjaxToCs Hope it helps you
answers question: http://stackoverflow.com/q/28316604
has comment: http://stackoverflow.com/comment/44985576

http://stackoverflow.com/comment/45049698
has text: Do you have custom CSS(some media query) that aims `#accordion` ? Post that here then.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28352722
score: 0

http://stackoverflow.com/a/28408887
has comment: http://stackoverflow.com/comment/45151704
answers question: http://stackoverflow.com/q/28408138
has body: What you are looking for (as I mentioned in the comments) is the calc() function in CSS. calc() allows you to let CSS do some of the hard work for you, and I use it to recalculate percentage sized widths into pixel sized ones for browsers that support it. For backwards compatibility with older browsers, I'd suggest trying the following snippet. #windowBar { width: 100%; padding: 0; margin: 0; height: 40px; } #windowBar .titlebar { width: 80%; width: calc(100% - 40px); height: 40px; text-align: center; float: left; background: #ececec; } #windowBar .closebutton { width: 20%; width: calc(40px); height: 40px; float: left; background: #ddd; } My Window Title Close After this its a matter of styling, position (aka use fixed and creating your own scrollable area between the bars (using something like height: calc(100% - 40px);)) and so on. This is a very simple problem actually.
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45151616
has comment: http://stackoverflow.com/comment/45152002
upvote count: 1
has comment: http://stackoverflow.com/comment/45151922
type: Answer

http://stackoverflow.com/a/28397853
accepted answer of: http://stackoverflow.com/q/28397724
answers question: http://stackoverflow.com/q/28397724
has body: If you are trying to do it in a generic way you could make an instanceof check against the input element's interface class: if( element instanceof HTMLInputElement ){ element.value = "foo"; } else { element.innerHTML = "foo"; }
type: AcceptedAnswer
upvote count: 5
downvote count: 0
has comment: http://stackoverflow.com/comment/45131864
score: 5
type: Answer

http://stackoverflow.com/comment/44946424
has text: but he say it was in `javascript/submitDate.js`. Lowercase 'J'.
type: Comment
comment on: http://stackoverflow.com/a/28297042
score: 0
type: AnswerComment

http://stackoverflow.com/q/28334860
type: AnsweredQuestion
score: 7
has body: There is any way to set a default search value for a column in start definition? As define a default order or default search $('#table').dataTable({ ajax: {url: '...'}, order: '0', 'asc', search: { search: '...' }, columns: [ { data: "id" }, { data: "name" }, { data: "description" } ] }); For column "name", I've tried { data: "name", search: "initial search" } { data: "name", search: { search: "initial search" } } { data: "name", search: { value: "initial search" } } but none worked! Any suggestions?
type: Question
accepted answer: http://stackoverflow.com/a/28340110
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: datatables
favorite count: 0
has title: Jquery datatables default filter multiple column
has answer: http://stackoverflow.com/a/28340110
upvote count: 7

http://stackoverflow.com/q/28364803
tagged with: javascript
score: 0
linked to: http://stackoverflow.com/q/7609130
has comment: http://stackoverflow.com/comment/45071096
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45070929
downvote count: 1
has title: How does tag work in this example?
favorite count: 0
has answer: http://stackoverflow.com/a/28364972
accepted answer: http://stackoverflow.com/a/28364972
has comment: http://stackoverflow.com/comment/45071131
type: AnsweredQuestion
tagged with: forms
type: Question
has comment: http://stackoverflow.com/comment/45071065
has body: Beginner javascript question. I am trying to follow this tutorial on creating forms with restricted characters. The code is as follows: 1. Function that limits text: 2.Creation of Text area (Maximum characters: 100) You have characters left. I understand how the code works apart from this line: You have characters left. How/why does this display the remaining characters within the text area? Sorry for a very simple question, I am only starting in JS/HTML and this has really confused me.
answer count: 1

http://stackoverflow.com/q/28309512
has title: Receiving JSON Parse Error During AJAX Call
has answer: http://stackoverflow.com/a/28310533
accepted answer: http://stackoverflow.com/a/28310533
has body: I have a PHP script that is creating my JSON needed for my web app. I am using jQuery's Ajax capabilities to fetch the JSON from my PHP page that is creating the JSON. I am finding a weird quirk though. If I simply run my PHP file in the web browser and output the JSON and then I copy that JSON into a file named myJSON.json which is linked to my Ajax URL call, my code works. However, If I link directly to my PHP file in the Ajax URL call, I get the following error: Requested JSON parse failed. So here is my relevant PHP Code: <?php $groupArray = array(); // Setup the beginning of the json file $json = ' { "emails": ['; // Loop through the request results foreach ($contextIORequest->getData() as $message) { // `date_received` is in Unix time. Begin converting this to a readable date and convert it to the users timezone $newTZ = new DateTimeZone("America/Chicago"); // This will be based on the users location during production $currentTime = new DateTime(); $currentTime = DateTime::createFromFormat('U', $message['date_received']); $currentTime->setTimezone($newTZ); $formattedDateReceived = $currentTime->format('F j, Y'); // The JSON structure is organized by date (group). Each unique date will be placed in its own group in the JSON file. So we need to check if a date is already in the $groupArray. If it is, then we simply add the email data to the current date group. If the date is not already in the $groupArray, then we will need to create a new group and add the email data to the new group. if (!in_array($formattedDateReceived, $groupArray)) { // This date is not yet in the $groupArray // Check if this is the first group being added to the $groupArray. If it is, the first group added requires different formatting than all other groups that will be added if (count($groupArray) == 0) { // This is the first group being added $json .= '{ "group": "'.$formattedDateReceived.'", "list": ['; } else { // This is not the first group being added. Close the previous "group" and …
tagged with: php
has comment: http://stackoverflow.com/comment/44970965
has comment: http://stackoverflow.com/comment/44971071
has comment: http://stackoverflow.com/comment/44970235
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44970036
has comment: http://stackoverflow.com/comment/44970192
has comment: http://stackoverflow.com/comment/44970158
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/44970468
type: Question
has comment: http://stackoverflow.com/comment/44970431
has comment: http://stackoverflow.com/comment/44970131
upvote count: 1
has comment: http://stackoverflow.com/comment/44970880
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/44970079
has comment: http://stackoverflow.com/comment/44970033
has comment: http://stackoverflow.com/comment/44970283
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/44970095
has comment: http://stackoverflow.com/comment/44970166
favorite count: 0

variables
tags question: http://stackoverflow.com/q/28307310
tag name: variables
tags question: http://stackoverflow.com/q/28305494
tags question: http://stackoverflow.com/q/28304673
tags question: http://stackoverflow.com/q/28302751
tags question: http://stackoverflow.com/q/28417936
tags question: http://stackoverflow.com/q/28408394
tags question: http://stackoverflow.com/q/28376287
tags question: http://stackoverflow.com/q/28389503
tags question: http://stackoverflow.com/q/28290946
tags question: http://stackoverflow.com/q/28416384
tags question: http://stackoverflow.com/q/28414398
type: Tag
tags question: http://stackoverflow.com/q/28392726
tags question: http://stackoverflow.com/q/28345862
tags question: http://stackoverflow.com/q/28387024
tags question: http://stackoverflow.com/q/28388650
tags question: http://stackoverflow.com/q/28388458
tags question: http://stackoverflow.com/q/28380561

http://stackoverflow.com/a/28372387
type: Answer
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/45085280
has comment: http://stackoverflow.com/comment/45085151
type: AcceptedAnswer
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28372327
has body: From your code (head and body) i did not find any jquery js file included. adding something like this,
answers question: http://stackoverflow.com/q/28372327

http://stackoverflow.com/q/28350947
score: 0
answer count: 2
has body: please help with getting a right function or method to stop the setTimeout function. I've been trying with the following codes but the setTimeout "loop" could not be stopped. What i'm trying to do is to get the user's current location every 5 seconds, and then when i press the stop button. It stops getting the location. function geoTrackstart(){ //geolocation code }); timer = setTimeout(geoTrackstart, 5000); } function geoTrackstop(){ clearTimeout(geoTrackstart); timer = 0; }
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28350988
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28351053
has comment: http://stackoverflow.com/comment/45045637
has answer: http://stackoverflow.com/a/28351053
linked to: http://stackoverflow.com/q/8443151
type: Question
has comment: http://stackoverflow.com/comment/45045584
duplicate of: http://stackoverflow.com/q/8443151
has title: stopping setTimeOut();
has answer: http://stackoverflow.com/a/28350988

http://stackoverflow.com/q/28359376
has comment: http://stackoverflow.com/comment/45063058
has comment: http://stackoverflow.com/comment/45061590
has answer: http://stackoverflow.com/a/28363359
accepted answer: http://stackoverflow.com/a/28363359
has answer: http://stackoverflow.com/a/28359431
type: AnsweredQuestion
tagged with: internet-explorer
tagged with: jquery-ui
has comment: http://stackoverflow.com/comment/45061712
has body: Wanted to get a solution for this problem, when I use jquery 2.x with jquery UI, everything seems to work fine, but when I use jquery 1.x with jquery UI no action is triggering for autocomplete. When I tried to debug it in IE, there was no error found. Sample import that works: &lt;script src="jquery-2.1.1.js"&gt;&lt;/script&gt; &lt;script src="jquery-ui.min.js"&gt;&lt;/script&gt; Sample import that never works: &lt;script src="jquery-1.7.1.min.js"&gt;&lt;/script&gt; &lt;script src="jquery-ui.min.js"&gt;&lt;/script&gt; Autocomplete sample code: $(function() { $( "#automplete-1" ).autocomplete({ minLength: 3, source: function( request, response ) { processRequest(request, response); }, select:function(event, ui){ populateAddress(ui.item.idx); } }); }); This is how the code looks like within processRequest function processRequest(request, response, country){ $.getJSON('MyRestService', function(jsonResponse) { //some code }); response($.map(javaScriptArray, function(item, index) { return { value: item, idx: index, label: item }; })); }); }
type: Question
answer count: 2
linked to: http://stackoverflow.com/q/17454620
has comment: http://stackoverflow.com/comment/45061676
has comment: http://stackoverflow.com/comment/45062753
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28359431
tagged with: ajax
score: 0
has title: JQuery UI autocomplete not working in IE 10

http://stackoverflow.com/comment/45146120
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28405804
has text: Why not do this in your business logic?

http://stackoverflow.com/q/28309769
has answer: http://stackoverflow.com/a/28310003
accepted answer: http://stackoverflow.com/a/28311623
answer count: 5
has comment: http://stackoverflow.com/comment/45033820
has title: How can I avoid traversing the same DOM route multiple times?
possible better answer: http://stackoverflow.com/a/28310003
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/45030500
has answer: http://stackoverflow.com/a/28309887
upvote count: 1
has answer: http://stackoverflow.com/a/28309902
tagged with: dom
has comment: http://stackoverflow.com/comment/44970617
type: Question
tagged with: jquery-traversing
has comment: http://stackoverflow.com/comment/44989553
has answer: http://stackoverflow.com/a/28311623
downvote count: 0
tagged with: traversal
has comment: http://stackoverflow.com/comment/44973983
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28311600
has comment: http://stackoverflow.com/comment/44970581
has body: I have an on function that has two mouse events inside of it mouseenter and mouseleave. When these events are triggered they run different functions, one adds a class, the other removes it. $(this).siblings('.testimonial').find('p').addClass('unseen'); $(this).siblings('.testimonial').find('p').removeClass('unseen'); The thing is, I’m doing the following DOM traversal twice: $(this).siblings('.testimonial').find('p') But I don’t see how I can save this traversal as a variable in one function and use it as another. Here is my full JS code: JavaScript (function ($) { var testimonial = $('.testimonial'); var testimonialHeight = testimonial.outerHeight(); var testimonialWidth = testimonial.outerWidth(); testimonial.find('p').addClass('unseen'); testimonial.css({ height: testimonialHeight, width: testimonialWidth }); $('.client').on({ mouseenter: function() { $(this).siblings('.testimonial').find('p').removeClass('unseen'); }, mouseleave: function() { $(this).siblings('.testimonial').find('p').addClass('unseen'); } }); })(jQuery); HTML 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. 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. 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 …
favorite count: 0
has comment: http://stackoverflow.com/comment/44973936
has comment: http://stackoverflow.com/comment/44973840

http://stackoverflow.com/q/28370537
has body: I'm trying to add unit tests to an angular controller using karma but I've run into an issue and I need some help. I've found similar questions asked here but none have led me to an answer. I've tried changing the order of the "files" array in the karma.conf.js thinking perhaps they weren't being loaded properly but that hasn't yielded any results. When I run 'karma start karma.conf.js' I get the error console error from karma Error: [$injector:modulerr] Failed to instantiate module undefined due to: Error: [ng:areq] Argument 'fn' is not a function, got undefined at assetArg (D:/xxxx/bower_components/angular/angular.js:1580 ... ... ... (long callstack within angular.js and angular-mocks.js) ... ... at workFn (D:/xxxx/bower_components/angular-mocks/angular-mocks.js:2172 I'm only using one test file for now, and it's very basic. The module name is correct and the 'myApp.views.view1` file is being served by the karma server, the "debug" level karma logging confirms it view1_test.js 'use strict'; describe('myApp.views.view1 module', function() { beforeEach(module('myApp.views.view1',[])); describe('view1 controller', function(){ it('should exist....', inject(function($controller) { //spec body var view1Ctrl = $controller('View1Ctrl'); expect(view1Ctrl).toBeDefined(); })); }); }); And heres' the view controller it's testing view1.js 'use strict'; angular.module('myApp.views.view1', ['ngRoute']) .config(['$routeProvider', function($routeProvider) { $routeProvider.when('/view1', { templateUrl: 'src/views/view1/view1.html', controller: 'View1Ctrl' }); }]) .controller('View1Ctrl', ['$scope','$anchorScroll',function($scope,$anchorScroll) { //scroll to top of page $anchorScroll(); $scope.testVar = "it works, congrats!"; }]); directory structure / .bowerrc .gitignore bower.json package.json karma.conf.js /sass_styles base.scss /app index.html /src app.js /bower_components /directives /example directive.js template.html /views /view1 view1.html view1.js view1_test.js /styles bas…
upvote count: 1
has answer: http://stackoverflow.com/a/28370691
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/28370691
has title: Angular Karma test not running properly, gives error "Argument 'fn' is not a function, got undefined"
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jasmine
tagged with: karma-jasmine
favorite count: 0
tagged with: karma-runner
tagged with: angularjs

angularjs-scope
tags question: http://stackoverflow.com/q/28320204
tags question: http://stackoverflow.com/q/28326210
tags question: http://stackoverflow.com/q/28396928
tags question: http://stackoverflow.com/q/28296340
tags question: http://stackoverflow.com/q/28290891
tags question: http://stackoverflow.com/q/28281648
tags question: http://stackoverflow.com/q/28305814
tags question: http://stackoverflow.com/q/28317997
tags question: http://stackoverflow.com/q/28375047
tags question: http://stackoverflow.com/q/28305031
tags question: http://stackoverflow.com/q/28319610
tags question: http://stackoverflow.com/q/28284480
tags question: http://stackoverflow.com/q/28426040
tags question: http://stackoverflow.com/q/28398908
tags question: http://stackoverflow.com/q/28406239
tags question: http://stackoverflow.com/q/28410222
tag name: angularjs-scope
tags question: http://stackoverflow.com/q/28393141
tags question: http://stackoverflow.com/q/28288955
tags question: http://stackoverflow.com/q/28290581
tags question: http://stackoverflow.com/q/28386753
tags question: http://stackoverflow.com/q/28316388
tags question: http://stackoverflow.com/q/28368316
tags question: http://stackoverflow.com/q/28299388
tags question: http://stackoverflow.com/q/28394552
tags question: http://stackoverflow.com/q/28412126
tags question: http://stackoverflow.com/q/28365375
tags question: http://stackoverflow.com/q/28285499
type: Tag

http://stackoverflow.com/comment/45029842
has text: @Andy I am sending date to a WCF service and it is accepting date format only as ""\/Date(1208559600000-0700)\/"" format. Can it be possible to convert a date string to the above format in Javascript.
type: QuestionComment
comment on: http://stackoverflow.com/q/28342630
score: 0
type: Comment

http://stackoverflow.com/comment/45138057
type: Comment
has text: Also, instead of using errorMsg and populating messageHtml with a forEach loop, you can simplify your code and only use messageHtml. Then replace the errorMsg.push() by messageHtml += "..."
comment on: http://stackoverflow.com/a/28401295
score: 0
type: AnswerComment

http://stackoverflow.com/q/28281730
type: Question
has body: So I have: var arr = [1, 2], numArr = [3, 4, 5]; // I want arr = [1, 2, 3, 4, 5]; So I want to be able to push numArr into arr. But the key point is that I want to do it in place. (meaning that I don't generate a new array and assign it to arr). Right now I'm using: [].push.apply(arr, numArr); But I was wondering if there's a cleaner alternative using Underscore or native JS.
accepted answer: http://stackoverflow.com/a/28281834
tagged with: javascript
has comment: http://stackoverflow.com/comment/44918331
has title: Pushing a flattened array to another array in javascript
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/28281834
has comment: http://stackoverflow.com/comment/44917772
favorite count: 0
type: AnsweredQuestion
downvote count: 0
tagged with: underscore.js
score: 1
has comment: http://stackoverflow.com/comment/44918195

http://stackoverflow.com/comment/45154725
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28410633
has text: It is somewhat hard to understand what you want to achieve. Please consider editing your question to make sure you get valuable answers. Provide us with some details and try explaining your particular situation. Also why have you added the `brunch` tag but never mentioned brunch within qour question?

http://stackoverflow.com/q/28435666
has comment: http://stackoverflow.com/comment/45247176
type: Question
has title: How to make Content Grouping work in Google Analytics?
tagged with: google-analytics
accepted answer: http://stackoverflow.com/a/28488431
tagged with: javascript
has comment: http://stackoverflow.com/comment/45208824
has comment: http://stackoverflow.com/comment/45211391
has comment: http://stackoverflow.com/comment/45281596
score: 6
has body: I am trying to group my content using the Content Grouping feature in Google Analytics. My website has two main groupings - "Red Products" and "Orange Products". Under each grouping my products are divided into groups like "Pressing", "Diagnostics" under "Red Products" and "Power Tools", "Saws" under "Orange Products". I went to the Google Analytics dashboard and in the admin tab I created two groupings for "Red Products" and "Orange Products" with slots 1 and 2 respectively. On each page under every group I am sending a "_setPageGroup" from my script. For my "Pressing" category every page under it sends this: _gaq.push(['_setPageGroup', '1', 'Pressing']); My "Saws" category sends this: _gaq.push(['_setPageGroup', '2', 'Saws']); I created a custom dashboard in Google Analytics where I put my "Red Products" grouping as a dimension and PageViews as a metric for this dimension. I did the same for the "Orange Products" category. I visited some of the pages and after some time I checked my custom dashboard. It didn't categorize my content. At first I thought that I am not sending the category correctly and I decided to check with my Chrome Google Analytics debugger plugin. Here is what it shows: _gaq.push processing "_setPageGroup" for args: "[1,Pressing]" The debugger plugin also shows: Screen Resolution : 1920x1080 Browser Size : 1899x971 Color Depth : 24-bit Page Group : 1:Pressing Cachebuster : 1887104810 I think this is an indicator that it correctly categorizes my "Pressing" group under slot 1. Why it doesn't show anything in my custom dashboard in Google Analytics? How much time does it take to update the metrics?
has comment: http://stackoverflow.com/comment/45296293
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/45289665
has answer: http://stackoverflow.com/a/28488431
upvote count: 6
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45239189

http://stackoverflow.com/comment/77859062
comment on: http://stackoverflow.com/a/28402558
score: 0
type: AnswerComment
type: Comment
has text: nvm there are async functions, u can await the resolution of a promise

http://stackoverflow.com/comment/44982398
type: QuestionComment
has text: I have édited my question to add a JsFiddle. And to show why I need to evaluate the value with "containts" filter. Sorry for omission
type: Comment
comment on: http://stackoverflow.com/q/28316334
score: 0

http://stackoverflow.com/q/28305590
favorite count: 0
has comment: http://stackoverflow.com/comment/44962399
answer count: 0
type: UnansweredQuestion
has body: I am trying to build a very simple rich-text editor for customers of my product to customize emails that are sent. An email is mostly just plain text, but it also has the ability to have placeholders - such as "Dear username". Rather than have my users learn some sort of custom syntax to mention placeholders (I want to avoid having them feel like they are doing anything that remotely resembles programming), I would like them to be able to click buttons for the placeholders, at which point the placeholder will be inserted inline into the text area. If this seems confusing, the closest similarity I can think of is in Facebook or Google+. Both Facebook and Google+ feature a "status" text area where people can share a short amount of mostly-unformatted text. In this text area, they can also tag friends - at which point a new immutable object is added to the text area. People are free to edit text around this object, and it will be moved appropriately. I'm unsure how to build such a control. My first attempts were to use contenteditable, but that seems riddled with cross-browser incompatibilities, and generally a road of pain. What would people advise to build such a feature?
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/44962430
type: Question
has comment: http://stackoverflow.com/comment/44962429
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44962598
has title: How can I build a custom text-area control with support for immutable placeholders?

http://stackoverflow.com/q/28326108
has title: angularjs ui router regex
has answer: http://stackoverflow.com/a/28337157
has body: I'm trying to match 1 paramater that can have 2 kinds of values: 'current' or a number with at least 10 cyphers. I've tried: url: '/history/{code:^current$|^[0-9]{10,}$}' When I use this regexp I get my app to go to history/current, but when I reload the page it goes back to the default. Can anyone help by saying what am I doing wrong or how could I debug that?
accepted answer: http://stackoverflow.com/a/28337157
score: 2
type: AnsweredQuestion
tagged with: angular-ui-router
type: Question
upvote count: 2
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: regex
downvote count: 0
tagged with: angularjs

http://stackoverflow.com/comment/45148140
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28391701
has text: I think the new image source did not have time to properly load before you requested it to be drawn. It seems you have two canvases, one to rotate the image on and then copy that look onto your viewing-canvas. As a test, try putting both canvases next to each other and compare them. The "canvas" should show the correctly rotated image and "Canvas" should stay 1 rotation-step behind. Why don't you let the image rotate in your main canvas?
type: Comment

http://stackoverflow.com/q/28324651
accepted answer: http://stackoverflow.com/a/28324704
has title: Return value from Node.js module with asynchronous function
tagged with: asynchronous
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28324704
upvote count: 5
type: Question
score: 5
has body: I wrote a module for my Node.js project which processes some data and is supposed to return the result, like that: var result = require('analyze').analyzeIt(data); The problem is that analyze.js depends on an asynchronous function. Basically it looks like this: var analyzeIt = function(data) { someEvent.once('fired', function() { // lots of code ... }); return result; }; exports.analyzeIt = analyzeIt; Of course, this cannot work because result is still empty when it is returned. But how can I solve that?
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/a/28310048
downvote count: 0
answers question: http://stackoverflow.com/q/28310005
has comment: http://stackoverflow.com/comment/44971253
upvote count: 2
type: AcceptedAnswer
has body: You are only calculating the window width once at page load, and you are always using that same width to resize. simply update that variable inside your onresize function like so: window.onresize = function(event) { Lscreen=window.innerWidth; largeur=Lscreen-17; // add this line //alert(Lscreen); $("#player").attr("width", largeur); $("#player").attr("height", largeur*.78); }
type: Answer
accepted answer of: http://stackoverflow.com/q/28310005
score: 2

http://stackoverflow.com/a/29261884
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28328077
answers question: http://stackoverflow.com/q/28328077
type: AcceptedAnswer
downvote count: 0
has body: For null values my function returns null (d3.scale.liner() returns 0 in this case). The primary approach is to wrap the original scale and all its methods. I didn't test this function for all cases. But for basic functionality it's working. Unfortunately I didn't found easier way to do it :( /** * d3.scale.linear() retrun 0 for null value * I need to get null in this case * This is a wrapper for d3.scale.linear() */ _getLinearScaleWithNull: function() { var alternativeScale = function(origLineScale) { var origScale = origLineScale ? origLineScale : d3.scale.linear(); function scale(x) { if (x === null) return null; //this is the implementation of new behaviour return origScale(x); } scale.domain = function(x) { if (!arguments.length) return origScale.domain(); origScale.domain(x); return scale; } scale.range = function(x) { if (!arguments.length) return origScale.range(); origScale.range(x); return scale; } scale.copy = function() { return alternativeScale(origScale.copy()); } scale.invert = function(x) { return origScale.invert(x); } scale.nice = function(m) { origScale = origScale.nice(m); return scale; } scale.ticks = function(m) { return origScale.ticks(m); }; scale.tickFormat = function(m, Format) { return origScale.tickFormat(m, Format); } return scale; } return alternativeScale(); },
type: Answer
score: 2

http://stackoverflow.com/comment/45036857
type: Comment
has text: @DavidP — `querySelector` returns the first element that matches the selector. It doesn't return the document object and provide a custom `addEventListener` method that does event delegation with checking on the selector. And you *have* to add an event listener if you want to do something on an event - doing it with JavaScript is a much cleaner approach than `onclick` attributes.
type: AnswerComment
comment on: http://stackoverflow.com/a/28346136
score: 0

http://stackoverflow.com/q/28310619
type: Question
has title: Is it possible to suppress top-level this errors?
upvote count: 1
downvote count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44972945
score: 0
has comment: http://stackoverflow.com/comment/44973949
answer count: 0
has comment: http://stackoverflow.com/comment/44974072
tagged with: babeljs
type: UnansweredQuestion
has body: I'm using 6to5 to compile ES6 code snippets but get ReferenceError: unknown: Line 1: Top level this is undefined in strict mode errors when compiling e.g. var to5 = require('6to5'); to5.transform('this.x = 42').code The error makes sense but I want to compile snippets that reference this, is there any way to suppress the error and continue compiling?

http://stackoverflow.com/q/28403940
tagged with: datetime
has body: When developing an firefox add-on the following gives different results? var out = document.getElementById('out'); out.textContent += new Date(2015, 1, 6, 16, 0, 0, 0) + '\n'; // -&gt; Date "2015-02-06T15:00:00.000Z" correct, months are zero-based var dt = new Date(0, 0, 0, 0, 0, 0, 0); dt.setFullYear(2015); dt.setMonth(1); dt.setDate(6); dt.setHours(16); out.textContent += dt + '\n'; // -&gt; Date "2015-03-06T15:00:00.000Z" ?? &lt;pre id="out"&gt;&lt;/pre&gt; The problem is the setMonth(1) sets March in the second case. This happens to arbitrary dates, other dates work just fine with both approaches. Any idea why? var out = document.getElementById('out'); out.textContent += new Date(2015, 0, 30, 16, 0, 0, 0) + '\n'; // -&gt; 2015-01-30T15:00:00.000Z" months are zero-based var dt = new Date(0, 0, 0, 0, 0, 0, 0); dt.setFullYear(2015); dt.setMonth(0); dt.setDate(30); dt.setHours(16); out.textContent += dt + '\n'; // -&gt; 2015-01-30T15:00:00.000Z &lt;pre id="out"&gt;&lt;/pre&gt;
tagged with: rollover
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28404675
type: Question
tagged with: javascript
tagged with: date
accepted answer: http://stackoverflow.com/a/28404675
answer count: 1
downvote count: 0
favorite count: 0
has title: Javascript Date issue when using setMonth
upvote count: 2

http://stackoverflow.com/comment/45183607
type: QuestionComment
has text: Now I get `{{q.id}}`
comment on: http://stackoverflow.com/q/28425711
score: 0
type: Comment

http://stackoverflow.com/comment/45099748
comment on: http://stackoverflow.com/q/28380106
type: Comment
type: QuestionComment
score: 0
has text: Did you also provide the spade which we need to dig through this code?

http://stackoverflow.com/comment/45131414
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28396546
has text: @TheZenCoder Posted a alternative approach template , specific to invocation pattern of applying string or object arguments ; though did not address internal `init` function . Your piece is probably what OP is looking for ; possesses far greater detail and addresses `init` function . Cheers:)
score: 0

http://stackoverflow.com/q/28290278
downvote count: 0
type: AnsweredQuestion
score: 2
tagged with: jinja2
type: Question
upvote count: 2
answer count: 1
tagged with: javascript
tagged with: flask
accepted answer: http://stackoverflow.com/a/28290638
has title: Using Flask data to generate Javascript. Bad idea?
has body: In teaching myself Flask, I have fallen into the habit of doing something like this in some of my templates: &lt;script type="text/javascript"&gt; {% for r in reviews %} $('#{{ r.review_id }}-starrating').raty({readOnly: true, score: {{ r.rating/100 * 5 }} }); {% endfor %} &lt;/script&gt; I didn't think twice about it when I first needed something like this done. But coming back to this code now worries me. Is this considered bad practice? How should I do this instead?
favorite count: 0
has answer: http://stackoverflow.com/a/28290638

http://stackoverflow.com/q/28433975
accepted answer: http://stackoverflow.com/a/28434301
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/45198196
has answer: http://stackoverflow.com/a/28434301
tagged with: twitter-bootstrap
score: 0
type: Question
type: AnsweredQuestion
has body: First of all, I have a form with several input fields and some Bootstrap-Buttons. Now, what I want to do is to check, if two conditions ("Are all input fields filled?" ; "Is at least one Button pushed down?") are fullfilled to enable the user to click the submit button. This is my code: function checkInput() { var inputFields = $("input[name=inp1],[name=inp2],[name=inp3]"); var buttons = $("button[name=btn1],[name=btn2],[name=btn3]"); var empty1; var empty2; buttons.click(function() { if(!$(this).hasClass('active')) { empty1 = false; } else { empty1 = true; } }); inputFields.keyup(function() { inputFields.each(function() { if($(this).val().length == 0) { empty2 = true; } else { empty2 = false; } }); }); alert(empty1); alert(empty2); if(empty1 == true &amp;&amp; empty2 == true) { $('button[name=submitBtn]').prop('disabled', false); } else { $('button[name=submitBtn]').prop('disabled', true); } } The alert(...) functions say, that empty1 and empty2 are "undifined", which i can understand. But my question is, how can I retrieve the true or false values from buttons.click() and inputFields.keyup() to query them afterwards?
tagged with: javascript
has title: How to query multiple conditions or results of anonymous functions in jQuery

http://stackoverflow.com/q/28297004
tagged with: function
downvote count: 0
tagged with: javascript
favorite count: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
upvote count: 1
tagged with: onload
has title: Javascript function not running with no errors
has answer: http://stackoverflow.com/a/28297326
score: 1
has body: here is my function which is put into its own file(Javascript/submitDate.js): document.onload = function(){ function submitDate(){ var time = new Date(); var nowDate =time.toISOString().slice(0,-14); document.getElementById("dateShow").value=nowDate; } submitDate(); }(); This ran fine before I joined the page with my index.(When I put all my javascript and page layout into one file) Here is the page(projectMain.html) of the code: Entries close on the 10th of March Last submitted: No errors pop up and it just shows the date layout box as: mm/dd/yyyy EDIT: The folder has a capital J. Edit 2.0: Link to what is shown. Underneath the "last submitted" is the date function that is not working. : http://prntscr.com/60ie8k Edit 3.0: Here is my Index: Sample Template Little Big Planet Home Power Ups Sackbots Costumes Form
has answer: http://stackoverflow.com/a/28297050
type: Question
has answer: http://stackoverflow.com/a/28297042

http://stackoverflow.com/q/28356361
has comment: http://stackoverflow.com/comment/45057177
has body: I have a form on the left side of the page, and on the right is some plain text. In the form, there is an input. When a user types in the input, part of the plain text needs to be replaced with the input value. So, for my HTML I have - Add your custom text I go to libraries. I don't have a clue on where to start with JavaScript. Both JQuery and plain JavaScript answers are welcome. I might prefer JavaScript since I'd like to learn more about it. Basically I'm trying to build an html generator. Edit - So the gist is, when a user types text into an input, how can I use that value to replace part of a string already on the page? Ideally, the update would be automatic and would not require a form submission. I found an answer here that is close to what I'm looking to do -How do I get a dynamic form to update Text in HTML? The difference is that I'm trying to find a string on the page and change it rather than finding an element and adding an inner string.
type: Question
has comment: http://stackoverflow.com/comment/45063144
answer count: 2
has title: How to dynamically replace part of a string with an input's value?
has comment: http://stackoverflow.com/comment/45056438
tagged with: javascript
tagged with: jquery
score: -1
has comment: http://stackoverflow.com/comment/45056182
linked to: http://stackoverflow.com/q/21864208
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has comment: http://stackoverflow.com/comment/45056207
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28356751
downvote count: 2
has comment: http://stackoverflow.com/comment/45056621
has comment: http://stackoverflow.com/comment/45056937
upvote count: 1
has answer: http://stackoverflow.com/a/28356676
has comment: http://stackoverflow.com/comment/45063398

http://stackoverflow.com/a/33499434
type: Answer
answers question: http://stackoverflow.com/q/28317182
has comment: http://stackoverflow.com/comment/83494262
has comment: http://stackoverflow.com/comment/89567245
has comment: http://stackoverflow.com/comment/65625480
has comment: http://stackoverflow.com/comment/65564987
has comment: http://stackoverflow.com/comment/83920184
downvote count: 0
score: 61
has body: But it would be possible if one were used in place of the variable in @html.Hidden field. As in this example. @Html.Hidden("myVar", 0); set the field per script: &lt;script&gt; function setMyValue(value) { $('#myVar').val(value); } &lt;/script&gt; I hope I can at least offer no small Workaround.
upvote count: 61

http://stackoverflow.com/comment/44968542
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28308777
has text: The reason I want to use validator.js instead of validate.js is because validator.js includes built-in validation that validate.js doesn't have.
type: Comment

http://stackoverflow.com/q/28298717
answer count: 1
linked to: http://stackoverflow.com/q/7742781
favorite count: 0
has comment: http://stackoverflow.com/comment/44949289
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28579756
has title: How to fix IE9 issue with f12?
upvote count: 3
has comment: http://stackoverflow.com/comment/45168702
has comment: http://stackoverflow.com/comment/44949770
has comment: http://stackoverflow.com/comment/44949656
type: Question
tagged with: internet-explorer
has body: I need to be able to run my angularjs app in IE9 but this currently only works with devtools open(F12). From what I am aware is that console.log can cause this but this is stripped out in the app , I am using gulp.stripDebug. What can be another cause or is this a IE9 bug? Is there a way of debugging/tracking js code without having to open the devtools at the same time?
downvote count: 0
tagged with: javascript
score: 3

http://stackoverflow.com/comment/45042724
type: QuestionComment
comment on: http://stackoverflow.com/q/28349396
score: 1
has text: "not working" how? What do you expect to happen, and what happens instead? What do you see in the console? When you debug?
type: Comment

http://stackoverflow.com/comment/44986064
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28318524
type: Comment
has text: something like what you said

http://stackoverflow.com/q/28360854
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: ajax
has title: second ajax request not working on mobile browsers
has body: I am attempting to build a weather station with it's own webserver. So far the page's code is like so: WS-100 Server WS-100 Weather Station It works great on desktop browsers, but on mobile browsers only the datetime shows, and on my old samsung galaxy, none of it shows. I have considered merging the two queries into one, but eventually I want to do at least two requests: one for the current time and temperature and one which downloads and processes a txt file of the historical measurements. Is this just a limitation of the browsers or should there be a way to fix it?
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/28360959
has comment: http://stackoverflow.com/comment/45064173
has answer: http://stackoverflow.com/a/28361037
score: 1
has comment: http://stackoverflow.com/comment/45064257
type: Question
answer count: 2

http://stackoverflow.com/comment/45136197
comment on: http://stackoverflow.com/q/28373032
score: 0
type: Comment
type: QuestionComment
has text: map.fitBounds(bounds); (: this code is there, I forgot to put here. @geocodezip I'll try using your code, thanks.

http://stackoverflow.com/a/28302669
type: Answer
answers question: http://stackoverflow.com/q/28295678
has body: May be you can use the pushPlugin https://github.com/phonegap-build/PushPlugin and use method function onNotification(e) ?
score: 0

http://stackoverflow.com/q/28357743
type: Question
has answer: http://stackoverflow.com/a/28357804
accepted answer: http://stackoverflow.com/a/28357762
answer count: 3
has answer: http://stackoverflow.com/a/28357778
has comment: http://stackoverflow.com/comment/45058735
upvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28357762
downvote count: 1
has body: I am having a issue trying to work out the remaining percentage between 2 numbers. I have worked out how to get the current percentage by using the following function: function GetPercentage(x,y){ return ((x /y) * 100).toFixed(0); } The part I need help with is to get the remaining percentage. For Example: Lets say the maximum is 31 and I have a value of 1, how can I return the value 97% Using my function above if I use GetPercentage(1,31) it would return 3. However, I need help with the function to return 97. I have tried using the following but doesn't seem to work.. I am guessing my Math isn't correct and hoping someone can correct me. alert(GetPercentage(1,31) + "%" + " used. " + availablePercentage(5,31) + "% still available"); // trying to make it say: 3% used. 97% still available function GetPercentage(x,y){ return ((x / y) * 100).toFixed(0); } function availablePercentage(x,y){ return ((y-x)/100).toFixed(0); }
type: AnsweredQuestion
has title: JavaScript Get Percentage
tagged with: javascript
score: -1
possible better answer: http://stackoverflow.com/a/28357778

http://stackoverflow.com/q/28280087
accepted answer: http://stackoverflow.com/a/28296309
answer count: 1
tagged with: javascript
has body: Is there a way to remotely debug a website? I've just finished putting together a website that has some jquery animations. The site works fine on every machine/configuration I've tested it on. One of the people the site needs to work for, however, reports that the animations don't work; which effectively breaks the website. I strongly suspect his companies' network is the root of the problem; however diagnosing this is challenging as he is not a technical user and guiding him through the webkit inspector/console, etc. is not really an option. Ideally I'd like to be able to 'capture' the network/javascript logs from IE or Chrome so that I can inspect them and attempt to work out what's gone wrong. Aside: I'm using an off-the-shelf Wordpress theme (http://theme.co/x/) for the site; so I expect the code is good.
favorite count: 0
score: 0
tagged with: wordpress
upvote count: 1
downvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28296309
type: Question
tagged with: debugging
has title: Remote Debug Website

http://stackoverflow.com/q/28351154
possible better answer: http://stackoverflow.com/a/28351403
answer count: 2
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/28351225
has comment: http://stackoverflow.com/comment/45046768
has comment: http://stackoverflow.com/comment/45046139
tagged with: node.js
has title: Javascript perf, weird results
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45046187
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28351403
has body: I want to know what is the better way to code in javascript for my nodejs project, so I did this: function clas(){ } clas.prototype.index = function(){ var i = 0; while(i &lt; 1000){ i++; } } var t1 = new clas(); var f = 0; var d1 = new Date(); while(f &lt; 1000){ t1.index(); f++; } console.log("t1: "+(new Date()-d1)+"ms"); f=0; var d2 = new Date(); while(f &lt; 1000){ var t2 = new clas(); t2.index(); f++; } console.log("t2: "+(new Date()-d2)+"ms"); on my browser, the first and the second are the same... 1ms and with nodejs, i have t1 = 15ms and t2 = 1ms, why? why the first take more time than the second as he doesn't initialise my class?
tagged with: javascript
has answer: http://stackoverflow.com/a/28351225

http://stackoverflow.com/q/28327763
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28327923
score: -2
favorite count: 0
tagged with: cordova
has title: Store JSON on CORS enabled backend
downvote count: 2
has answer: http://stackoverflow.com/a/28327923
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45012205
type: Question
upvote count: 0
has body: Okay so I have come here to ask this after quite a few attempts. My Aim: I am building a Phonegap app for android which uses quite a large number of JSON files. The contents of the JSON files also changes quite frequently. Currently, I am providing the JSON files in the app itself. But since the changes are frequent, I update it on PlayStore and my users have to update it after every few days. To solve this issue, I want to host the JSON online so that my app can update the JSON without app update ( I can use localStorage, etc. but that's not the real issue). I want to use Parse.com 's backend to store the JSON files (because of the ease they provide to update the data). I wrote a code: $.getJSON('myurl.parseapp.com/file.json', function(json) { // do something here }); I got the error Cross Origin Request Blocked. So I read about it and online they say that you have to enable CORS on your server before you can make such access. I don't know any way of enabling it on Parse. I also tried using JSONP plugin See here which one but it always went to the error state instead of success. I read it online and they say my site is not returning a correct JSON(What?). What is a correct JSON? It may here be noted that I have not configured my backend to handle the callback as Parse does not provide this( I guess ). Then also, I went to online tools like this which allow hosting JSON with CORS enabled backend. But the main problem is that they provide me URL to the JSON and I kind of don't like it because logic of my code requires to use some custom names and numbers. Also, updating it is a little difficult. I have not worked with any other backend before. Can anyone help me out. TL;DR I am looking for a backend that: 1. Can host my JSON files and enable CORS. 2. Allows easy updating of the JSON files. 3. Be free. :) Thanks.
answer count: 1
tagged with: javascript

universal-analytics
tag name: universal-analytics
type: Tag
tags question: http://stackoverflow.com/q/28382848

http://stackoverflow.com/comment/45071134
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28364728
has text: Ah gotcha , just create all the 's *outside* the recursive code. Keep the current for loop to change id's of those 's. Hope its clear :)
type: AnswerComment

http://stackoverflow.com/comment/45158260
type: AnswerComment
type: Comment
has text: It's totally fine to remove entries as you move through the array, you just have to handle it properly, as I explained 10 minutes ago.
comment on: http://stackoverflow.com/a/28412453
score: 1

http://stackoverflow.com/q/28348539
has comment: http://stackoverflow.com/comment/45042246
has comment: http://stackoverflow.com/comment/45042365
tagged with: mysql
tagged with: google-maps
tagged with: javascript
has title: Google Maps API with a Django Website
tagged with: google-maps-api-3
score: 0
has body: I am building a small website and am using the Django framework for my development. Parts of the site also includes using Google Maps APIs (V3), which includes using MySQL to add and save marker information as shown within the official Google documentation here: https://developers.google.com/maps/articles/phpsqlinfo_v3 I have the basic maps working fine with being able to add a marker when it is clicked, but am having difficulties to get it to work since trying to implement the MySQL into it - the map does not load within the canvas on the page. I have copied the code exactly from the link above just to see if i could get it working basic but no joy. Before I go posting up snippets of code here and there, I'm just wondering if maybe there might be a problem in the MySQL working within the Django development - I have a MySQL database synced with Django and have it running. If there is any other way around getting markers and information to save to a map, like the example above, it would be great but I cant find anything anywhere. I also looked at this guide but with similar results: http://www.sanwebe.com/2013/10/google-map-v3-editing-saving-marker-in-database
answer count: 0
type: UnansweredQuestion
tagged with: django
type: Question

http://stackoverflow.com/comment/45139888
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28378297
has text: Unfortunately I've been exceptionally diligent about destroying all objects that aren't in the current view, I'm not sure it's that issue.

http://stackoverflow.com/q/28347728
has comment: http://stackoverflow.com/comment/45040251
has answer: http://stackoverflow.com/a/28348178
has comment: http://stackoverflow.com/comment/45040409
has answer: http://stackoverflow.com/a/28373001
type: Question
has answer: http://stackoverflow.com/a/28348621
has comment: http://stackoverflow.com/comment/45042378
has title: Heavy controller communication in AngularJS
has comment: http://stackoverflow.com/comment/45040180
tagged with: javascript
has comment: http://stackoverflow.com/comment/45041822
has comment: http://stackoverflow.com/comment/45042839
has comment: http://stackoverflow.com/comment/45040320
downvote count: 0
has comment: http://stackoverflow.com/comment/45040300
score: 8
has body: I have implemented a single page application with AngularJS. The page consists of a content area in the middle and sections assembled around the center that show additional info and provide means to manipulate the center. Each section (called Side Info) and the content area have a separate AngularJS controller assigned to them. Currently, I communicate via $rootScope.$broadcast and $scope.$on(), e.g. app.controller('PropertiesController', function ($scope, $rootScope) { $scope.$on('somethingHappened', function(event, data){ // react }); }); I then call to communicate with other controllers: $rootScope.$broadcast('somethingHappened', data); I have quite a lot of communication happening between the Controllers. Especially if something is going on in the content area, several side info elements have to adopt. The other way around is also frequent: a user submits a form (located in a side info) and the content area and other side info elements have to adopt. My question: Is there a better way to handle SPA with heavy controller communication? The code works fine but it is already getting a bit messy (e.g. it is hard to find which events are handled where etc.). Since the application is likely to grow a lot in the next weeks, I'd like to make those changes (if there are any better solutions) asap.
favorite count: 0
linked to: http://stackoverflow.com/q/25608544
has comment: http://stackoverflow.com/comment/45040938
tagged with: angularjs
upvote count: 8
linked to: http://stackoverflow.com/q/14049480
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45040732
answer count: 4
has answer: http://stackoverflow.com/a/28581989

http://stackoverflow.com/q/28361701
type: Question
answer count: 1
linked to: http://stackoverflow.com/q/8620636
has answer: http://stackoverflow.com/a/28361756
accepted answer: http://stackoverflow.com/a/28361756
tagged with: javascript
has title: Is there any library or is it possible to evaluate javascript inside php?
upvote count: 1
has body: I have some html with inline javascript, I want to extract some values by php, shortly, I'm looking for something like: &lt;?php $jsre = new JavascriptRunTime(); $jsre-&gt;run("var a = 1; var b = a + 1; var c = {hello: a, world: b};"); $a = $jsre-&gt;lookinto("a"); // $a = 1; $b = $jsre-&gt;lookinto("b"); // $b = 2; $c = $jsre-&gt;lookinto("c"); // $c = array("hello" =&gt; 1, "world =&gt; 2"); Or is it possible to write one?
has comment: http://stackoverflow.com/comment/45065654
favorite count: 0
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45065715
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45065724

http://stackoverflow.com/comment/82122933
has text: It seems the solution was to give the Map a center. Thanks!
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28301224

http://stackoverflow.com/comment/45067684
comment on: http://stackoverflow.com/a/28362031
type: Comment
has text: Is it possible the iframe doesn't exist at the time you're setting the load function? You can try logging it out `console.log($('iframe.twitter-timeline').length > 0);` If it doesn't exist maybe you're load handler isn't getting set. And you might need to run it after the Twitter code has run.
score: 0
type: AnswerComment

http://stackoverflow.com/a/28350264
has comment: http://stackoverflow.com/comment/45078600
accepted answer of: http://stackoverflow.com/q/28349586
has comment: http://stackoverflow.com/comment/45078769
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45080332
type: Answer
has comment: http://stackoverflow.com/comment/45080412
has comment: http://stackoverflow.com/comment/45078705
has body: This is an example for automatically clicking a button on checkbox' onchange event: &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;xp:view xmlns:xp="http://www.ibm.com/xsp/core"&gt; &lt;xp:checkBox text="check it" id="checkBox1" value="#{viewScope.test}"&gt; &lt;xp:eventHandler event="onchange" submit="false"&gt; &lt;xp:this.script&gt;&lt;![CDATA[ document.getElementById('#{id:button1}').click() ]]&gt;&lt;/xp:this.script&gt; &lt;/xp:eventHandler&gt; &lt;/xp:checkBox&gt; &lt;br /&gt; &lt;xp:button value="Label" id="button1"&gt; &lt;xp:eventHandler event="onclick" submit="false"&gt; &lt;xp:this.script&gt;&lt;![CDATA[alert("hi")]]&gt;&lt;/xp:this.script&gt; &lt;/xp:eventHandler&gt;&lt;/xp:button&gt; &lt;/xp:view&gt;
upvote count: 3
has comment: http://stackoverflow.com/comment/45070518
has comment: http://stackoverflow.com/comment/45079256
score: 3
answers question: http://stackoverflow.com/q/28349586

http://stackoverflow.com/comment/44992206
has text: @user2927356 Check my edit, I didn't realise you didn't have the `div` on the page already.
comment on: http://stackoverflow.com/a/28322009
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45133446
score: 0
type: Comment
has text: where exactly are you including the file? and have you checked if your conditions to include the file are fullfilled? so did you check the html sourcecode to see if the file actually has been included by php?
type: QuestionComment
comment on: http://stackoverflow.com/q/28398825

http://stackoverflow.com/q/28294164
has comment: http://stackoverflow.com/comment/44941816
has body: I have several buttons which should change content of region on the page. I've read numerous tutorials how can lazy load can be implemented using ajax, but unfortunately with no success. Here is my html: Goals Achievements and here is my js: $(document).ready(function () { $('#btn_goals').on('click', function () { $.ajax({ url: '@Url.Action("Index", "Goals")', success: function (data) { $('#region_content').html(data); } }); }); $("#btn_achievements").on("click", function () { ...... }); }); what is the problem? ********** EDIT ************ Well, I changed url in ajax parameters from url: '@Url.Action("Index", "Goals")' to url: '/Goals/Index' and it starts work fine. What is the reason?
tagged with: ajax
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28294431
answer count: 1
type: UnansweredQuestion
has title: Div content load using Ajax and MVC 4
has comment: http://stackoverflow.com/comment/44940977
has comment: http://stackoverflow.com/comment/44941121
has comment: http://stackoverflow.com/comment/44941115
tagged with: asp.net-mvc-4
has comment: http://stackoverflow.com/comment/44941493
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44941049
has comment: http://stackoverflow.com/comment/44941850

http://stackoverflow.com/comment/45169383
comment on: http://stackoverflow.com/q/28417769
type: Comment
type: QuestionComment
has text: @cmorrissey I added some parameters to the error function and removed the complete function. I got some extra information when I ran it: `alert(error)` gave `parseerror` and `alert(errorThrown)` displayed `SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data`. I am guessing that ajax is implicitly trying to parse the page and is finding an error, but I have no clue on what it might be.
score: 0

http://stackoverflow.com/comment/45128194
comment on: http://stackoverflow.com/q/28393684
type: Comment
has text: I added the code snippet to question.
score: 0
type: QuestionComment

http://stackoverflow.com/q/28312575
tagged with: angularjs
linked to: http://stackoverflow.com/q/26450240
accepted answer: http://stackoverflow.com/a/28399076
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/26775808
has comment: http://stackoverflow.com/comment/45152711
has answer: http://stackoverflow.com/a/28399076
has title: Re-instantiate AngularJS Timer
type: Question
score: 0
has body: I am working on an angular app that keeps track of multiple countdown timers. I need the timers to be re-instantiated when a user selects a new value from the dropdown. I have an alert in place to confirm that the method call is happening upon selecting a new value, but I do not know how to ensure the timer is re-instantiated. I am using this timer: http://siddii.github.io/angular-timer/ apps.js: var app = angular.module('TestTimer', ['timer']); app.controller('OptionController', function() { this.Options = [{name: 'name1',attr1: 10, attr2: 15, attr3: 8, attr4: 22},{name: 'name2',attr1: 45,attr2: 45, attr3: 15, attr4: 60 }]; this.selectedOption = {name: 'Selected Option',attr1: 30, attr2: 45, attr3: 15, attr4: 60}; this.isSelectedOption = function(name) { return this.selectedOption.name === name; }; this.getOptions = function() { return this.Options; }; this.getSelectedOption = function() { return this.selectedOption; }; this.setSelectedOption = function(Option) { this.selectedOption = Option; }; this.selectedTemplate = function() { alert(this.selectedOption.name); }; }); function TimerController($scope) { $scope.timerRunning = false; $scope.startTimer = function (){ $scope.$broadcast('timer-start'); $scope.timerRunning = true; }; $scope.stopTimer = function (){ $scope.$broadcast('timer-stop'); $scope.timerRunning = false; }; $scope.resetTimer = function() { $scope.$broadcast('timer-reset'); } $scope.$on('timer-stopped', function (event, data){ console.log('Timer Stopped - data = ', data); }); $scope.$on('timer-tick', function(event, data) { console.log('Timer ticked -', data); }); } TimerController.$inject = ['$scope']; HTML: Test Timer Pick a Option attr1: {{countdown}} attr2: {{countdown}} attr3: {{countdown}} attr4 Launcher: {{countdown}} Start Timer Stop Timer attr-name: {{ main.selectedOption.name }} attr1: {{ main.selectedOption.attr1 }} attr2: {{ main.selectedOption.attr2 }} attr3: {{ main.selectedOption.attr3 }} attr4: {{ main.selectedOption.attr4 }} EDIT: …
answer count: 1
tagged with: javascript
tagged with: timer

promise
tags question: http://stackoverflow.com/q/28338337
tags question: http://stackoverflow.com/q/28430276
tags question: http://stackoverflow.com/q/28319995
tags question: http://stackoverflow.com/q/28366199
tags question: http://stackoverflow.com/q/28401679
tags question: http://stackoverflow.com/q/28354365
tags question: http://stackoverflow.com/q/28294515
tags question: http://stackoverflow.com/q/28310958
tags question: http://stackoverflow.com/q/28373838
tags question: http://stackoverflow.com/q/28370994
tags question: http://stackoverflow.com/q/28285343
tags question: http://stackoverflow.com/q/28413446
tags question: http://stackoverflow.com/q/28432401
tags question: http://stackoverflow.com/q/28375619
tags question: http://stackoverflow.com/q/28322079
tag name: promise
tags question: http://stackoverflow.com/q/28290136
tags question: http://stackoverflow.com/q/28308131
tags question: http://stackoverflow.com/q/28387762
type: Tag
tags question: http://stackoverflow.com/q/28418112
tags question: http://stackoverflow.com/q/28302848
tags question: http://stackoverflow.com/q/28352924
tags question: http://stackoverflow.com/q/28342608
tags question: http://stackoverflow.com/q/28293449
tags question: http://stackoverflow.com/q/28386411
tags question: http://stackoverflow.com/q/28286894
tags question: http://stackoverflow.com/q/28390370
tags question: http://stackoverflow.com/q/28417359
tags question: http://stackoverflow.com/q/28379922
tags question: http://stackoverflow.com/q/28354401
tags question: http://stackoverflow.com/q/28430480
tags question: http://stackoverflow.com/q/28388129
tags question: http://stackoverflow.com/q/28419348
tags question: http://stackoverflow.com/q/28400843
tags question: http://stackoverflow.com/q/28293962
tags question: http://stackoverflow.com/q/28414318
tags question: http://stackoverflow.com/q/28333405

http://stackoverflow.com/a/28358627
score: 0
answers question: http://stackoverflow.com/q/28358331
has body: Regarding your question, 'Can you use for loop inside an object [literal] ', perhaps to create a list of properties, you may do something like this: Enclose your for loop inside an immediately invoked function. From that function return the result of the loop. For example: I want to dynamically add an array of properties using for loop. var items = { list : (function(){ // immediately invoked function var arr = []; // array for (var i = 0; i &lt; 4; i++) { arr.push('item no. '+i); // add each item to array } return arr; // return the array as value of the list property })() } RESULT: items = { list : [ "item no. 0", "item no. 1", "item no. 2", "item no. 3" ] }
type: Answer

http://stackoverflow.com/comment/45028041
comment on: http://stackoverflow.com/a/28341013
has text: Does the video which you are trying this with have black edges?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28413197
answer count: 0
has comment: http://stackoverflow.com/comment/45159780
type: Question
has body: I'm trying to build a counterIncrement method that can be reused by other methods and returns the counter variable every time the method is called. var myClass = { //counter method "counter": (function(text){ var counter = 0; return function(text) { counter++ console.log(text+counter); } })(), //how do you return this function without resetting the counter every time it is called? //every time this method is called the counter increases "myMethod": function(text) { myClass.counter(text); } } myClass.myMethod('the counter is at '); //the counter is at 1, 2, 3, etc. Essentially what I'm trying to build is a reusable counter method that will instantiate new counter values and increment independent of each other. var myClass = { "counter": (function(text){ var counter = 0; var this.text = text; return function(this.text) { counter++ console.log(this.text+counter); } })(), "firstMethod": function(text) { myClass.counter(text); //do something that uses the counter }, "secondMethod": function(text) { myClass.counter(text); //do something completely different that instantiates new private counter } }
tagged with: javascript
score: 0
has title: JS closure: returning a private scope incremental counter value within an object
has comment: http://stackoverflow.com/comment/45159862
type: UnansweredQuestion

http://stackoverflow.com/a/28339711
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28339620
has body: There isn't any type system mechanism for this. Fundamentally, at runtime, Array.prototype either has a randomize function or it doesn't. You could write a standalone function that had a constraint, though: function flatten&lt;T extends Array&lt;any&gt;&gt;(arr: T[]): T { return null; // TODO implement } var x: string[][] = /* ... */; var y = flatten(x); // y: string[] var z = flatten(y); // error As an aside, you should not use that randomize function in earnest. Many sorting algorithms depend on transitivity of ordering (A &gt; B, B &gt; C implies A &gt; C) or stability (A &gt; B implies A &gt; B), which your function does not preserve. This is at best going to be non-uniform and at worst might crash some runtimes.
has comment: http://stackoverflow.com/comment/45025797
has comment: http://stackoverflow.com/comment/45025418
upvote count: 1
score: 1

http://stackoverflow.com/comment/45068938
score: 0
type: Comment
has text: You should post this as a comment, this does not answer the question
type: AnswerComment
comment on: http://stackoverflow.com/a/28363641

http://stackoverflow.com/q/28322908
tagged with: regex
has comment: http://stackoverflow.com/comment/44995444
duplicate of: http://stackoverflow.com/q/3039955
has body: I have use regex tableString.replace(/&lt;img[^&gt;]*&gt;/g, ""); for repalacing tag from my html string. How can I get rid of this problem?Please suggest another valid regular expression.
answer count: 0
type: Question
has title: JSLint reports Insecure '^' in my regex
has comment: http://stackoverflow.com/comment/44993813
tagged with: javascript
has comment: http://stackoverflow.com/comment/44993718
has comment: http://stackoverflow.com/comment/44993645
score: 0
has comment: http://stackoverflow.com/comment/44994179
has comment: http://stackoverflow.com/comment/44993758
has comment: http://stackoverflow.com/comment/44994297
has comment: http://stackoverflow.com/comment/44993717
has comment: http://stackoverflow.com/comment/44993726
linked to: http://stackoverflow.com/q/3039955
type: UnansweredQuestion

http://stackoverflow.com/comment/45042365
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28348539
has text: MySQL has nothing to do with displaying the maps, but it used to save and load the markers and corresponding info to/from the mysql database. it's just since implementing this that the map wont display

http://stackoverflow.com/q/28386665
possible better answer: http://stackoverflow.com/a/28388948
upvote count: 4
has title: How to use removeEventListener when event handler is a prototype function?
downvote count: 0
linked to: http://stackoverflow.com/q/26159405
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28388948
has answer: http://stackoverflow.com/a/28387343
type: Question
accepted answer: http://stackoverflow.com/a/28387343
has comment: http://stackoverflow.com/comment/45111566
answer count: 2
has body: This is a follow-up to this question. The problem is that my call to removeEventListener does not work. What do I have to change below so that it does work? My custom object: //Custom Editor Example with event listeners var CE = function (id) { 'use strict'; // assume not a valid object this.isValid = false; this.element = document.getElementById(id); if (this.element !== null) { this.id = id; this.init(); this.isValid = true; } }; CE.prototype.addEvent = function (event, callback, caller) { 'use strict'; // check for modern browsers first if (typeof window.addEventListener === 'function') { return caller.element.addEventListener(event, function (e) {callback.call(caller, e); }, false); } // then for older versions of IE return this.element.attachEvent('on' + event, function (e) {callback.call(caller, window.event); }); }; CE.prototype.init = function () { 'use strict'; this.addEvent('keydown', this.onCustomKeyDown, this); // add other event listeners }; This is how I'm trying to remove the event handler: CE.prototype.removeEvent = function (event, callback, caller) { 'use strict'; caller.element.removeEventListener(event, callback, false); }; CE.prototype.destroy = function () { 'use strict'; this.removeEvent('keydown', this.onCustomKeyDown, this); // remove other event listeners }; And this is the signature of the prototype function that handles the event. CE.prototype.onCustomKeyDown = function onCustomKeyDown(e) { If I understand correctly, removeEventListener cannot be used to remove event handlers which are anonymous functions. Is that the issue here? Do I need to change the way I'm calling addEventListener?
tagged with: javascript
tagged with: event-handling
score: 4
favorite count: 0

http://stackoverflow.com/q/28337099
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45020285
type: Question
has comment: http://stackoverflow.com/comment/45020169
has comment: http://stackoverflow.com/comment/45020643
tagged with: javascript
has comment: http://stackoverflow.com/comment/45020319
has title: How to create this profile page using lists and ajax?
score: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/45020486
tagged with: php
has comment: http://stackoverflow.com/comment/45021181
has body: I'm creating a profile page. I'm using lists for the sidebar and ajax to display the content on the right side of the sidebar. I tried the following code but its not working. My Page My Updates My News My Ads The fullprofile.php contains some sample text. so if i click on 'My page' the 'pcontent' section should display the sample text in fullprofile.php.
answer count: 0

http://stackoverflow.com/comment/45052095
comment on: http://stackoverflow.com/q/28287816
score: 0
type: Comment
type: QuestionComment
has text: What do you mean by "delays in certain elements"? What are you trying to do with AngularJS' `ng-animate` that `Animate.css` isn't doing?

http://stackoverflow.com/q/28280223
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44924589
favorite count: 0
has comment: http://stackoverflow.com/comment/44944769
has title: new directive leads to ng-change firing twice
tagged with: angularjs
type: UnansweredQuestion
has body: I'm quite new to angular and have the problem, that i want to use a variable for defining the ng-model. This works now, but now i have the problem that the ng-change event fires twice, when using this directive. I set the priority of the dynamic-model directive to -1, as the ng-change depends on the model of course... ... app.controller('testcontroller', function($scope, $http) { $scope.model = "dynamicmodel"; }) app.directive('dynamicModel',function($compile){ directive = { priority : -1, link:function(scope,element,attr){ element[0].removeAttribute('dynamic-model'); element[0].setAttribute('ng-model',scope.$eval(attr.dynamicModel)); $compile(element[0])(scope); } } return directive; }); And the html &lt;p&gt;item.key &lt;input type="text" dynamic-model="model" ng-change="update()" ng-model-options="{updateOn:'default blur', debounce:{default:1000, blur:0}}"&gt;&lt;/p&gt; See this fiddle http://jsfiddle.net/r9t2mjy4/ What can I do? Thanks a lot
upvote count: 1
type: Question
tagged with: angularjs-directive
has answer: http://stackoverflow.com/a/28280573
tagged with: javascript
answer count: 1

http://stackoverflow.com/a/28409821
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45153731
has body: Month in javascript datetime starts from 0. http://javascript.info/tutorial/datetime-functions
score: 3
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28409765
answers question: http://stackoverflow.com/q/28409765

http://stackoverflow.com/a/28408735
answers question: http://stackoverflow.com/q/28408532
score: 0
type: Answer
has body: This is an answer to your question "get value of string before and after / in javascript". Like I stated in the comments you can split a string into an array of substrings using a delimiter. jsfiddle var str= "this is a value/100"; var temp=str.split("/"); var xyz = temp[0]; //-&gt;this is a value var rfv = temp[1]; //-&gt;100 alert('xyz = '+xyz+'\nrfv = '+rfv);

http://stackoverflow.com/comment/45034031
comment on: http://stackoverflow.com/q/28344494
score: 0
has text: @T.J.Crowder I didn't get that. You mean that with IE the field still can be focused?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28414883
score: 3
type: Question
has comment: http://stackoverflow.com/comment/47473451
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47462277
has body: I'm trying to use pre-roll ads on youtube videos on the website I'm working on using the latest (4.11.4) version of video.js. Youtube vidoes are played thanks to the videojs-youtube plugin I found on github https://github.com/eXon/videojs-youtube , while for the ADs part I'm using this videojs-vast-plugin https://github.com/theonion/videojs-vast-plugin that reads a VAST 2.0 formatted xml I serve from the one provided by Revive Ad-Server (v. 3.0) and plays and mp4 video. This is the code I wrote: //= require video.dev //= require youtube //= require vast-client //= require video.ads //= require videojs.vast &lt;video id="video" class="video-js vjs-default-skin" controls preload="auto" width="610" height="343"&gt; &lt;/video&gt; &lt;script&gt; $(function(){ videojs('video', {plugins: { ads: {}, vast: { url: '{{url("ad-url")}}', skip: 2 } }, src: "http://www.youtube.com/watch?v={{youtubeCode}}", techOrder: ["youtube", 'html5', 'flash'] }) }); &lt;/script&gt; This code works partially: I can succesfully show the YouTube video's poster image, play the custom video AD (with the "Skip in 2 seconds" alert, as per config), skip the video if I want, but everytime the AD ends (or it's skipped) I get this errors: Uncaught TypeError: Cannot read property 'vdata1423499421192' of null Uncaught TypeError: Cannot read property 'handleSource' of null By doing some research I think the problem might be the second player not being "re-inizialized" after the AD stops, but I can't figure out where to act in order to prevent this. I found some answers where they suggested to add a timeout before firing the dispose() method, but it's scattered all over the plugins and I can't understand which one is actually acting. When I change the order of the elements in "techOrder", specifically when I switch place for flash and html5 the "vdata1423499421192" error disappears, but still the video won't play. Moreover, if I play two regular mp4 videos (mp4 video with mp4 ads) the combination video.js +…
has comment: http://stackoverflow.com/comment/47455352
tagged with: video.js
answer count: 0
upvote count: 3
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46798212
tagged with: youtube
tagged with: vast
has title: Pre-roll on YouTube video using video.js

http://stackoverflow.com/q/28282512
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28285716
has title: Extjs SlideOut panel
score: 0
answer count: 1
tagged with: javascript
tagged with: extjs
has comment: http://stackoverflow.com/comment/44924964
has body: I am trying to slide out a panel and then hide it using extjs. The slideout is working fine but as soon as I add the hide function it stops working. How do I fix this. My function is as below. toggleSidebar : function () { var sidebar = this.getSidebar(); if(sidebar.hidden){ sidebar['show'](); }else{ sidebar.el.slideOut('l', { easing: 'easeOut', duration: 200, scope: this, callback: this.onSidebarAnim() }); sidebar['hide'](); // Slide works if I remove this line. } },
has answer: http://stackoverflow.com/a/28285716
type: Question

http://stackoverflow.com/q/28338729
type: AnsweredQuestion
upvote count: 3
has body: I am trying to create a jquery ui range slider a link!. I am using it as a filter on a listing site which show results based on the filters applied. What I want is whenever the user changes the slider, the form must get submitted. I have successfully implemented this. The form action is the same page itself. The values are passed through the url although whenever the page loads again the slider is reset to the initial values. I want the slider to retain the submitted values. Here's my entire code: <?php $mincost=$_GET['mincost']; $maxcost=$_GET['maxcost']; ..... ?> <input type="text" id="price1" name="mincost" id="mincost" style="background-color:#fff; border:0; color:#b81010; font-weight:bold; width: 70px;" value="<?php echo $_GET['mincost'];?>" > <input type="text" id="price2" name="maxcost" style="background- color:white ; border:0; color:'#b81010'; left: 400px; font-weight:bold; width: 70px;" value="<?php echo $_GET['maxcost'];?>" > Here I want the mincost and maxcost value after the form is submitted to appear on the slider as well. Please help out. Much appreciated.
type: Question
tagged with: jquery-ui-slider
has answer: http://stackoverflow.com/a/28339152
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28339152
score: 3
downvote count: 0
answer count: 1
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: range
has title: jQuery ui range slider set values after submit on new page
tagged with: php

http://stackoverflow.com/comment/45107184
comment on: http://stackoverflow.com/a/28352952
type: AnswerComment
score: 0
has text: Thanks for the response. I tried your suggestion (adding createDataChannel to the guest as well, during initialisation) but I still get the exact same error. Here's my updated pastebin, I made your suggested change in the constructor function for the Guest object. http://pastebin.com/WbR50YZm
type: Comment

http://stackoverflow.com/a/28427407
type: Answer
score: 2
answers question: http://stackoverflow.com/q/28417359
has body: Well, this is going to a be a bummer. You can't While a lot of promise libraries let you do this and will report unhandled rejections for you - in Q you have no methods to automatically detect these failures. You have to Use .done or change a promise library. Heck, even native promises are going to be able to do this in a few days. Q specific solution: In Q your only realistic option is to use .done, unlike then done is not throw safe and you can throw exceptions from there and they won't be suppressed - this requires you to remember to always terminate chains with done but it works: myObj.loadDataSet(handleSuccess, handleError).done(); // will throw on rejection Personally until Q fixes this and other issues I cannot recommend using it to anyone. Modern libraries and native promises I've written a specification based on work by Domenic and Petka for promise libraries to be able to report errors globally and hook to them. Several libraries already implement this including bluebird and when. Domenic is working on a parallel specification for web browsers. Currently supported or are going to be supported in the next few weeks are: bluebird, when, es6-promise, rsvp and native promises in io. // log any unhandled promise rejections process.on('unhandledRejection', function(reason, p){ console.log("Possibly Unhandled Rejection at: Promise ", p, " reason: ", reason); // application specific logging here }); As for browsers, something like: window.addEventListener("unhandledrejection", function(e) { var reason = e.detail.reason; var promise = e.detail.promise; console.log("Unhandled rejection", promise, reason); }); This protocol is less supported but there are plans to include it in native promises. Currently Firefox native promises will report unhandled rejections and Chrome's will attempt too - but there are no browser hooks for it yet (it's coming though). Note that teams are working on very interesting tooling. After a discussion with Paul Irish I'm convinced great th…
has comment: http://stackoverflow.com/comment/45195807
has comment: http://stackoverflow.com/comment/45196757
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28417359
upvote count: 2

http://stackoverflow.com/comment/45186841
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28314184
has text: I've use the second option as it is easier. I just needed to add `DISCARD TEMP;` since I do this multiple times (multiple sources). I also used a npm module to escape text properly. Now, everything work perfectly and I've learn a lot about PostgreSQL. Thank you again for your help !
type: AnswerComment

http://stackoverflow.com/q/28309251
tagged with: wordpress
upvote count: 1
type: Question
has title: WordPress Theme now uses require.js and enqueue script no longer works
tagged with: javascript
tagged with: jquery
downvote count: 0
tagged with: wordpress-theming
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44969933
answer count: 0
has body: I created a small custom script that fixes a sidebar at different point depending on if there is a banner. I used enqueue script in my child functions file and then a custom.js file with my javascript. See below: function.php (In Child Theme Folder) function custom_scripts() { wp_register_script( 'custom-script', get_stylesheet_directory_uri() . '/custom.js', array() , false, true ); wp_enqueue_script( 'custom-script' ); } add_action( 'wp_enqueue_scripts', 'custom_scripts', 99 ); custom.js (In Child Theme Folder) $(function() { var div = $(".sidebar-wrapper"); $(window).scroll(function() { var scroll = $(window).scrollTop(); if ($(".sidebar-wrapper").closest(".mk-main-wrapper").length &amp;&amp; scroll &gt; 147) { div.addClass("fixed-product-nav"); } else if (scroll &gt; 263) { div.addClass("fixed-product-nav"); } else { div.removeClass("fixed-product-nav"); } }); }); Like I said, this worked perfectly, but now my WP theme (Jupiter), has done an update that now uses require.js and they have told me WordPress enqueue script will no longer work. Is that true or do I just need to use a different way to load the script? Since this is custom work, the theme support will not help. When I look at the page source code, I can see that the custom.js is loaded on the page so that made me think something was wrong with the script, but it used to work perfectly and the HTML structure of the page has not changed. So I guess the real question is how do I get my custom.js to load and work like it did, but with require.js? The site is in development mode so I'm sorry but I cannot share a public link. Any help is greatly appreciated.
score: 1

http://stackoverflow.com/comment/45195933
type: AnswerComment
score: 0
type: Comment
has text: Thanks but can u explain me why did not it work with the include php code? Content of included file is this: http://pastebin.com/KKpA1jqd
comment on: http://stackoverflow.com/a/28430095

http://stackoverflow.com/a/28358995
accepted answer of: http://stackoverflow.com/q/28296118
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28296118
downvote count: 0
has body: Removing "pointWidth" solved the white space between the bars. But i need the bars should be off same height in all possible cases. I have solved the problem by setting height dynamically based on the categories count. say for example if am having only one category i have set the height for the chart as "210" and for 2 categories "270" like that. and removed pointWidth. $('#container-one').highcharts({ chart: { type: 'bar', height: 210, ... . . plotOptions: { bar: { pointPadding: 0, borderWidth: 0 }, series: { //pointWidth: 20, stacking: 'normal', . . }); When i have two categories i have set chart height as 270 $('#container-two').highcharts({ chart: { type: 'bar', height: 270, ... . . plotOptions: { bar: { pointPadding: 0, borderWidth: 0 }, series: { //pointWidth: 20, stacking: 'normal', . . }); and the Fiddle Link may be what i did was wrong. But its fixed my problem. correct me if am wrong. Thanks all
type: Answer
score: 3
has comment: http://stackoverflow.com/comment/106989517
upvote count: 3
has comment: http://stackoverflow.com/comment/109177157
has comment: http://stackoverflow.com/comment/102900624

http://stackoverflow.com/q/28410743
type: UnansweredQuestion
tagged with: ng-view
score: 2
has answer: http://stackoverflow.com/a/28411804
upvote count: 2
type: Question
has answer: http://stackoverflow.com/a/28420648
has title: angularJS load non-angular javascript file within ng-view
has body: I use ng-route with ng-view for my client canvas drawing app. The drawing code is in a separated non-angular js file. I need to put and in the target ng-view. The problem is, I can't add the scripts in the ng-view html file. (I dont see it on the browser debug window) I have tried putting scripts in the parent html file (which contains the ng-view), and keep #container and #json in the ng-view (which i have to, because only this page needs these 2 elements), it has an error saying parentNode is not found, because at that time, ng-view (#container and #json) has not been loaded, while the scripts have been loaded Edit: I tried this on the subpage html: this is text but it's not working
tagged with: javascript
answer count: 2
downvote count: 0
favorite count: 0
tagged with: angularjs

object
tags question: http://stackoverflow.com/q/28339130
tag name: object
tags question: http://stackoverflow.com/q/28357785
tags question: http://stackoverflow.com/q/28292125
tags question: http://stackoverflow.com/q/28342272
tags question: http://stackoverflow.com/q/28388650
tags question: http://stackoverflow.com/q/28367776
tags question: http://stackoverflow.com/q/28341509
tags question: http://stackoverflow.com/q/28346334
tags question: http://stackoverflow.com/q/28321778
tags question: http://stackoverflow.com/q/28282135
tags question: http://stackoverflow.com/q/28415206
tags question: http://stackoverflow.com/q/28384490
tags question: http://stackoverflow.com/q/28401255
tags question: http://stackoverflow.com/q/28417576
tags question: http://stackoverflow.com/q/28326034
tags question: http://stackoverflow.com/q/28320790
tags question: http://stackoverflow.com/q/28300968
tags question: http://stackoverflow.com/q/28387908
tags question: http://stackoverflow.com/q/28371320
tags question: http://stackoverflow.com/q/28288183
tags question: http://stackoverflow.com/q/28352767
tags question: http://stackoverflow.com/q/28436271
tags question: http://stackoverflow.com/q/28412175
tags question: http://stackoverflow.com/q/28332967
tags question: http://stackoverflow.com/q/28391026
tags question: http://stackoverflow.com/q/28323692
tags question: http://stackoverflow.com/q/28421740
tags question: http://stackoverflow.com/q/28408956
tags question: http://stackoverflow.com/q/28392840
tags question: http://stackoverflow.com/q/28312874
tags question: http://stackoverflow.com/q/28386494
tags question: http://stackoverflow.com/q/28419920
type: Tag
tags question: http://stackoverflow.com/q/28420760
tags question: http://stackoverflow.com/q/28384668
tags question: http://stackoverflow.com/q/28343487

http://stackoverflow.com/q/28388917
tagged with: php
has answer: http://stackoverflow.com/a/28393335
tagged with: pagination
has title: Confused about where I should start with pagination {$.getJSON, php image array}
type: Question
answer count: 1
tagged with: javascript
tagged with: ajax
score: 0
has body: Here's how my code is setup now: user visits a certain link on the page $.getJSON sends a request to a php script php calls scandir() to create an array for the names of images (100s-1000s eventually but only a few now for testing, hence the need to add pagination) echos a json_encoded array $.each item is used to create a string variable that is a new tag prepend string variable to a div container that is a inline display of images Here's what I'm trying to do: have 50 items loaded with ajax at a time figure out how use $.each so that it works with the 50 item requirement figure out a different way to use $.getJSON so that not all xxxx number of images are requested at once My questions: how can I make a request that's made only one time at the top of a javascript event stay active throughout the duration of a user clicking through these pages? Php creating the array from scandir doesn't seem like it's a problem...maybe returning the whole array at once is a problem, but I can't figure how to create a loop that waits for user requests (clicking 'next' or 'prev') to iterate to the next 50 images in the array. I imagine the best place to work on would be before or inside of $.each, somehow using a loop to wait for a following ajax request to create the next 50 tags and prepend them to the . Here's the code: requestServer('ajax.php', flag); $('#Container').fadeIn('slow'); $('.close_button').click(function() { $('#Container').fadeOut('slow'); $('#welcome').fadeTo('slow',1); $('#i1,#i3,#i5').click(clickFade).mouseover(mouseOverFunc); $('#welcome').css({'position':'absolute','z-index':'10'}); }); flag = false; break; function requestServer(file, run_flag) { if (run_flag === true) { $.getJSON(file, function(data) { $.each(data, function(key, val) { var html = "&lt;img src='../images/"+val+"' style='display:inline' alt=null /&gt;"; $('#Container').prepend(html); }); }); } } &lt;?php $images = scandir('../includes/scrapedImages/'); foreach ($images as $key =&gt; $image) { i…
type: UnansweredQuestion

http://stackoverflow.com/a/33181842
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28367957
has body: Use: Combo Chart Use data point for the line chart as one of the columns in the DataTable and specify in options this column to be the "series"-"type"-"line" and other columns are visualized in a ColumnChart. OR Stepped Area Chart

http://stackoverflow.com/q/28424466
type: Question
has answer: http://stackoverflow.com/a/28425163
has answer: http://stackoverflow.com/a/28424825
has comment: http://stackoverflow.com/comment/45181794
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/45205460
has body: I'm having a little bit of trouble writing a two-textbox-event and would like some help... I have the following: Apple Blueberry Cherry = Apple Blueberry Cherry I have two text boxes. The left text box ('begin') will accept the weight of 'chosen item'. But the right box ('done') should change the number value depending on what the user chooses form the drop-down text list. When the value is entered in the left box, the right box updates correctly, while changing items in drop down list. However, I would like it to work both ways. For example: Left 23 [Apple] = Right 23 [Apple] Left 23 [Apple] = Right 46 [Blueberry] (if I change to blueberry on right list) Left 46 [Blueberry] = Right 46 [Blueberry] (if I keep the right, and just change lft list) Simply put, I would like both text boxes to update to the correct value with respect to the chosen fruit/ equivalence on the opposite box. thank you
answer count: 2
downvote count: 1
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has title: Two Text Box Events Javascript
upvote count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/28335282
has comment: http://stackoverflow.com/comment/45163375
type: Question
has title: Full window HTML5 Canvas "white noise" animation lags on Android Firefox
tagged with: requestanimationframe
tagged with: firefox
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: html5-canvas
answer count: 0
type: UnansweredQuestion
has body: I've made a white noise animation in javascript/HTML5 canvas to cover the whole browser window. I'm using an offscreen square canvas equal to half the browser window size for the source image: var doc = document; h = Math.max( doc.body.scrollHeight, doc.documentElement.scrollHeight, doc.body.offsetHeight, doc.documentElement.offsetHeight, doc.body.clientHeight, doc.documentElement.clientHeight ); w = Math.max( doc.body.scrollWidth, doc.documentElement.scrollWidth, doc.body.offsetWidth, doc.documentElement.offsetWidth, doc.body.clientWidth, doc.documentElement.clientWidth ); blocksize = Math.floor(h / 2); tilesize = Math.floor(blocksize / 8); tiles_w = Math.floor(w / tilesize); tiles_h = Math.floor(h / tilesize); var colors = [ [255, 255, 255, 255], [220, 220, 220, 255], [170, 170, 170, 255], [120, 120, 120, 255], [0, 0, 0, 255] ]; offBlockCanvas = document.createElement("canvas"); offBlockContext = offBlockCanvas.getContext("2d"); offBlockCanvas.width = blocksize; offBlockCanvas.height = blocksize; var imageData = offBlockContext.getImageData(0, 0, blocksize, blocksize); var imagedata = imageData.data; for (i = 0; i &lt; blocksize * blocksize * 4; i+=4) { var pixelcolor = parseInt(Math.random() * 8) if (pixelcolor &gt; 3) { pixelcolor = 4; } imagedata[i] = colors[pixelcolor][0]; imagedata[i + 1] = colors[pixelcolor][1]; imagedata[i + 2] = colors[pixelcolor][2]; imagedata[i + 3] = colors[pixelcolor][3]; } offBlockContext.putImageData(imageData, 0, 0); Then randomly clip tiles of 1/8 of the offscreen square canvas to blit directly to the onscreen canvas. The result looks nice; not tiled at all. function snowloop() { requestAnimationFrame(snowloop); for (i = 0; i &lt;= tiles_h; i++) { for (j = 0; j &lt;= tiles_w; j++) { var next_x = Math.floor(Math.random() * (blocksize - tilesize)) var next_y = Math.floor(Math.random() * (blocksize - tilesize)) context.drawImage(offBlockCanvas, next_x, next_y, tilesize, tilesize, j * tilesize, i * tilesize, tilesize, tilesize); } } } …
upvote count: 1
tagged with: performance
score: 1

http://stackoverflow.com/q/28379540
has title: What is missing from my coding to for both google sheets?
answer count: 2
possible better answer: http://stackoverflow.com/a/28382818
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/28386277
upvote count: 1
type: AnsweredQuestion
has body: I have a google spreadsheet with two sheets on it. I am getting notifications for all of my functions except function notifyIT(). I feel like I need to address the tabs. The tabs on the spreadsheet are called 'Termed' and 'New Hires'. The only email that I am not getting is for the function notifyIT() which is for our termed people. The email that I used to receive read "Terminated "location" Employee "Employee Name"
score: 1
type: Question
tagged with: google-apps-script
has answer: http://stackoverflow.com/a/28386277
tagged with: javascript
has answer: http://stackoverflow.com/a/28382818

http://stackoverflow.com/a/28353323
score: 0
upvote count: 1
type: AcceptedAnswer
downvote count: 1
answers question: http://stackoverflow.com/q/28352882
type: Answer
accepted answer of: http://stackoverflow.com/q/28352882
has body: I think you have only a typo in the line var decrypted = decrypted.toString(CryptoJS.enc.Utf8); it should be var decrypted = decrypt.toString(CryptoJS.enc.Utf8). After this you are getting a decoderesult and decrypted. But decrypt.iv still returns undefined. Not sure what's wrong here. For a demo see below and here at jsFiddle. var log = function(text) { output.innerHTML += '&lt;p&gt;' + text + '&lt;/p&gt;\n'; } var JsonFormatter = { stringify: function (cipherParams) { // create json object with ciphertext var jsonObj = { ct: cipherParams.ciphertext.toString(CryptoJS.enc.Base64) }; // optionally add iv and salt if (cipherParams.iv) { jsonObj.iv = cipherParams.iv.toString(); } if (cipherParams.salt) { jsonObj.s = cipherParams.salt.toString(); } // stringify json object return JSON.stringify(jsonObj); }, parse: function (jsonStr) { // parse json string var jsonObj = JSON.parse(jsonStr); // extract ciphertext from json object, and create cipher params object var cipherParams = CryptoJS.lib.CipherParams.create({ ciphertext: CryptoJS.enc.Base64.parse(jsonObj.ct) }); // optionally extract iv and salt if (jsonObj.iv) { cipherParams.iv = CryptoJS.enc.Hex.parse(jsonObj.iv) } if (jsonObj.s) { cipherParams.salt = CryptoJS.enc.Hex.parse(jsonObj.s) } return cipherParams; } }; var AES = CryptoJS.AES; var key = "B374A26A71490437AA024E4FADD5B497FDFF1A8EA6FF12F6FB65AF2720B59CCF"; var iv = CryptoJS.enc.Hex.parse('7E892875A52C59A3B588306B13C31FBD'); var aeskey = CryptoJS.enc.Hex.parse(key); var secret = "50585"; //alert("attempt 1"); var e1 = AES.encrypt(secret, aeskey, { iv: iv , format: JsonFormatter }); var encJSON = JSON.parse(e1); var encresult = encJSON['ct']; var encres = encodeURIComponent(encresult); console.log('encres', encresult); console.log('e1.iv=', e1.iv); console.log('encoded=', encres); log('encres= ' + encresult); log('e1.iv=' + e1.iv); log('encoded=' + encres); //alert("encrypted = " + encresult); //alert("e1.iv = " + e1.iv); //alert("encoded = " + encres); //aler…
has comment: http://stackoverflow.com/comment/45050529

http://stackoverflow.com/comment/45133906
has text: Take a look http://stackoverflow.com/a/3432718/1181310
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28398710

http://stackoverflow.com/comment/45226194
has text: That's strange - in my example `scrollBar: { visible: true }, scrollingMode: "all", zoomingMode: "all",` is enough for scroll bar to appear. As for `onSelectedRangeChanged` - are domains of the range selector and the chart consistent? i.e. are e.startValue and e.endValue within range of argument axis of the chart?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28428383

asp.net
tags question: http://stackoverflow.com/q/28302337
tags question: http://stackoverflow.com/q/28338443
tags question: http://stackoverflow.com/q/28408520
tags question: http://stackoverflow.com/q/28427967
tags question: http://stackoverflow.com/q/28351686
tags question: http://stackoverflow.com/q/28311751
tags question: http://stackoverflow.com/q/28401444
tags question: http://stackoverflow.com/q/28301994
tags question: http://stackoverflow.com/q/28337546
tags question: http://stackoverflow.com/q/28412564
tags question: http://stackoverflow.com/q/28336846
tags question: http://stackoverflow.com/q/28282242
tags question: http://stackoverflow.com/q/28351074
tags question: http://stackoverflow.com/q/28416077
tags question: http://stackoverflow.com/q/28359810
tags question: http://stackoverflow.com/q/28392439
tags question: http://stackoverflow.com/q/28299904
tags question: http://stackoverflow.com/q/28421575
tags question: http://stackoverflow.com/q/28301747
tags question: http://stackoverflow.com/q/28295918
tags question: http://stackoverflow.com/q/28433401
tags question: http://stackoverflow.com/q/28328214
tags question: http://stackoverflow.com/q/28407626
tags question: http://stackoverflow.com/q/28282817
tags question: http://stackoverflow.com/q/28336358
tags question: http://stackoverflow.com/q/28424230
tags question: http://stackoverflow.com/q/28403698
tags question: http://stackoverflow.com/q/28323799
tags question: http://stackoverflow.com/q/28302751
tags question: http://stackoverflow.com/q/28369116
tags question: http://stackoverflow.com/q/28290985
tags question: http://stackoverflow.com/q/28384599
tags question: http://stackoverflow.com/q/28436669
tags question: http://stackoverflow.com/q/28362392
tags question: http://stackoverflow.com/q/28319694
tags question: http://stackoverflow.com/q/28339726
tags question: http://stackoverflow.com/q/28369700
tags question: http://stackoverflow.com/q/28361010
tags question: http://stackoverflow.com/q/28350165
tags question: http://stackoverflow.com/q/28365661
tags question: http://stackoverflow.com/q/28280769
tags question: http://stackoverflow.com/q/28290864
tags question: http://stackoverflow.com/q/28341895
tags question: http://stackoverflow.com/q/28305306
tags question: http://stackoverflow.com/q/28373694
tags question: http://stackoverflow.com/q/28419116
tags question: http://stackoverflow.com/q/28435078
tags question: http://stackoverflow.com/q/28317314
tags question: http://stackoverflow.com/q/28331212
tags question: http://stackoverflow.com/q/28363387
tags question: http://stackoverflow.com/q/28337778
tags question: http://stackoverflow.com/q/28333919
tags question: http://stackoverflow.com/q/28345808
tags question: http://stackoverflow.com/q/28339919
type: Tag
tags question: http://stackoverflow.com/q/28369936
tags question: http://stackoverflow.com/q/28281991
tags question: http://stackoverflow.com/q/28299865
tags question: http://stackoverflow.com/q/28370764
tags question: http://stackoverflow.com/q/28292367
tags question: http://stackoverflow.com/q/28282043
tags question: http://stackoverflow.com/q/28353170
tags question: http://stackoverflow.com/q/28333705
tags question: http://stackoverflow.com/q/28424390
tags question: http://stackoverflow.com/q/28319344
tags question: http://stackoverflow.com/q/28415757
tags question: http://stackoverflow.com/q/28372804
tags question: http://stackoverflow.com/q/28347123
tags question: http://stackoverflow.com/q/28284486
tags question: http://stackoverflow.com/q/28286525
tags question: http://stackoverflow.com/q/28295666
tags question: http://stackoverflow.com/q/28343669
tags question: http://stackoverflow.com/q/28285052
tags question: http://stackoverflow.com/q/28349155
tags question: http://stackoverflow.com/q/28381069
tags question: http://stackoverflow.com/q/28376372
tags question: http://stackoverflow.com/q/28364501
tags question: http://stackoverflow.com/q/28405913
tags question: http://stackoverflow.com/q/28420117
tags question: http://stackoverflow.com/q/28316521

http://stackoverflow.com/q/28357504
has title: Angular-UI-Router stops working when a namespace is declared before id parameters
answer count: 1
has answer: http://stackoverflow.com/a/28359683
tagged with: angular-ui
tagged with: angular-ui-router-extras
has body: I am making a simple blog section in my website so i want to have a namespace called posts, that dynamically links to a post template. These posts will each have their own template( i.e. posts/some_post.html ) as they are too different to just use json data to populate a generic template. I want to have a namespace that allows me to create links to each post so that in production I can post: mysite/posts/my_new_post. However, prepending the posts in the .state url leads to a failure to instantiate module error. This is a snippet of the working code: .config(["$urlRouterProvider", "$stateProvider","$locationProvider", function ($urlRouterProvider, $stateProvider,$locationProvider){ $urlRouterProvider.otherwise('/'); $locationProvider.html5Mode(true); $stateProvider .state('posts', { url: '/:postID', templateUrl : function($stateParams){ return 'templates/posts/' + $stateParams.postID + '.html'; }, }); }]); This code works and i can link to the URIs that get generated. When this link is clicked: li>blog 2 The URI become website/blog2, and from website/home, i can link to the URI HOWEVER, if I try to add a namespace I get a failure: .state('posts', { url: '/posts/:postID', // note i added posts before the id templateUrl : function($stateParams){ return 'templates/posts/' + $stateParams.postID + '.html'; }, The link will work the first time, and take me to the correct page however, if i type the URI pattern mysite/posts/blog1 i get the: Uncaught Error: [$injector:modulerr] error, and this weird:Uncaught SyntaxError: Unexpected token < Somehow it isn't loading angular, anyone have nay ideas?
has comment: http://stackoverflow.com/comment/45058429
tagged with: angularjs
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/25999262
type: Question
tagged with: angular-ui-router
tagged with: javascript
score: 0
linked to: http://stackoverflow.com/q/28351981

http://stackoverflow.com/comment/45036997
comment on: http://stackoverflow.com/q/28345808
type: Comment
type: QuestionComment
has text: Send a message progress from controller
score: 0

http://stackoverflow.com/q/28392023
score: 0
has title: Understanding custom JQuery event and how to modify it sligthly
has answer: http://stackoverflow.com/a/28392371
type: AnsweredQuestion
type: Question
has body: I wanted and event emitter on an input that had a slightly delay (cooldown) when entering input, say 1 second, so typing a word would trigger it multiple times, but only 1 second after the last key stroke I found this code $.fn.changeOrDelayedKey = function(fn, iKeyDelay, sKeyEvent) { var iTimeoutId, oEventData; // second signature used, update the variables if (!$.isFunction(fn)) { oEventData = arguments[0]; fn = arguments[1]; iKeyDelay = arguments[2]; sKeyEvent = arguments[3]; } if (!iKeyDelay || 0 &gt; iKeyDelay) { iKeyDelay = 500; } if (!sKeyEvent || !this[sKeyEvent]) { sKeyEvent = 'keydown'; } // non-delayed event callback, should clear any timeouts, then // call the original callback function function fnExecCallback() { clearTimeout(iTimeoutId); fn.apply(this, arguments); } // delayed event callback, should call the non-delayed callback // after a short interval function fnDelayCallback() { var that = this, args = arguments; clearTimeout(iTimeoutId); iTimeoutId = setTimeout(function() { fnExecCallback.apply(that, args); }, iKeyDelay); } if (oEventData) { this.change(oEventData, fnExecCallback); this[sKeyEvent](oEventData, fnDelayCallback); } else { this.change(fnExecCallback); this[sKeyEvent](fnDelayCallback); } return this; }; Which kind of does this, but it also triggers on change, which means that if i write something without moving moving the focus after say, 5 seconds, then when i finally, the event fires again, which it shouldnt. So I only want the event to happen on the keyup event. If anyone could explain how the method work, and how I could modify it to fit my usecase it would be much appreciated
accepted answer: http://stackoverflow.com/a/28392371
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/28367349
score: 1
upvote count: 2
has body: $http({ url:'http://myurl.com' method:'POST', data:{ 'json':productAttributes } }); ORRR if you really need to pass the data from the url stringify your json and decode it on server side $http.post('http://myurl.com?json=' + JSON.stringify(myJson));
type: AcceptedAnswer
downvote count: 1
answers question: http://stackoverflow.com/q/28367314
type: Answer
accepted answer of: http://stackoverflow.com/q/28367314
has comment: http://stackoverflow.com/comment/45076660
has comment: http://stackoverflow.com/comment/45077105

http://stackoverflow.com/comment/45019365
comment on: http://stackoverflow.com/q/28318413
type: Comment
has text: Try to do the logic in a function and return the respective indicator value. [Something like this](http://jsfiddle.net/va893opr/1/).
score: 1
type: QuestionComment

http://stackoverflow.com/comment/45001087
type: Comment
type: QuestionComment
has text: Protip: do NOT use `href="..."` if you *do not intend* for the user to go there. Because at the very least webcrawlers will incorrectly index your content (and crawler errors are bad for SEO), and at worst your code won't work and your users end up in weird places (as is happening here).
score: 1
comment on: http://stackoverflow.com/q/28326751

http://stackoverflow.com/comment/44930623
score: 0
has text: `var lines = <?php echo $_SESSION['lines']; ?>;` And then you send that in Ajax? Wait a minute, why would you send something that's already on the server (i.e. in the session) over Ajax? Its already on the server...so its a total waste of bandwidth to send it back to the server, isn't it? (Those are rhetorical questions.)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28288306

http://stackoverflow.com/comment/44923938
comment on: http://stackoverflow.com/q/28284985
has text: Well where is the variable `filename` declared?
type: Comment
score: 1
type: QuestionComment

http://stackoverflow.com/q/28426290
has answer: http://stackoverflow.com/a/28426446
answer count: 5
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: Loop on each h2 tag inside a div
has answer: http://stackoverflow.com/a/28426310
has answer: http://stackoverflow.com/a/28427707
type: Question
has answer: http://stackoverflow.com/a/28426479
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28426430
has body: I have a structure like this: Heading 1 Content Heading 2 Content How do I loop on each of the h2 tags inside that div? The best I could do was to find only one of the h2 tags: $('.document-content').find('h2').html() I need to find all so I can do stuff like adding classes or IDs to each of them.
tagged with: jquery

http://stackoverflow.com/q/28321029
score: 0
accepted answer: http://stackoverflow.com/a/28321832
answer count: 1
has title: Bypassing the multi-dimensional arrays
has comment: http://stackoverflow.com/comment/44991240
tagged with: multidimensional-array
has comment: http://stackoverflow.com/comment/44991224
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28321832
tagged with: coffeescript
type: Question
has body: I need to get some data from complex array into array. For example I have this structure: animals = /*...*/ list: [ { type: "fluffy" withCategories: false animal: [ { name: "Patrik" description: "..." price: 135 weight: 220 rating: 94 } { name: "Mike" description: "..." price: 135 weight: 235 rating: 97 } ] } { imageUrl: "/img/borsh.jpg" type: "pets" withCategories: true categories: [ { name: "parrot" imageUrl: "/img/parrot.jpg" withCategories: false animal: [ { name: "Kesha" description: "..." price: 75 weight: 250 rating: 89 } ] } ] } As a result I need one array with elements of animal: //result = [object1 -> name: Patrik, price: 135 ..], ..., [object3 -> name: Kesha, description: ...] As you can see on the lower level we go down recursively if the parameter "withCategories" = true. I've tried to realize it: PlacesService.getAllAnimals = -&gt; merged = [] temp = (getAnimalByCategory(category) for category in animals.list) merged = merged.concat.apply(merged, temp) return merged getAnimalByCategory = (category) -&gt; if category.withCategories == false return category.animal else (getAnimalByCategory(an) for an in category.categories) But something wrong:( Could somebody help me please? I can't find any mistakes.
tagged with: javascript

http://stackoverflow.com/q/28314241
has title: Handle multiple response in javascript
answer count: 3
has answer: http://stackoverflow.com/a/28314806
linked to: http://stackoverflow.com/q/3880381
favorite count: 0
has body: Hi I am hitting 5 web services in parallel using angluarjs. Now when the response arrives, I am unable to identify the service to which it belongs. How can I know which response is which? The demo code is: var requestUrl=[url1,url2,url3,url4,url5]; for(var i=0;i&lt;requestUrl.length;i++){ $http.get(requestUrl[i]).success(response){ console.log(response); }; }
tagged with: angularjs
upvote count: 2
type: UnansweredQuestion
downvote count: 2
has answer: http://stackoverflow.com/a/28314383
score: 0
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/44978284
has answer: http://stackoverflow.com/a/28315241
tagged with: http
type: Question
has comment: http://stackoverflow.com/comment/44978399
tagged with: javascript
has comment: http://stackoverflow.com/comment/44978293

http://stackoverflow.com/q/28377325
tagged with: css
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28377846
has comment: http://stackoverflow.com/comment/45095004
has comment: http://stackoverflow.com/comment/45094802
type: Question
has body: Using Gulp I've got a pretty simple build process which compresses everything into styles.min.css gulp.task( 'styles', function() { gulp.src( './scss/*.scss' ) .pipe( sass( { errLogToConsole: true } ) ) .pipe( autoprefix( 'last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4' ) ) .pipe( cssmin() ) .pipe( rename( 'styles.min.css' ) ) .pipe( gulp.dest( '../dist' ) ); }); Can I modify this to append a timestamp to the file name, so my browser knows this is a new file and to clear its cache? Something like this: styles—1423267988.min.css
tagged with: javascript
score: 4
accepted answer: http://stackoverflow.com/a/28377846
upvote count: 4
has comment: http://stackoverflow.com/comment/45095704
has comment: http://stackoverflow.com/comment/45094965
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45095708
tagged with: gulp
favorite count: 0
has comment: http://stackoverflow.com/comment/45095753
has title: Using Gulp to add a timestamp to filename

http://stackoverflow.com/a/28301224
score: 2
answers question: http://stackoverflow.com/q/28299256
has body: Without you supplying any code, it's hard to say. Normally (per default) it doesn't pan to a new marker. Take this code for example: // HTML &lt;button onclick="setMarker()"&gt;Draw marker on Paris&lt;/button&gt; &lt;div id="map"&gt;&lt;/div&gt; // Default map var map = L.map('map', { 'center': [0, 0], 'zoom': 0, 'layers': [ L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { 'attribution': 'Map data &amp;copy; OpenStreetMap contributors' }) ] }); // Fit map to view London map.fitBounds([ [51.286839, -0.510350], [51.692322, 0.334030] ]); // Function to draw marker on Paris function setMarker () { L.marker([48.8567, 2.3508]).addTo(map); } It sets the map to fit London and when you click the button, it draws a marker on Paris but the map doesn't pan. If you're seeing panning behaviour on your map, it must be something else you're doing to your map. Here you can test it for yourself: Working example on Plunker: http://plnkr.co/edit/C2qblP?p=preview
has comment: http://stackoverflow.com/comment/82122933
upvote count: 2
has comment: http://stackoverflow.com/comment/131516511
type: Answer
downvote count: 0

http://stackoverflow.com/comment/45183425
comment on: http://stackoverflow.com/a/28425384
score: 0
type: AnswerComment
type: Comment
has text: @bob: I figure out that. ;)

http://stackoverflow.com/a/28383002
score: 5
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45105693
accepted answer of: http://stackoverflow.com/q/28382965
type: Answer
upvote count: 5
answers question: http://stackoverflow.com/q/28382965
has body: Try this code: $('tr').on('dblclick', function() { $('#addModal').modal('show'); }); Since modal is already initialized by data attibutes on the button (data-target="#addModal"), you just need to bind dblclick event and show modal with .modal('show') method. Demo: http://plnkr.co/edit/J0SuQdy00dcf9baE7xJu?p=preview

http://stackoverflow.com/q/28357693
answer count: 1
has comment: http://stackoverflow.com/comment/45058766
has body: I have this code in my index.html page Property Value(RM) And in my index.js controller file i have this function that should call the value of property $scope.paramsData = function() { params = { landType: $scope.loanfilter.land_type, property: '$scope.loanfilter.property_type, }; return param; }; But it doesnt seem to be working. How can i call this value from the view to controller in angularjs. Thanks
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28357873
has comment: http://stackoverflow.com/comment/45241199
tagged with: angularjs
type: Question
has title: Call input value in controller from view angularjs
score: 0
has comment: http://stackoverflow.com/comment/45182570
has comment: http://stackoverflow.com/comment/45058663

http://stackoverflow.com/q/28333440
answer count: 1
favorite count: 0
has body: So I have an ng-repeat that loops over data objects and displays it in a list directive. One of the objects in the list should use the abbreviated version when the length of the text element is equal to or exceeds the length of the container. So what I have is this: //this is the list directive &lt;shift-list selection="selection" shifts="shifts"&gt;&lt;/shift-list&gt; //this is the template of the list directive that adds site-base-name directive &lt;ion-item collection-repeat="shift in shifts"&gt; &lt;div class="item-text"&gt; &lt;site-base-name shift="shift"&gt;&lt;/site-base-name&gt; &lt;/div&gt; //and here is what my site-base-name directive looks like return { restrict: 'E', link: function(scope, element) { $timeout(function(){ scope.siteBaseWidth = element[0].offsetWidth; scope.parentWidth = element.parent()[0].offsetWidth; }); }, replace: true, scope: { shift: '=' }, template: ''+ '&lt;div class="sitebase"&gt;{{(siteBaseWidth + 20 &gt;= parentWidth) &amp;&amp; shift.sites_abbreviation || shift.sites_name }} : {{shift.bases_name}}&lt;/div&gt;' } } So what I'm doing is nesting the directive site-base-name inside the list directive and then finding the size of the element and its parent. Then I'm using the abbreviated version of the name (shift.sites_abbreviation) if the size exceeds my condition (siteBaseWidth + 20 &gt;= parentWidth). The problem with this is the behavior I'm getting is buggy and inconsistent. It also applies the changes after the DOM is loaded, so you can see the text change within the window. My question is what is the best way to find the width of the text element and parent element then apply a condition that decides what data to populate the binding with? Preferably a clean Angular solution.
tagged with: angularjs
type: UnansweredQuestion
tagged with: css
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/28333790
type: Question
tagged with: javascript
has title: Changing text based on width of nested directive Angular
upvote count: 1

http://stackoverflow.com/q/28426549
tagged with: asp.net-mvc
score: 1
has comment: http://stackoverflow.com/comment/45184973
has comment: http://stackoverflow.com/comment/45195468
tagged with: jquery-validate
has comment: http://stackoverflow.com/comment/45185810
type: Question
has comment: http://stackoverflow.com/comment/45186071
has answer: http://stackoverflow.com/a/28436134
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45185710
accepted answer: http://stackoverflow.com/a/28436134
has title: jQuery validate, element.value is undefined in errorplacement
upvote count: 1
has body: I´ve try to build a validate for my registerform. I´m using jQuery validate. When the textbox is empty I want the errormessage to show up as my placeholder. When the text is added but stills throws a error I want to use custom settings. My problem is when debug this code: .validate({ debug: true, errorPlacement: function (error, element) { if (element.value === "") { element.attr("placeholder", error.text()); } else { alert(element.value); } } }); I´m getting undefined on elment.value. According to Devtools element.value is the text in the textbox (changes when text is added in the textbox) but it´s also says it´s undefined when I watch the value as the red circle to the left. I´m using MVC helpers for the textbox form: @Html.TextBoxFor(m =&gt; m.SurName, new { @class = "form-control required", placeholder = "Förnamn", @type = "SurName" }) I´m I using wrong value or attr?
has comment: http://stackoverflow.com/comment/45186217
type: AnsweredQuestion

http://stackoverflow.com/comment/45119685
type: QuestionComment
comment on: http://stackoverflow.com/q/28391172
has text: Are you particulary referring to scrollTop = 0 after the setInterval function.? If so, it won't work. Because, the setInterval function repeats after the specified interval. But the scrollTop = 0 executes only once and that too before the first execution of the interval callback.
score: 0
type: Comment

http://stackoverflow.com/q/28347479
has title: Owl carousel and bootstrap tab on a page
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/35888450
has answer: http://stackoverflow.com/a/40318505
score: 17
downvote count: 1
has answer: http://stackoverflow.com/a/30364316
has comment: http://stackoverflow.com/comment/45040996
type: Question
possible better answer: http://stackoverflow.com/a/35888450
tagged with: owl-carousel
has comment: http://stackoverflow.com/comment/45040493
has comment: http://stackoverflow.com/comment/48875307
tagged with: javascript
answer count: 6
tagged with: jquery
upvote count: 18
has answer: http://stackoverflow.com/a/60360161
has comment: http://stackoverflow.com/comment/48787016
has answer: http://stackoverflow.com/a/55095793
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/30364316
favorite count: 0
has body: I am trying to build a page using both bootstrap and a Owl carousel, Owl carousel fit the purpose of the site rather that bootstraps version. So I got a tab structure where I want to put a carousel on each page, however all my attempts have failed. Here is my code Home Profile Messages Settings content content content content content content content content Here is my javascript $(document).ready(function () { $('#owl1').owlCarousel({ loop: true, margin: 10, responsiveClass: true, responsive: { 0: { items: 1, nav: true }, 600: { items: 1, nav: false }, 1000: { items: 1, nav: true, loop: false } } }); $('#owl2').owlCarousel({ loop: true, margin: 10, responsiveclass: true, responsive: { 0: { items: 1, nav: true }, 600: { items: 1, nav: false }, 1000: { items: 1, nav: true, loop: false } } }); $('#owl3').owlCarousel({ loop: true, margin: 10, responsiveclass: true, responsive: { 0: { items: 1, nav: true }, 600: { items: 1, nav: false }, 1000: { items: 1, nav: true, loop: false } } }); $('#owl4').owlCarousel({ loop: true, margin: 10, responsiveclass: true, responsive: { 0: { items: 1, nav: true }, 600: { items: 1, nav: false }, 1000: { items: 1, nav: true, loop: false } } }); //}); http://www.owlcarousel.owlgraphic.com/docs/api-events.html
has comment: http://stackoverflow.com/comment/48845940
has comment: http://stackoverflow.com/comment/48788324
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/48998723
has answer: http://stackoverflow.com/a/38987344

http://stackoverflow.com/comment/45379318
score: 0
type: Comment
type: QuestionComment
has text: @Megha you should update your question to reflect your comments.
comment on: http://stackoverflow.com/q/28364419

http://stackoverflow.com/comment/45156460
score: 0
comment on: http://stackoverflow.com/q/28411402
type: Comment
type: QuestionComment
has text: Why don't you simply install a Webserver if you intent to run it on a Webserver later? With something like Xampp it's just 2 or 3 clicks away.

http://stackoverflow.com/comment/44976886
type: AnswerComment
comment on: http://stackoverflow.com/a/28312945
type: Comment
has text: Kenny your example is perfect! It is exatcly the thing that I want but I have no idea how to adapt it with my audio streams..
score: 0

http://stackoverflow.com/comment/117036875
type: Comment
has text: Could you please help me, why without the strict mode, it logs window, but by using strict mode, it logs undefined? Which property of strict mode does this?
comment on: http://stackoverflow.com/a/39727623
type: AnswerComment
score: 0

http://stackoverflow.com/a/28335756
answers question: http://stackoverflow.com/q/28335618
type: Answer
has body: Modern browsers will correctly parse a string in the OP format (a version of ISO 8601) however older browsers like IE 8 and lower will not. It's much safer to manually parse the string: function parseISOutc(s) { var b = s.split(/\D/); return new Date(Date.UTC(b[0], b[1] - 1, b[2], b[3], b[4], b[5], (b[6] || 0))); } Now your function can be: function getMinutesBetweenDates(startDate) { return ((new Date() - parseISOutc(startDate)) / 6e4 | 0) + ' minutes ago'; } The index parameter was unused so I removed it.
score: 0

http://stackoverflow.com/q/28292392
has answer: http://stackoverflow.com/a/28404999
has comment: http://stackoverflow.com/comment/44938209
answer count: 1
has comment: http://stackoverflow.com/comment/45019388
tagged with: github
favorite count: 0
upvote count: 2
score: -2
tagged with: css
accepted answer: http://stackoverflow.com/a/28404999
has comment: http://stackoverflow.com/comment/44937797
type: AnsweredQuestion
tagged with: background
has comment: http://stackoverflow.com/comment/44937990
has title: How do you create boxes like github's explore section?
has body: Im looking for Java Script or Css to create random background but I don't know how! Explore page link
type: Question
downvote count: 4
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/44918767
comment on: http://stackoverflow.com/a/28282165
type: AnswerComment
type: Comment
has text: Hi @Oleg thanks for the answer. I think my question confused you. Let me clarify. I have a grid with initial height set to 'auto' but not more than 500px so i set max-height on .ui-jqgrid-bdiv. However i want to only see the vertical scrollbar but not in the last column of the grid but in the scrollbar offset column. I will update the question with clear info as much as i can. Thanks again
score: 0

http://stackoverflow.com/comment/45017927
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28335331
has text: Have you checked out the jsfiddle I posted? The event handler setup needs to take place within a $(document).ready(...) block, as well.

http://stackoverflow.com/comment/45145957
type: QuestionComment
has text: you can use any video converter to convert the video to mp4 format along with that you need to make that video as h264 format then only u could able see it in browser.
score: 0
comment on: http://stackoverflow.com/q/28404742
type: Comment

http://stackoverflow.com/comment/45140037
comment on: http://stackoverflow.com/q/28402418
type: Comment
type: QuestionComment
score: 3
has text: You should use a [filter](https://docs.angularjs.org/api/ng/filter/filter)

http://stackoverflow.com/a/29552971
answers question: http://stackoverflow.com/q/28280154
type: Answer
score: 0
type: AcceptedAnswer
has body: ngTagsInput only works with arrays of objects. It will automatically convert an array of strings into an array of objects for convenience. To convert an array of objects back into an array of strings, you can do the following: $scope.tagsString = $scope.tags.map(function(tag) { return tag.text; });
accepted answer of: http://stackoverflow.com/q/28280154

http://stackoverflow.com/a/28347333
upvote count: 5
answers question: http://stackoverflow.com/q/28347248
downvote count: 0
has body: There are several ways to do this 1) Reference window from outside var self = this; $.each.call(this, [1,2,3], function(){ console.log(self); // expecting to see the window object }); 2) Bind the function to a particular scope $.each.call(this, [1,2,3], function(){ console.log(this); // expecting to see the window object }.bind(this)); 3) Use ES6 arrow function which binds to current context (Can't use in most browsers without some 6->5 conversion) $.each.call(this, [1,2,3], () =&gt; { console.log(this); // expecting to see the window object }); 4) Just reference window directly $.each.call(this, [1,2,3], () =&gt; { console.log(window); // expecting to see the window object });
type: Answer
has comment: http://stackoverflow.com/comment/45039020
score: 5

http://stackoverflow.com/q/28314454
tagged with: javascript
tagged with: drupal-behaviors
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28316829
type: UnansweredQuestion
has body: I had started developing a module in Drupal. I made two form controls: a fieldset and a button. The button calls a javascript function "myphoto_options" when it is click. This function only does an alert function. After executing the called function, the page then immediately refreshes the page. How to prevent the page from reloading? Below are my codes: function myid_user_page_form(){ $form = array(); $form['id'] = array( '#type' =&gt; 'fieldset', '#title' =&gt; t('ID Information'), '#collapsible' =&gt; TRUE, '#collapsed' =&gt; FALSE, ); $form['id']['myphoto_button'] = array( '#type' =&gt; 'button', '#value' =&gt; '...', '#attributes' =&gt; array( 'onclick' =&gt; "myphoto_options();",), ); return $form; } Javascript function: function myphoto_options(){ alert("Hey"); return false; } Any help would be very much appreciated. Thanks.
tagged with: drupal
has title: Prevent Drupal's Page from refreshing after a button is click in Forms API
type: Question
tagged with: drupal-7
has comment: http://stackoverflow.com/comment/44986928
tagged with: form-api

http://stackoverflow.com/comment/45169733
score: 0
has text: Done, I have updated the code above but I still get the same exception.
type: Comment
comment on: http://stackoverflow.com/q/28417490
type: QuestionComment

http://stackoverflow.com/comment/45042222
score: 0
type: Comment
type: QuestionComment
has text: can you show the .aspx markup and the related javascript. also you can create a javascript that uses the `__doPostBack()` method that references an event in your .cs file as well also `Request["__EVENTTARGET"]` is an object so I would also suspect that you would need to cast that object to a `(string)` if you plan to assign it's contents to a string variable. I would also use a `Session[""] ` variable personally to hold that information or a hidden field.. Can you report on if you can step into that code or not and report back if there is a issue or not ..?
comment on: http://stackoverflow.com/q/28349155

http://stackoverflow.com/comment/45108757
score: 2
has text: Please show the HTML structure. We can provide the best jQuery options when we can clearly see the HTML structure you are dealing with. We have to know where things are relative to each other.
comment on: http://stackoverflow.com/q/28385539
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28297850
has body: Here you have working example: http://jsbin.com/wecupu/2/edit HTML JS Bin JS var readFile = function(e) { var input = e.target; var reader = new FileReader(); reader.onload = function(){ var img = document.createElement('img'); img.src = reader.result; var image = new fabric.Image(img); canvas.add(image); }; reader.readAsDataURL(input.files[0]); }; document.getElementById('file').addEventListener('change', readFile); var canvas = new fabric.Canvas(document.getElementById('canvas'), { backgroundColor: '#c8c8c8' }); You just have to use FileReader to read image file into base64 format and add fabric.Image to canvas. However, there is limitation to file size. It varies across browsers: What is the size limit of a Base64 DataURL image?
has comment: http://stackoverflow.com/comment/44947930
type: Answer
has comment: http://stackoverflow.com/comment/44948301
score: 0
upvote count: 1
answers question: http://stackoverflow.com/q/28297260
has comment: http://stackoverflow.com/comment/44948573
downvote count: 1
has comment: http://stackoverflow.com/comment/44948523
has comment: http://stackoverflow.com/comment/44948835
has comment: http://stackoverflow.com/comment/44948662
has comment: http://stackoverflow.com/comment/44948430

http://stackoverflow.com/comment/44952189
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28300355
has text: Not everything on the web is a jQuery Plugin
score: 5

http://stackoverflow.com/comment/45114460
type: QuestionComment
comment on: http://stackoverflow.com/q/28388434
score: 0
has text: Is your array possibly being sent into the function as a string? Your code does work in a fiddle.
type: Comment

http://stackoverflow.com/a/28361694
has comment: http://stackoverflow.com/comment/45065924
answers question: http://stackoverflow.com/q/28361407
score: 4
has body: Method 1: You can bind the function to the resize event. It'll run your function again every time there is a resize. This may cause problems if running the code twice on the item will cause problems. $( window ).resize(function() { // Remove slider and redo $( "#divstretch" ).Lslider({ SlideCount:5, SlideMargin:20, SmSlideCount : 3, XsSlideCount : 2 }); }); Method 2: Or you could wrap the code you'd like to rerun in the resize function. And it'll adjust automatically. $( window ).resize(function() { .... //appending the height and width to containers var totleLI = $(bigImgArray).length; var LIwidth = $(bigImgArray).width(); var totalWidth = LIwidth * totleLI; var totleHeight = $(bigImgArray).height(); $(Lcontainer).width(totalWidth); $(Lcontainer).height(totleHeight); $(Pcontainer).height(totleHeight); .... }); Just make sure to trigger the resize code once on load. $(window).trigger('resize');
has comment: http://stackoverflow.com/comment/45066057
type: Answer
has comment: http://stackoverflow.com/comment/45065976
upvote count: 4
downvote count: 0

http://stackoverflow.com/q/28357965
possible better answer: http://stackoverflow.com/a/33810916
has answer: http://stackoverflow.com/a/41348979
has answer: http://stackoverflow.com/a/76298304
has answer: http://stackoverflow.com/a/67319608
downvote count: 0
has answer: http://stackoverflow.com/a/58397694
has comment: http://stackoverflow.com/comment/45075281
score: 61
favorite count: 0
has answer: http://stackoverflow.com/a/48366219
has comment: http://stackoverflow.com/comment/77255974
upvote count: 61
linked to: http://stackoverflow.com/q/8384029
has answer: http://stackoverflow.com/a/70694695
tagged with: auto-increment
has answer: http://stackoverflow.com/a/30164636
answer count: 18
has answer: http://stackoverflow.com/a/53844013
has answer: http://stackoverflow.com/a/76608914
has answer: http://stackoverflow.com/a/53522513
has comment: http://stackoverflow.com/comment/108301161
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/50344482
has title: Mongoose auto increment
has answer: http://stackoverflow.com/a/40137723
accepted answer: http://stackoverflow.com/a/30164636
has answer: http://stackoverflow.com/a/65613414
has comment: http://stackoverflow.com/comment/45106147
type: Question
has answer: http://stackoverflow.com/a/57901274
tagged with: mongodb
has body: According to this mongodb article it is possible to auto increment a field and I would like the use the counters collection way. The problem with that example is that I don't have thousands of people typing the data in the database using the mongo console. Instead I am trying to use mongoose. So my schema looks something like this: var entitySchema = mongoose.Schema({ testvalue:{type:String,default:function getNextSequence() { console.log('what is this:',mongoose);//this is mongoose var ret = db.counters.findAndModify({ query: { _id:'entityId' }, update: { $inc: { seq: 1 } }, new: true } ); return ret.seq; } } }); I have created the counters collection in the same database and added a page with the _id of 'entityId'. From here I am not sure how to use mongoose to update that page and get the incrementing number. There is no schema for counters and I would like it to stay that way because this is not really an entity used by the application. It should only be used in the schema(s) to auto increment fields.
has answer: http://stackoverflow.com/a/54781939
tagged with: mongoose
has answer: http://stackoverflow.com/a/33810916
tagged with: javascript
linked to: http://stackoverflow.com/q/41477799
has answer: http://stackoverflow.com/a/77681373
has answer: http://stackoverflow.com/a/52718522

http://stackoverflow.com/a/28303655
has comment: http://stackoverflow.com/comment/44961496
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/44961364
has comment: http://stackoverflow.com/comment/45073335
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28303077
has body: Instead of using siblings, you should keep an identifier to the expanded card in the App component's state and let React re-render if the selected card changes. Here is an example how you would do it with react: JSfiddle: http://jsfiddle.net/vdw27xpf/ var Card = React.createClass({ render: function () { var cx = React.addons.classSet; var classes = cx({ 'card': true, 'expanded': this.props.expanded }); return ( {this.props.name} {this.props.entf.toFixed(2)} km ) } }); var App = React.createClass({ getInitialState : function(){ return { expandedCardName : null }; }, handleClick: function (value) { this.setState({ expandedCardName : value }); }, render: function () { var pools = this.props.data.map(function (pool) { return ( <Card key={pool.name} expanded = { pool.name == this.state.expandedCardName } onClick={this.handleClick.bind(this,pool.name)} name={pool.name} entf={pool.entf} /> ); }.bind(this)); return ( {pools} ) } }); var data = [ { name:"card1", entf:60 },{ name:"card2", entf:50 } ]; React.render(<App data={data} />, document.body);
answers question: http://stackoverflow.com/q/28303077
has comment: http://stackoverflow.com/comment/44961602
type: Answer

http://stackoverflow.com/comment/45199613
has text: Would you be interested to expand why you felt it wasn't well written? I'd be interested in learning a different perspective. As reference the above is a typical [fluent interface](http://en.wikipedia.org/wiki/Fluent_interface#JavaScript) ("There are many examples of JS libraries that use some variant of this: jQuery probably being the most well known.") Method chaining and the jQuery DSL is a well established and popular style to manage things like this. Composability offers a lot more flexibility and readability then sticking hacked up HTML strings in your code.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28423221

http://stackoverflow.com/q/28321021
has answer: http://stackoverflow.com/a/28321542
has answer: http://stackoverflow.com/a/28321148
linked to: http://stackoverflow.com/q/28320979
tagged with: arrays
has title: Unable to get the values from JSON Array and Object
tagged with: javascript
has comment: http://stackoverflow.com/comment/44990275
upvote count: 2
duplicate of: http://stackoverflow.com/q/28320979
possible better answer: http://stackoverflow.com/a/28321383
has answer: http://stackoverflow.com/a/28321383
downvote count: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28321255
tagged with: php
has body: In my Javascript and PHP, I've manage to do an .ajax call to get an array. However when I want to display the display the values of each object I'm unable to do so. PHP: $request = '{"request_id":' .$requestId. ', "reqName":"' .$requestName. '", "reqSubject":' .json_encode($requestSubjects). '}'; array_push($requestArray, $request); echo json_encode($requestArray); So when I console.log(data) it looks like this: ["{"request_id":13, "reqName":"Rin", "reqSubject":["English","A Math"]}", "{"request_id":14, "reqName":"Rin", "reqSubject":["English","E Math"]}"] When I console.log(data[0]), I'm able to get the first object: {"request_id":13, "reqName":"Rin", "reqSubject":["English","A Math"]} However when I want to get the values of the object like so, console.log(data[0].request_id), it returns an undefined. Would highly appreciate if someone could tell me what's wrong with my codes. Thank you.
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44990266
accepted answer: http://stackoverflow.com/a/28321148
score: 1
tagged with: http://stackoverflow.com/tag/json
type: Question

http://stackoverflow.com/q/28422408
linked to: http://stackoverflow.com/q/28412000
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28422482
score: 0
favorite count: 0
upvote count: 1
downvote count: 1
has body: After a very effective and helpful response to my question here: javascript text field counter display I not have one additional question. The code (shown below) works wonderfully, however it ONLY displays after a keypress. How do I tweak it so that it not only updates on keypress, but also displays after the page has loaded so the user can see the character count before they focus on the field and type? Usually (but not always) there will be text already inside the text field saved from a previous session, so they counter needs to pick up from there. Code in use currently: $(window).load(function() { $("#input_4_1").keyup(function() { var diff = (2550 - $(this).val().length); if (diff >= 501) { $("#count_4_1").html("Characters remaining: " + diff + ""); } else if ((diff <= 500) && (diff >= 101)) { $("#count_4_1").html("Characters remaining: " + diff + ""); } else if (diff <= 100) { $("#count_4_1").html("Characters remaining: " + diff + ""); } }); }); Thanks!
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28422482
has title: javascript text field counter display showing on load as well as keyup

http://stackoverflow.com/comment/45064029
type: Comment
comment on: http://stackoverflow.com/a/28360791
has text: which line dude? come on
score: 0
type: AnswerComment

http://stackoverflow.com/q/28373054
has comment: http://stackoverflow.com/comment/45086545
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45086589
type: Question
has comment: http://stackoverflow.com/comment/45086768
has comment: http://stackoverflow.com/comment/45086855
tagged with: javascript
has title: AJAX: Calling a php script and modifiying javascript variable
score: 0
duplicate of: http://stackoverflow.com/q/14220321
has comment: http://stackoverflow.com/comment/45086920
has comment: http://stackoverflow.com/comment/45086641
tagged with: jquery
has comment: http://stackoverflow.com/comment/45086728
linked to: http://stackoverflow.com/q/14220321
tagged with: ajax
has comment: http://stackoverflow.com/comment/45086651
has body: I am trying to understand how AJAX works. I have a problem in my code and I think it comes from the fact that AJAX is asynchronous (It might not be reason of the problem though). I am asking for your help to figure out what is wrong. This is my javascript function. It calls a php page that check if the email is already in the database. function validateEmail() { var email = $("#email").val(); var isValid = false; if (email == "" || email.length == 0) { $("#emailresult").html("You must enter your email"); isValid = false; } else if (email.length &gt; 50) { $("#emailresult").html("Your email cannot have more than 75 characters"); isValid = false; } else { $.post("checkemail.php", { email: email }, function(result) { if (result == 1) { alert("Inside result==1"); $("#emailresult").html("Valid"); isValid = true; alert(isValid); } else { alert("Inside result != 1"); $("#emailresult").html("Already in use"); isValid = false; } }); } alert(isValid); return isValid; } Assume that checkemail.php returns 1. The alerts I have are: Inside result==1 true false So, in the end, the value returned is always false even if the email should be valid. Anyone can help me fix this? Thank you!
tagged with: php
has comment: http://stackoverflow.com/comment/45086799

http://stackoverflow.com/q/28316808
tagged with: php
answer count: 0
type: Question
has body: Hi I have two input buttons, one continues to the next page (test32_page2.php) and a refresh input which refreshes the page (test32.php) Input continue: &lt;input type='submit' name="submitcart" value='Continue' onclick="f1.action='test32_page2.php'; return true;" style="visibility: &lt;?=$submitshow?&gt;;"&gt; and the other input is a refresh: &lt;input type='submit' name="submit" value='Refresh' onclick="f1.action="test32.php"; return true;" style="visibility: &lt;?=$refreshshow?&gt;;"&gt; Once the user inputs their values and presses continue they are then processed on the following page, however if they then go back to test32.php and press refresh they are then sent to the following page again (test32_page2.php) instead of reloading test32.php again. How can I make sure that when refresh input is pressed it only reloads the page not do anything else? Is this a cache/meta issue? I've been around and around in circles on this one, partly I think because the different browsers seem to do different things. Help much appreciated. Thanks
has comment: http://stackoverflow.com/comment/44982964
tagged with: javascript
has comment: http://stackoverflow.com/comment/44982848
score: 0
tagged with: http://stackoverflow.com/tag/html
has title: Refresh input button not refreshing
type: UnansweredQuestion

http://stackoverflow.com/a/70624760
answers question: http://stackoverflow.com/q/28403558
has body: var answers = ["A","C","B"], tot = answers.length; function getCheckedValue( radioName ){ var radios = document.getElementsByName( radioName ); // Get radio group by-name for(var y=0; y<radios.length; y++) if(radios[y].checked) return radios[y].value; // return the checked value } function getScore(){ var score = 0; for (var i=0; i<tot; i++) if(getCheckedValue("question"+i)===answers[i]) score += 1; // increment only return score; } function returnScore(){ alert("Your score is "+ getScore() +"/"+ tot); } How many letters are there in "JS"? 2 1 3 4 How many letters are there in "BMX"? 2 1 3 4 How many letters are there in "A"? 2 1 3 4 View Results
has comment: http://stackoverflow.com/comment/124851386
score: 0
type: Answer

http://stackoverflow.com/comment/44991317
comment on: http://stackoverflow.com/q/28321473
has text: possible duplicate of [Parse URL with jquery/ javascript?](http://stackoverflow.com/questions/6644654/parse-url-with-jquery-javascript)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44969214
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28292962
has text: Thanks Raeen, but this is not what I want. I'd like to display regular labels rather than poup tooltips.

http://stackoverflow.com/comment/45127268
has text: Note that the OP stated in the comments that he actually did have the file extension in there.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28395551
type: Comment

http://stackoverflow.com/a/28330371
has body: To read the file you will perform the following code File sdcard = Environment.getExternalStorageDirectory(); String path= sdcard+"/sys/cpu/"; File file = new File(path,"cpuvalue.txt"); //Read text from file StringBuilder text = new StringBuilder(); try { BufferedReader br = new BufferedReader(new FileReader(file)); String line; while ((line = br.readLine()) != null) { text.append(line); } br.close(); } catch (IOException e) { } Following code to compare your value with check and change it if(text.equals("12")){ checkBox.setChecked(true); } else{ checkBox.setChecked(false); }
downvote count: 0
has comment: http://stackoverflow.com/comment/45008319
type: Answer
has comment: http://stackoverflow.com/comment/45008091
upvote count: 1
answers question: http://stackoverflow.com/q/28329948
score: 1

http://stackoverflow.com/a/28453295
score: 2
answers question: http://stackoverflow.com/q/28364962
downvote count: 0
upvote count: 2
type: Answer
has body: After a couple months working with React + Flux, I've faced the same question and have tried some different approaches. I've reached the conclusion that the best way is to have the actions deal with data updates, both remote and local: # COMPONENT TodoItems = React.createClass componentDidMount: -&gt; TodoStore.addListener("CHANGE", @_onChange) _onChange: -&gt; @setState { todos: TodoStore.get() _onKeyDown: (event) -&gt; if event.keyCode == ENTER_KEY_CODE content = event.target.value.trim() TodoActions.add(content) render: -&gt; React.DOM.textarea {onKeyDown: @_onKeyDown} # ACTIONS class TodoActions @add: (content) -&gt; Dispatcher.handleAction({type: "OPTIMISTIC_TODO_ADD", todo: {content: content}}) APICall.addTodo({content: content}) # STORE class TodoStore extends EventEmitter constructor: -&gt; @todos = [] # this is a nice way of retrieving from localStore @dispatchToken = @registerToDispatcher() get: -&gt; return @todos registerToDispatcher: -&gt; Dispatcher.register (payload) =&gt; type = payload.type todo = payload.todo response = payload.response switch type when "OPTIMISTIC_TODO_ADD" @todos.push(todo) @emit("CHANGE") when "TODO_ADD" # act according to server response @emit("CHANGE") # or whatever you like #### APICall class APICall # what can be called an 'action creator' @addTodo: (todo) -&gt; response = http.post(todo) # I guess you get the idea Dispatcher.handleAction({type: "TODO_ADD", response: response}) As you can see, the "juice" is within TodoActions. When a todo gets added, TodoActions.add() can trigger an optimistic UI update via OPTIMISTIC_TODO_ADD that will insert into TodoStore.todos. In parallel it knows that this must be communicated to the server. An external entity - ApiCall (that can be considered an action creator) - is responsible to deal with the remote part of this action and when you get a response it follows its normal course to TodoStore that can act accordingly. If you make the stores directly responsible for remote content manage…

http://stackoverflow.com/q/28394198
score: 1
possible better answer: http://stackoverflow.com/a/28394260
upvote count: 1
has answer: http://stackoverflow.com/a/28394544
type: Question
downvote count: 0
tagged with: javascript
answer count: 3
has comment: http://stackoverflow.com/comment/45125063
accepted answer: http://stackoverflow.com/a/28394544
favorite count: 0
has answer: http://stackoverflow.com/a/28394260
has title: how to make function validation alert if not selected
has body: I already succeeded in making alert if the box is left empty or not filled in. All of my codes are working except for the GENDER and GRADE. For GENDER they have to tick to select. For Grade they have to select on the drop down menus. Here are my codes. function validation() { if(document.form1.first_name.value=="") { alert("Please enter your first name."); document.form1.first_name.focus(); return false; } if(document.form1.last_name.value=="") { alert("Please enter your last name."); document.form1.last_name.focus(); return false; } if(document.form1.gender.value=="") { alert("Please select your gender."); document.form1.gender.focus(); return false; } if(document.form1.grade.value=="") { alert("Please select your grade."); document.form1.grade.focus(); return false; } First name, last name and others are working except for Grades and Gender. Please help me.
has answer: http://stackoverflow.com/a/28394274
type: AnsweredQuestion

http://stackoverflow.com/q/28293665
has title: Full Calendar rows by city using angularjs
answer count: 1
tagged with: angularjs
type: UnansweredQuestion
has body: Hi I am implementing a full calendar feature in an application. As shown in the following plunker. http://plnkr.co/edit/AtmzLrn81FsxJxyc5rzd?p=preview Currently the calendar is displaying "Time" row-wise under heading of "all-day" I want to change all-day to cities, so that on each row I have city names instead of time. Please let me know how to achieve this.
has answer: http://stackoverflow.com/a/28294011
type: Question
tagged with: javascript
tagged with: fullcalendar
score: 0

http://stackoverflow.com/comment/45050559
type: AnswerComment
comment on: http://stackoverflow.com/a/28352762
score: 0
type: Comment
has text: @PSL yes I'm using angular ui bs tooltip. I don't have any plunker setup for this sorry.

http://stackoverflow.com/comment/45143092
type: QuestionComment
score: 0
has text: sorry I dint get u @Justinas
comment on: http://stackoverflow.com/q/28403793
type: Comment

http://stackoverflow.com/comment/45059899
score: 1
comment on: http://stackoverflow.com/q/28358331
has text: You can't have a `for` loop inside an object literal. But there's no reason you can't use one to add properties to the object after creating it.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44926157
has text: Try calling `event.preventDefault()` in the `keyPress` event handler.
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28285898

http://stackoverflow.com/a/28401918
answers question: http://stackoverflow.com/q/28401623
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28401623
type: Answer
has body: Make sure to include jQuery for both desktop and mobile. Include the below minified jQuery snippet to detect if your user is viewing using a mobile device. /** * jQuery.browser.mobile (http://detectmobilebrowser.com/) * * jQuery.browser.mobile will be true if the browser is a mobile device * **/ (function(a){(jQuery.browser=jQuery.browser||{}).mobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01…
score: 2
upvote count: 2

http://stackoverflow.com/a/67831977
answers question: http://stackoverflow.com/q/28384869
type: Answer
has comment: http://stackoverflow.com/comment/119895840
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/119896815
has body: javaScript version here var year = 2021 var month = 6 var startDate = moment([year, month]) //Get the first and last day of the month var firstDay = moment(startDate).startOf('month') var endDay = moment(startDate).endOf('month') //Create a range for the month we can iterate through var monthRange = moment.range(firstDay, endDay) //Get all the weeks during the current month var weeks = [] var indexOf = [].indexOf; monthRange.by('days', function (moment) { var ref; if (ref = moment.week(), indexOf.call(weeks, ref) &lt; 0) { return weeks.push(moment.week()); } }); var calendar, firstWeekDay, i, lastWeekDay, len, week, weekRange; calendar = []; for (i = 0, len = weeks.length; i &lt; len; i++) { week = weeks[i]; // Create a range for that week between 1st and 7th day firstWeekDay = moment().week(week).day(0); lastWeekDay = moment().week(week).day(6); weekRange = moment.range(firstWeekDay, lastWeekDay); // Add to the calendar calendar.push(weekRange); }
downvote count: 0

http://stackoverflow.com/comment/68538881
type: AnswerComment
type: Comment
has text: Please write your explanations in English.
score: 1
comment on: http://stackoverflow.com/a/40653794

html5-canvas
tags question: http://stackoverflow.com/q/28434618
tags question: http://stackoverflow.com/q/28309401
tags question: http://stackoverflow.com/q/28335282
tags question: http://stackoverflow.com/q/28429959
tags question: http://stackoverflow.com/q/28338211
tags question: http://stackoverflow.com/q/28317197
tags question: http://stackoverflow.com/q/28390358
tags question: http://stackoverflow.com/q/28286603
tags question: http://stackoverflow.com/q/28426989
tags question: http://stackoverflow.com/q/28285233
tags question: http://stackoverflow.com/q/28380547
tags question: http://stackoverflow.com/q/28301286
tags question: http://stackoverflow.com/q/28419968
tags question: http://stackoverflow.com/q/28299050
tags question: http://stackoverflow.com/q/28359262
tags question: http://stackoverflow.com/q/28301391
tags question: http://stackoverflow.com/q/28350881
tag name: html5-canvas
tags question: http://stackoverflow.com/q/28405879
tags question: http://stackoverflow.com/q/28361713
tags question: http://stackoverflow.com/q/28291798
type: Tag
tags question: http://stackoverflow.com/q/28376917
tags question: http://stackoverflow.com/q/28395950
tags question: http://stackoverflow.com/q/28297260

http://stackoverflow.com/a/28406953
downvote count: 0
answers question: http://stackoverflow.com/q/28401523
score: 4
has body: For delete operator You can write: external fun delete(p: dynamic): Boolean = noImpl //... delete(thing[key]) For more convenient use I'd added some helpers: fun delete(thing: dynamic, key: String) { delete(thing[key]) } // or fun String.deleteFrom(d: dynamic) { delete(d[this]) } fun test(a: Any, k: String) { delete(a, k) k.deleteFrom(a) k deleteFrom a } Note: using the delete operator is not a good practice and it'll leads to deoptimizations in JS VMs
type: AcceptedAnswer
type: Answer
upvote count: 4
accepted answer of: http://stackoverflow.com/q/28401523

http://stackoverflow.com/q/28434841
has body: I better make a list in order to explain the steps that I would like to do: Get the name of the last element of the html-input (has been generated via PHP) The basic setting looks like this: &lt;input type='text'name='E_8' value= '123' /&gt; &lt;input type='text'name='E_9' value= '456' /&gt; &lt;input type='text'name='E_10' value= '789' /&gt; &lt;input type='submit' name='submit' value='Update'/&gt; Pass it over to a JS function Append some additional fields (use part of the name as an id for new fields The JS-script works fine and I am able to add fields. Also the content of the fields is being processed by the PHP script and written in a db. Short: how do I get the last value, no matter how many fields there are? edit: I had forgotten that there is a submit button that would appear as the last element as well ... sorry for that
score: 0
has answer: http://stackoverflow.com/a/28435144
tagged with: php
has answer: http://stackoverflow.com/a/28435541
has answer: http://stackoverflow.com/a/28435109
has title: JS: name of last input element (HTML/PHP)
has answer: http://stackoverflow.com/a/28434985
has comment: http://stackoverflow.com/comment/45200823
type: AnsweredQuestion
tagged with: javascript
has comment: http://stackoverflow.com/comment/45215259
tagged with: jquery
has answer: http://stackoverflow.com/a/28434952
has answer: http://stackoverflow.com/a/28434942
accepted answer: http://stackoverflow.com/a/28435109
type: Question
tagged with: field
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28434942
answer count: 6

http://stackoverflow.com/comment/44938112
type: QuestionComment
has text: another link to pass data by query string and javascript: http://www.xul.fr/javascript/parameters.php
comment on: http://stackoverflow.com/q/28292436
score: 0
type: Comment

http://stackoverflow.com/a/28321313
answers question: http://stackoverflow.com/q/28319735
has body: While not required, I'd remove lines 2 and 3: doubleClickTimeout: null, waitingForDoubleClick: false, And set them in componentWillMount. The reason is if these are object/arrays, they'll be shared by all instances using the above, while componentWillMount is a function so they'll be clean references. componentWillMount: function(){ this.doubleClickTimeout = null; this.waitingForDoubleClick = false; } The rule of thumb is if it affects render, it must be in state or props. Otherwise an instance property is the way to go.
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 3
score: 3
accepted answer of: http://stackoverflow.com/q/28319735

http://stackoverflow.com/q/28389135
has comment: http://stackoverflow.com/comment/45133314
tagged with: ruby-on-rails
type: Question
tagged with: capybara
tagged with: javascript
has comment: http://stackoverflow.com/comment/45124614
has body: In one of my Rails projects, I'm working on an interface to do CRUD operations on a resource (Commands) fully via AJAX (ie. no page reload needed). So there's a link to add a Command to the list, the user can click on any Command to edit its data then click Save to update via AJAX, and so forth. This last operation (clicking the Update button) is causing me trouble: it works perfectly in any browser I've tried, but when I follow the exact same steps in my Capybara specs (using either PhantomJS or Poltergeist driver) the specs fail right around that step. I'm posting to ask for guidance re: how to move forward with this. I can get away with incomplete test coverage in this case, but it worries me to think that PhantomJS isn't executing all page javascript properly. (This app relies heavily on PhantomJS for unrelated reasons, so it's important for me to know how faithful its JS execution is.) Does anyone know of any cases where PhantomJS executes Jquery AJAXy JS less-than-faithfully, and if so, what can be done about it? Thanks in advance. Specifics and code snippets are below. Any ideas are appreciated. Specifics The offending JS This is vanilla Jquery. Nothing too complicated. // User clicks "Save" in a URL edit form to update that URL $('.command .update_url').click(function(){ var command = $(this).parents('.command'); var command_path = command.attr('command_path'); var new_url = command.find('.url_field').val(); $.ajax({ type: 'PATCH', url: command_path, data: { command: { url: new_url }}, // &lt;-- (Defines required param) success: function(data){ if (data.success) { // ... Close edit window &amp; display cues that save is complete } else { alert("Unable to save changes. Please refresh the page."); } } }) }); The spec The following is a plain Rspec integration test that uses Capybara, FactoryGirl, and not much else. @user = create :user @site = create :site, user: @user @command = create :command, site: @site, url: "http://example.com/123" stub_login(@user) # a…
upvote count: 1
answer count: 1
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has title: Rails page JS works in real browser / manual testing but not in PhantomJS & Selenium specs
tagged with: phantomjs
downvote count: 0
has answer: http://stackoverflow.com/a/29083857
score: 1

http://stackoverflow.com/a/28300775
answers question: http://stackoverflow.com/q/28300551
type: Answer
has body: You could use :has() jquery selector: $("li:has(a:contains('Testing'))") Or .has() method: $('li').has("a:contains('Testing')")
score: 0

http://stackoverflow.com/comment/45032804
type: QuestionComment
comment on: http://stackoverflow.com/q/28344089
type: Comment
score: 1
has text: @ElegantCoder: I didn't say it wasn't, I said that surprised me.

http://stackoverflow.com/a/28317830
downvote count: 0
score: 1
type: Answer
upvote count: 1
has body: You currently have both radio buttons using the same ID. ID's should be unique. You can use the [name] attribute to do this, or you can set a class on the element. Here is an example: $('input[name=q1][value="'+ data.q1 +'"]').prop('checked', true);
answers question: http://stackoverflow.com/q/28317670

http://stackoverflow.com/comment/44988362
has text: I have a AutoPostBack="True" on a CheckBoxList
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28318915
score: 0

http://stackoverflow.com/q/28282231
tagged with: graph
downvote count: 0
tagged with: javascript
upvote count: 2
tagged with: myo
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: Canvas.js chart not updating with new data
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28657156
score: 2
has body: I'm using CanvasJS to create a line graph based on some numbers coming in from my Myo. When new data comes in, the graph doesn't update. Since I don't populate the graph with initial data points, it stays empty forever. My code: Here
tagged with: canvasjs
type: Question

http://stackoverflow.com/a/28305282
score: 3
has comment: http://stackoverflow.com/comment/44961905
answers question: http://stackoverflow.com/q/28304934
downvote count: 0
has body: This answer uses jQuery.map to turn the array of elements into an array of numbers representing how many classes on each element start with userNote. It then uses Array.reduce to simply sum those numbers up. var getLength = function (element) { var classLength = element.find('.textHighLight').map(function(i,e){ return this.className.split(' ').reduce(function(cNum, cName){ return cName.substring(0, 8) === 'userNote' ? cNum + 1 : cNum; }, 0); }).get().reduce(function(p,c){ return p+c; }); return classLength; } console.log(getLength($('#first'))) console.log(getLength($('#second'))) CO N STR U CTION, CO N STR U CTION,
type: Answer
upvote count: 3

http://stackoverflow.com/a/28374693
has body: You can use conditional comments to target IE 9 and write a script to change out the iframe. Or you can try to use the conditional comment to select which tag gets displayed directly. <!--[if IE 9]> go here <![endif]--> <!--[if !IE]> --> <!-- <![endif]-->
type: Answer
accepted answer of: http://stackoverflow.com/q/28374580
has comment: http://stackoverflow.com/comment/45091017
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45089865
answers question: http://stackoverflow.com/q/28374580
has comment: http://stackoverflow.com/comment/45090978
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45117532
comment on: http://stackoverflow.com/q/28389395
score: 0
type: Comment
has text: This might be relevant: there's a new command waitForAlert() in CasperJS version 1.1-beta4, but I couldn't try it as the latest version available on their website is version 1.1-beta3.
type: QuestionComment

http://stackoverflow.com/a/28421780
accepted answer of: http://stackoverflow.com/q/28421740
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28421740
downvote count: 0
type: Answer
score: 2
has body: b is a variable local to the function assigned to global. It isn't a property of the object assigned to object. c is a property that will be set on the object assigned to object after object.global() is called. It isn't a property of the function that is assigned to global. If you want to access b and c like that then you need to either make the function an object: global: { b: 'b'; c: 'c'; }, … or make them properties of the function … global: function () { // The function can do something }, // Outside the definition of object: object.global.b = "b"; object.global.c = "c"; … or you can have the function return them, and then access them after calling the function: global: function () { return { b: "b", c: "c" }; }, // later this.global().b; this.global().c;
upvote count: 2

http://stackoverflow.com/comment/44948828
score: 0
comment on: http://stackoverflow.com/q/28293449
type: QuestionComment
has text: @Roamer-1888 I thought my explanation covered it in more detail let me know what would make it clear. If there was some way to profile parse cloud code, that would be helpful in diagnosing this.
type: Comment

http://stackoverflow.com/a/28356479
score: 0
has comment: http://stackoverflow.com/comment/45112052
answers question: http://stackoverflow.com/q/28356348
type: Answer
has body: Higher values of elem.style.top move an element further down in its container. If top is 10px, then the top of the element is 10 pixels from the top of its container. If top is 100px, then it's 90 pixels farther down. So to move an element "up" in reelUp, decrease top: elem.style.top = curLoc - down + 'px'; And to move it element "down" in reelDown, increase top: elem.style.top = curLoc + down + 'px'; I haven't tried running your code, but after reading it I would imagine the reason it only works once is that the variable id isn't defined within the scope of the frame function. If you declare var id before function frame() then it should work. Those are the answers to your specific questions. Once you have those under control, I'd suggest combining reelUp and reelDown into one function since they're largely identical (they'll differ by a single character: +/-).

http://stackoverflow.com/q/28429007
has answer: http://stackoverflow.com/a/28432895
type: Question
has answer: http://stackoverflow.com/a/28502593
tagged with: javascript
tagged with: ng-grid
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/39443943
tagged with: angularjs
has title: Remember ng-grid grouping open||collapsed states
type: UnansweredQuestion
has body: The ng-grid has the gridoption "showGroupPanel" which allows you to d&amp;d a columnheader in your grid and sort your content by that column. var app = angular.module('myApp', ['ngGrid']); app.controller('MyCtrl', function($scope) { $scope.myData = [{name: "Moroni", age: 50}, {name: "Tiancum", age: 43} $scope.gridOptions = { data: 'myData', showGroupPanel: true }; }); See example here: http://plnkr.co/edit/Bo11ckeWFiMyJ4tyLVWC?p=preview In my application I would like the open||closed property of each group to be stored in local storage, and used when the page is reloaded. Is there a property for the groups or has anyone been able to solve this in some other way?

http://stackoverflow.com/q/28339130
has comment: http://stackoverflow.com/comment/45023991
type: Question
tagged with: object
tagged with: ios
tagged with: javascript
has comment: http://stackoverflow.com/comment/45027982
upvote count: 1
has comment: http://stackoverflow.com/comment/45029727
has title: How to call object c action in javascript function
linked to: http://stackoverflow.com/q/2873899
favorite count: 0
has body: is it possible to call an object c action, when you are executing a javascript function. I have this function in java. .when('/testimonials', { controller: 'TestiController', templateUrl: 'partials/testimonials.html' }) And i want to have this action executed when the javascript function is being executed.. - (IBAction)knap2:(id)sender{ knap1.hidden = YES; } I've tried searching but couldn't find anything.
type: UnansweredQuestion
tagged with: xcode
has comment: http://stackoverflow.com/comment/45029109
answer count: 0
downvote count: 0
score: 1

http://stackoverflow.com/q/28321019
tagged with: meteor
type: UnansweredQuestion
has title: Moving meteor app source code brokes the app
has answer: http://stackoverflow.com/a/28322385
tagged with: node.js
type: Question
tagged with: javascript
score: 0
answer count: 1
has body: I am trying to create new Meteor app in the root folder of my current project. I am trying to create new scaffolded Meteor app in already existing folder containing Git. Here is the first state after generating new Meteor app: root_folder - new_meteor_folder -- meteor_source_codes In this state app is running without any problem. Then I move Meteor source codes to project root folder (including .meteor) and run again. root_folder - meteor_source_codes But I gent an error: https://gist.github.com/pavelbinar/9cc8b028c6689d945996

http://stackoverflow.com/a/28436554
answers question: http://stackoverflow.com/q/28293339
score: 0
type: Answer
has body: Okay, I misunderstood your question. So you have cookie/HTTP sessions implemented properly, and the following occurs: A user loads the login page in two browser windows (or tabs) of the same browser application. A single HTTP session (unauthenticated) and corresponding browser cookie are created (on the first load). User logs in as user A in the first window, which updates the session and cookie to reflect that user A is logged in. User then logs in as user B in the second window, which updates the session and cookie to reflect that user A is logged in. If your app has user-specific content, user A's data will still be displayed in the first browser window, but refreshing the page or browsing around will show that it's really user B logged in. None of this behavior is indicative of a problem, but you'd like to be able to detect when this has happened (or at least steps 1-3). To do this, I would recommend storing something about the user in the session/cookie after authentication, such as an ID (you may already be doing this). When setting this value in the HTTP session/cookie, first check to see if there's already a non-null value in it. If so, then you have successfully detected the scenario above. So after authentication, something like this, where request is the HttpServletRequest: Integer userId = (Integer) request.getSession().getAttribute("userId"); if (userId != null &amp;&amp; userId != newlyAuthenticatedUserId) { System.out.println("Second login from same browser!"); } request.getSession().setAttribute("userId", userId);

http://stackoverflow.com/q/28365709
type: Question
has comment: http://stackoverflow.com/comment/45072603
tagged with: javascript
has answer: http://stackoverflow.com/a/28365799
tagged with: prototype
possible better answer: http://stackoverflow.com/a/28365789
has comment: http://stackoverflow.com/comment/45075532
answer count: 3
has answer: http://stackoverflow.com/a/28365789
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28365838
accepted answer: http://stackoverflow.com/a/28365799
tagged with: javascript-objects
has body: I am trying to learn Object Oriented Programming in JavaScript. Therefore, I may be wrong in what I am doing. I have one JS function (class): function User() { //initiating object code goes here } //Functions User.prototype.getEmpId = function() { return this.empId; } var myUser = new User({'empid':'1'}); console.log(myUser.getEmpId()); //Returns 1 var mynewuser = new User({'empid':'2'}); console.log(myUser.getEmpId()); //Returns 2 console.log(mynewuser.getEmpId()); //Returns 2 I don't understand what is going wrong here. If these two are two different objects then why is it causing problem. I have added the complete code here. Thanks in advance.
has comment: http://stackoverflow.com/comment/45073056
has title: JavaScript two objects - overriding each other
type: AnsweredQuestion
score: 1
upvote count: 1

http://stackoverflow.com/q/28355161
tagged with: selenium
type: Question
has title: Selenium Java - Fetching page source via JavascriptExecutor
tagged with: java
upvote count: 2
answer count: 2
linked to: http://stackoverflow.com/q/25356440
tagged with: javascript
has answer: http://stackoverflow.com/a/28355202
favorite count: 0
has answer: http://stackoverflow.com/a/28379161
has body: I want to read the page's source code after it has changed due to some ajax requests. Since I'm running out of ideas, I tried JavaScript, but the executeScript() function always returns null. Any help would be much appreciated. I use the FirefoxDriver. My code looks as follows: Object test = ((JavascriptExecutor) firefox).executeScript("function getHTML(){ return document.body.innerHTML;} getHTML();"); System.out.println(test);
tagged with: selenium-webdriver
score: 2
downvote count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/45559013
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28333750
has text: Hey,just saw the messages - sorry. I think his answer is what I describe as "pull" in my answer. It's a different mental model. If it works for you that's fine. If you use something similar be wary that it has a serious memory leak - you _must_ listen to the scope destory event and clear the interval. If you don't every time you enter/exit the controller your app will leak more and more memory. I don't think the overhead is particularly big and the push approach can also be made not to make requests to the server unless listeners are attached.

http://stackoverflow.com/q/28376375
has comment: http://stackoverflow.com/comment/45108859
has comment: http://stackoverflow.com/comment/45093018
type: UnansweredQuestion
has title: how to apply a java script array with an already orded list in html
has answer: http://stackoverflow.com/a/28376580
has answer: http://stackoverflow.com/a/28376576
score: 1
upvote count: 1
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: Hi I was wondering if anyone could help me out. I need to apply an array I created in Java Script on the HTML page that already has the order list created.I keep on getting error messages that say "Cannot read property of 'inner.HTML' undefined. Any help would be greatly appreciated:) thanks! Here is my code: &lt; div id = "results" &gt; &lt; ul &gt; &lt; li id = "1-1" &gt; &lt; /li&gt; &lt;li id="1-2"&gt;&lt;/li &gt; &lt; li id = "1-3" &gt; &lt; /li&gt; &lt;li id="1-4"&gt;&lt;/li &gt; &lt; li id = "1-5" &gt; &lt; /li&gt; &lt;/ul &gt; &lt; /div&gt; &lt;/article &gt; &lt; script &gt; //declared global variable with an array of variables. var places = ["Switzerland", "Canada", "Australia", "Norway", "New Zealand"] // function to place the country's name in the // li id. function processPlaces() { var locations = ""; for (var i = 0; i &lt; places.length; i++) { var listItem = i + 1; var list = document.getElementById("1-" + listItem); locations = list.getElementsByTagName("li"); locations[1].innerHTML += places[i]; } } //runs setUpPage () function when page loads. if (window.addEventListener) { window.addEventListener("load", processPlaces, false); } else if (window.attachEvent) { window.attachEvent("onload", processPlaces, false); } &lt; /script&gt;
answer count: 3
has answer: http://stackoverflow.com/a/28376522
tagged with: http://stackoverflow.com/tag/html
favorite count: 0

http://stackoverflow.com/comment/45306626
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28334988
has text: Well, you should have deleted other output and make the respone like:[{"id":"Wilkins","title":"Mr"},{"id":"Wilson","title":"Miss"},{"id"‌​:"Wilkins","title":"Mrs"}].Only with right json format,your `success` will work
score: 0

http://stackoverflow.com/comment/45189747
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28429177
has text: One small problem. It is very close to what I need, closer than what I had originally. However, a user should also be able to check ONLY a "type" option, and see all items of that type from all "brands". Any ideas on how to achieve this?
type: AnswerComment

http://stackoverflow.com/q/28290864
has comment: http://stackoverflow.com/comment/44941231
type: UnansweredQuestion
tagged with: web-services
has comment: http://stackoverflow.com/comment/44936412
has title: Calling WebService using AJAX XMLHttpRequest
answer count: 0
has comment: http://stackoverflow.com/comment/44940784
type: Question
tagged with: javascript
tagged with: ajax
has body: JavaScript Part: var request = new XMLHttpRequest(); var url = "http://localhost:21085/WebService1.asmx?op=GetModelsByID"; request.open('GET', url ); request.onreadystatechange = function () { if ((request.readyState === 4) &amp;&amp; (request.status === 200)) { document.writeln(request.responseText); }} request.send(); WebService Part: namespace JavaScriptAjax { [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] [System.Web.Script.Services.ScriptService] public class WebService1 : System.Web.Services.WebService {[WebMethod] public string GetModelsByID() { return ("jjjjjjjjjjjjjjjjjjjjj");}}} but request.responseText doesn't return anything. Is it possible to call a Webservice like this or I have to use SOAP?
score: 0
has comment: http://stackoverflow.com/comment/44972474
tagged with: asp.net

http://stackoverflow.com/a/28408860
has body: I do not know much about WP, but I think you can use the LoadCompleted event of WebBrowser control. Write your redirection code inside the event. More information here Hope this helps.
score: 0
answers question: http://stackoverflow.com/q/28408585
type: Answer

http://stackoverflow.com/a/28357326
score: 0
accepted answer of: http://stackoverflow.com/q/28356553
has comment: http://stackoverflow.com/comment/45177972
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28356553
has comment: http://stackoverflow.com/comment/45207845
has comment: http://stackoverflow.com/comment/45057924
has body: var str= 'hello zāi hi ē sure á ikr é' var words = str.split(' '); words.map(function(word){ if(word.match(/[āáēé]/g)) return 'a' + word; return word; }).join(' ').replace(/[āáēé]/g, function(letter){ switch(letter){ case 'ā': case 'á': return 'a'; break; case 'ē': case 'é': return 'e'; break; } })
type: Answer
has comment: http://stackoverflow.com/comment/45301337
has comment: http://stackoverflow.com/comment/45178691
has comment: http://stackoverflow.com/comment/45205067
has comment: http://stackoverflow.com/comment/45206496
has comment: http://stackoverflow.com/comment/45058161

http://stackoverflow.com/q/28289459
has comment: http://stackoverflow.com/comment/44933248
has body: I picked up some code on CodePen to help me dynamically replace the content of divs. It works, but as often happens when borrowing someone's code, I can't actually mold it to what I want it to do. The original code provides pictures of animals, and when you click it, it sends the text of the name of the animal to a div. The Javascript looks like this: $('#kittens').click(function() { $('div').html('Kittens'); }); $('#aardvark').click(function() { $('div').html('Aardvark'); }); I'm applying it to a more complicated webpage, so I really can't have it just replace the first level div with the word "Kittens." I've found that by keeping the single quotes, I can put any text or code I want in there and it works just fine, but only if I'm writing to the first level div. So I figure to target it, I should just give it the div ID. Something like: $('#kittens').click(function() { $('myDivName').html('Kittens'); }); This does nothing. I've also tried 'id=myDivName' , 'id="myDivName"' , id: myDivName , and a few others I can't recall right now. Nothing I can come up with seems to work. Does anybody know how this parameter works and how I can get it to target just the div I want?
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28289488
score: 0
answer count: 2
tagged with: jquery
has title: Selecting an HTML element by it's ID attribute with jQuery
has comment: http://stackoverflow.com/comment/44932752
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28289487

http://stackoverflow.com/a/28339048
type: Answer
answers question: http://stackoverflow.com/q/28338891
has body: Just noticed that I have to provide a criteria to update and the following seems to work for me: return Q().then(function(){ var d = Q.defer(); mongoose.models[col].findOne({_id:id}) .update({_id:id},{status:status}) .exec(function(e,dt){ if(e){ d.reject(e);return; } d.resolve(dt); }); return d.promise; }); Added Q dependency so I can return a promise that doesn't require me to change the calling code.
score: 0

http://stackoverflow.com/comment/45091050
type: AnswerComment
has text: Thanks hwnd! May I ask why the second replace is necessary? I see the issue, but I'm wondering if we can get it to not add the < after the trailing tick.
type: Comment
comment on: http://stackoverflow.com/a/28375319
score: 0

http://stackoverflow.com/comment/45076462
score: 3
has text: Why the slashes? It's interpreted as a RegEx, and RegExes cannot be parsed in JSON.
comment on: http://stackoverflow.com/q/28367765
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45095589
comment on: http://stackoverflow.com/a/28377443
type: Comment
has text: @Himmel - Do you realize that you can upvote all answers that are providing helpful info? And, I assume you know that if one solves your problem, you can/should select a "best answer" by clicking the green checkmark to the left of that answer. Further [info](http://stackoverflow.com/help/privileges/vote-up) on upvoting.
score: 0
type: AnswerComment

http://stackoverflow.com/q/28295056
downvote count: 0
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/28298470
has body: As I know appendRow(rowContents) add values to the bottom of the spreadsheet But how to add data from form in multiple rows in top of spreadsheet? So if in form i have rows first, surname, name second, surname, name third, surname, name in sheet it must be placed as, and each time to the top so if another time in form will be fourth, surname, name fifth, surname, name six, surname, name data will be added like Now I using this code, but it append all data to the end and works only with one row, i think i must loop throught all rows in form but how to do that? function getValuesFromForm(form){ var firstName = form.firstName, lastName = form.lastName, order = form.order, sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); sheet.appendRow([order,lastName,firstName]); }
upvote count: 11
has answer: http://stackoverflow.com/a/28298470
score: 11
type: AnsweredQuestion
type: Question
tagged with: google-apps-script
has title: Google apps script AppendRow to the top
tagged with: google-sheets
answer count: 1

http://stackoverflow.com/q/28301878
favorite count: 0
tagged with: c++
answer count: 0
has comment: http://stackoverflow.com/comment/44955744
type: UnansweredQuestion
upvote count: 1
has title: How to catch First-chance exception Js::JavascriptExceptionObject
score: 1
type: Question
downvote count: 0
tagged with: javascript
tagged with: exception
has comment: http://stackoverflow.com/comment/44955258
has body: We have a hybrid Windows app with a C++ core and JavaScript layer with an HTML front end. On startup, I see a whole bunch of exceptions in the output window (of VS2013). Like this: First-chance exception at 0x756BC42D in SDKLauncher-Win.exe: Microsoft C++ exception: Js::JavascriptExceptionObject at memory location 0x0043D20C. I see no additional info about the exception. The exception appears to happen at the same address each time (in this case 0x756BC42D) but the memory object address is different. But when I examine that memory (0x756BC42D), there is not discernible code (at least not by the time I can pause the debugger and look). However, I cannot seem to catch these exceptions to see what they are. I am breaking in another instance of Visual Studio and turning on ALL JavaScript exceptions before they are thrown but neither instance of VS the native or JS ever catches the exceptions. The app SEEMS to work OK despite these, but I don't like unexplained exceptions. Any suggestions on how to catch these exceptions?

http://stackoverflow.com/comment/45023119
comment on: http://stackoverflow.com/a/28338263
score: 0
type: Comment
has text: i removed the points in onend,and in onmove,i modified transform to mstransform but still it doesnot work in ie9.
type: AnswerComment

http://stackoverflow.com/q/28316764
has answer: http://stackoverflow.com/a/28324363
type: Question
has body: I am creating a SAPUI5 VBox with forms and form containers being able to print the data. As the binding and the creation of the forms happen asynchronously, I am not able to capture the event when the forms have been rendered completely. I tried onAfterRendering of the VBox but this was triggered too early. So I made an ugly hack and attached an onAfterRendering event to the last form I create. This seems to work well, though. createContent: function(oController) { var that = this; this.addEventDelegate({ onBeforeShow: function(oEvent) { // load data } }); this.oVBox = new sap.m.VBox("vbox"); this.oVBox.setModel(this.oModel); this.bFirst = true; this.oVBox.bindAggregation("items", { path: "/", factory: function(siD, oContext) { // create form and set binding context // ugly hack: if (that.bFirst === true) { that.bFirst = false; oForm.onAfterRendering = function() { that._onAfterFormRendering(); } } return oForm; } }); // default is read only this.oPage = new sap.m.Page({ content: [ this.oVBox ] }); return this.oPage; }, _onAfterFormRendering: function() { this.oPage.setBusy(false); // handle printing } Any idea? Thanks
has title: SAPUI5: Get event when form has been fully rendered
answer count: 1
tagged with: javascript
score: 0
tagged with: events
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44984360
tagged with: sapui5

http://stackoverflow.com/comment/45182085
has text: Using string is the problem here. ajax call returns a string, but highchart is not accepting string. what is the data type that i need to convert my data variable. please have a look at this for highchart data types. http://api.highcharts.com/highcharts#series
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28423730
score: 0

http://stackoverflow.com/comment/45007573
type: AnswerComment
comment on: http://stackoverflow.com/a/28328603
type: Comment
has text: Of course it works. Run the code snippet in my answer if you don't believe it.
score: 0

http://stackoverflow.com/comment/45008008
type: QuestionComment
comment on: http://stackoverflow.com/q/28330141
has text: I have just before the close body tag. I've tried it with and without the quotes. faith_boosters_map is the name of the image map. It's not working though.
score: 0
type: Comment

http://stackoverflow.com/comment/45185794
comment on: http://stackoverflow.com/q/28426548
has text: @DonJuwe the redirection is working fine. But the getdetailsbyspider is not able to access. Getting problem in the controller level i hope
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44942257
score: 0
type: Comment
type: QuestionComment
has text: JAVASCRIPT can not read file, what you need to do is, you should make one request to server, which will read your file content and return as a JSON, then you've already coded it to parse that JSON.
comment on: http://stackoverflow.com/q/28294806

http://stackoverflow.com/a/28392249
score: 0
has body: First, you don't use any client side scripting (i.e. javascriptvin a browser) for security. Ever. Next, don't save your password plaintext in a txt. If you really want to create a secure login, try out an .htaccess (see this question Password protecting a directory and all of it&#39;s subfolders using .htaccess ) or a php form. I think an .htaccess would suit you better, as it's much easier to setup and doesn't require any coding.
type: Answer
answers question: http://stackoverflow.com/q/28391447

http://stackoverflow.com/q/28396079
tagged with: http://stackoverflow.com/tag/html
has body: I'm making a small page that has 3 sections. While 1 section is showing the others are hidden. When the page loads the welcome section is displayed, while the other sections are set to display:none. Clicking the menu button for the other pages shows the desired section and hides all the others; I am using jQuery to do that. Unfortunately, now I come across the problem that I'm unable to make a url to go to the specific section. Usually, to go to a section of a page that is not hidden, I would just create an anchor and name is XXX, and then add #XXX at the end of that page's url, but doing this on a hidden div doesn't make the div show. Any suggestions? html: Home Page 1 Page 2 Welcome! This is where all the home page stuff will go Page 1 Page 1 content here Page 2 Page 2 content here css: #page1 { display:none; } #page2 { display:none; } js: $(document).ready(function(){ $('#menu-home).click(function(){ $('#home').show('fast'); $('#page1').hide('fast'); $('#page2').hide('fast'); }); $('#menu-page1).click(function(){ $('#page1').show('fast'); $('#home').hide('fast'); $('#page2').hide('fast'); }); $('#menu-page2).click(function(){ $('#page2').show('fast'); $('#home').hide('fast'); $('#page1').hide('fast'); }); });
tagged with: css
has title: How to show hidden div using url
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28396577
has comment: http://stackoverflow.com/comment/45129638
type: Question
has comment: http://stackoverflow.com/comment/45128607
tagged with: javascript
score: -1
answer count: 2
downvote count: 2
upvote count: 1
possible better answer: http://stackoverflow.com/a/28396577
has comment: http://stackoverflow.com/comment/45128778
has answer: http://stackoverflow.com/a/28396527
accepted answer: http://stackoverflow.com/a/28396527
has comment: http://stackoverflow.com/comment/45128209
tagged with: jquery
favorite count: 0

http://stackoverflow.com/a/28435429
type: Answer
has comment: http://stackoverflow.com/comment/117677925
downvote count: 0
score: 7
has body: I agree with CBroe , I'm not sure you can use HTML5 form validation without a actual form.. I've found this link and it should be of some use to you: https://stackoverflow.com/a/7562439/4092442 You can't trigger the native validation UI, but you can easily take advantage of the validation API on arbitrary input elements: $('input').blur(function(event) { event.target.checkValidity(); }).bind('invalid', function(event) { setTimeout(function() { $(event.target).focus();}, 50); }); The first event fires checkValidity on every input element as soon as it loses focus, if the element is invalid then the corresponding event will be fired and trapped by the second event handler. This one sets the focus back to the element, but that could be quite annoying, I assume you have a better solution for notifying about the errors. Here's a working example of my code above. If that does not help, perhaps you can get creative and create a form, that doesn't look like a form. Hide the submit button etc. That way you can take advantage of the functionality. Also, maybe provide a little more explanation as to what it is you're trying to accomplish. I have personally found that helps people offer detailed solutions. Solutions I often never even considered. :) Hope this helps!
answers question: http://stackoverflow.com/q/28426449
upvote count: 7
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28426449

http://stackoverflow.com/q/28393598
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28393618
has answer: http://stackoverflow.com/a/28393618
accepted answer: http://stackoverflow.com/a/28393635
type: AnsweredQuestion
score: 0
has body: Is there a way to change the class name from &lt;tr&gt;? For example: This will get hidden tr from the table. var templateTR = $("item-row-template"); I want to add templateTR at the bottom of &lt;table&gt;: $('table tr:last').after(templateTR); Once it has been added at the end of the table, it need to replace "item-row-template" to item-row? or what is better approach?
type: Question
has title: Replacing Class name after using after()?
tagged with: javascript
has answer: http://stackoverflow.com/a/28393635
answer count: 2

http://stackoverflow.com/q/28413340
downvote count: 0
tagged with: javascript
has body: I am attempting to make a little application where multiple people can move a square around with their arrow keys with the help of Socket.IO. For my backend I am using Sails.JS and on frontend mostly Angular. Backend: var remotePlayers = []; var findPlayerById = {}; var Player; function LocalPlayer(x, y, id) { this.x = x; this.y = y; this.id = id; } socket.on('new player', function(data) { // data = user.id; socket.id = data; LocalPlayer = new LocalPlayer(defaultX,defaultY, socket.id); remotePlayers.push(LocalPlayer); for (var i = 0; i &lt; remotePlayers.length; i++) { findPlayerById[remotePlayers[i].id] = remotePlayers[i]; }; Player = findPlayerById[socket.id]; console.log(Player); // Emit to all clients sails.sockets.blast('player joined', remotePlayers); }) What I am trying to do here is when the 'new player' emit is triggered, I want to save that player to my a Array(remotePlayers). Then I want to emit that Array back to the client, so the client can draw all the players. On the client side I have a switch case where I check what key was pressed, I emit this keyValue and a userId to the Server. Server then make sure the move is valid, does some calculations and returns the updated position of the Player. socket.on('move player', function updatePlayerPosition(data) { // data = Key and userId switch(data.key) { case 37: // Some checks here then set new value Player.x = Player.x - 10; sails.sockets.blast('player moved', remotePlayers); break; case 38: Then after I have emitted 'player moved', I want my client to draw and display the updated position of the Player. Client: SocketService.on('player joined', function(data) { // data = {x: 50, y:50, id: 'random string'} draw(data); }) function draw(data) { ctx.clearRect(0, 0, HEIGHT, WIDTH); for (var i = 0; i &lt; data.length; i++) { // data[i].x = 30 ctx.fillStyle = 'black'; ctx.fillRect(data[i].x, data[i].y, 20, 20); }; } Problem: When I open two browsers and try to move my Player(rectangle) it always selects the sam…
favorite count: 0
tagged with: angularjs
answer count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: node.js
has title: HTML5 - Socket.IO & Canvas
score: 1
tagged with: socket.io
type: Question
tagged with: sails.js

http://stackoverflow.com/a/28307424
has comment: http://stackoverflow.com/comment/45003721
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28304336
answers question: http://stackoverflow.com/q/28304336
type: AcceptedAnswer
downvote count: 0
has body: Considering the fact that this is very easy doable with CSS and that you probably want to style the box anyways, I would not recommend using somthing external here. You just need to set the div which contains to position: fixed and then you can control where it appears with bottom: 0 and right: 0 to put it in the bottom right corner for example. Then give it a z-index: 100 for example and you are done with a basic overlay.
score: 3
type: Answer

http://stackoverflow.com/q/28404269
tagged with: http://stackoverflow.com/tag/html
tagged with: firefox-addon-sdk
favorite count: 0
accepted answer: http://stackoverflow.com/a/28413893
has title: Block "Would you like to remember this password ?" popup in firefox
score: 2
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/28413893
type: Question
answer count: 2
tagged with: firefox
tagged with: javascript
possible better answer: http://stackoverflow.com/a/34491448
upvote count: 2
has answer: http://stackoverflow.com/a/34491448
has body: i am creating a firefox addon using sdk and i would like to know if there is any way to block the "Would you like to remember this password ?" popup shown by firefox password manager when logging into a website. I have tried "autocomplete" attribute but it looks like firefox has stopped supporting it from version 30. It should not show up while logging in to a website. Please advice.
tagged with: firefox-addon

http://stackoverflow.com/comment/45114059
type: QuestionComment
has text: This is the URL when passed to the next page, I need the selected sub_cat NOTICE it doesn't even say sub_cat=
comment on: http://stackoverflow.com/q/28388227
score: 0
type: Comment

http://stackoverflow.com/q/28393684
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/45127625
type: Question
has comment: http://stackoverflow.com/comment/45129061
tagged with: udp
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45128194
has comment: http://stackoverflow.com/comment/45127655
tagged with: google-chrome-app
tagged with: sockets
has body: I am creating a chrome app (packaged) and I have to create a UDP socket and listen for the incoming broadcast messages as soon as chrome browser starts up. Everything works fine as I start browser , I get the callback registered through chrome.sockets.udp.onReceive.addListener() API and the data as well. The problem starts when the event page is unloaded (after about 10-15 secs). Any new UDP packets are not received. But as seen in Chrome Apps &amp; Extensions Developer Tool , onReceive callback triggered once even after the event page is unloaded (but not for subsequent UDP packets),but it doesn't hit my callback function. And I have kept the persistent flag true while creating the UDP socket. Here is the manifest of my app: { "manifest_version": 2, "name": "App Name", "description": "Description", "version": "1.0", "app": { "background": { "scripts": ["socket.js","eventPage.js"], "persistent": true } }, "sockets":{ "udp": {"send":["*:*"], "bind":["*:*"]} }, "permissions":["system.network","notifications"] } Event page and socket code: // eventPage.js chrome.runtime.onStartup.addListener(function() { console.log("I started up!"); socket.cleanup_create(); }); chrome.runtime.onSuspend.addListener(function() { console.log("I am being suspended!"); }); // socket.js function show(jsontext) { var json_object = JSON.parse(jsontext); console.log(json_object.TitleText); console.log(json_object.MainText); chrome.notifications.create("", {type:'basic',iconUrl:'icon.png',title:json_object.TitleText,message:json_object.MainText}, function callback(){}) } var socket = { socketId:null, /*==========Receive Callback=================*/ recieve_callback:function(rc){ console.log("Received on socket ID "+rc.socketId); var dataView = new DataView(rc.data); var decoder = new TextDecoder("utf-8"); var decodedString = decoder.decode(dataView); console.log("Data Received and it is "+decodedString); show(decodedString); }, /*==========Receive Error Callback=================*/ recieve_error_…
accepted answer: http://stackoverflow.com/a/28396535
downvote count: 0
has comment: http://stackoverflow.com/comment/45124522
has title: Not getting onReceive callback for UDP socket on chrome after event page is unloaded
tagged with: google-chrome
has answer: http://stackoverflow.com/a/28396535

http://stackoverflow.com/comment/45084073
has text: I just tried it, actually I see my model in `console.log(this)` but I dont know how to access it.
comment on: http://stackoverflow.com/a/28371735
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28339907
has answer: http://stackoverflow.com/a/28340652
favorite count: 0
type: Question
upvote count: 2
possible better answer: http://stackoverflow.com/a/28342883
answer count: 2
has answer: http://stackoverflow.com/a/28342883
has body: I have FF extension where on showing panel event focus automatically should be on text input field parameter. I am using on("show", function()) (in scrip.js) for that, but no matter what I insert into this function it doesn't work. Any suggestions? main.js: var panel = panels.Panel({ contentURL: self.data.url("index.html"), contentScriptFile: self.data.url("script.js"), onHide: handleHide, width: 250, height: 200 }); function handleChange(state) { if (state.checked) { panel.show({ position: button }); } } script.js: self.port.on("show", function onShow() { document.getElementById("parameter").focus(); });
accepted answer: http://stackoverflow.com/a/28340652
downvote count: 0
tagged with: javascript
tagged with: firefox-addon
score: 2
type: AnsweredQuestion
has title: on("show", function()) doesn't work in FF extension

http://stackoverflow.com/comment/77308205
has text: Possible duplicate of [How to get HTML5 canvas text to show html entity?](https://stackoverflow.com/questions/2653877/how-to-get-html5-canvas-text-to-show-html-entity)
comment on: http://stackoverflow.com/q/28309478
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/97284329
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28421598
has text: The `input` Event is a better option. It's faster. I posted an answer below

http://stackoverflow.com/comment/44984832
type: Comment
comment on: http://stackoverflow.com/q/28317884
score: 2
has text: You can see in Chrome dev tools (network), are this two request async, or sync. I think that your solution with 5 sec dose not work)
type: QuestionComment

http://stackoverflow.com/q/28428322
has body: I'm currently using Meteor + materializecss package for my project. I've got a navigation with a collapsible item (for each term) and a collapsible for all my subjects (in school) divided by terms. Somehow the collapsible isn't working well. I couldn't figure out why and how to fix this. a demo is here: http://marky.meteor.com I got following html code for the navigation: {{pageTitle}} Dashboard Account Your grades {{#each terms}} {{term}} {{/each}} and the javascript file: Template.navigation.rendered = function () { $('.collapsible').collapsible({ accordion : false }); } for the termlist with the subjects I got this: {{#each modules}} {{> moduleItem}} {{/each}} js: Template.termList.rendered = function(){ $('.collapsible').collapsible({ accordion : false }); } if someone needs the whole code, I can publish my git project. Greetings
type: UnansweredQuestion
has title: meteor and collapsible not working
score: 0
type: Question
answer count: 1
tagged with: javascript
tagged with: materialize
tagged with: meteor
has answer: http://stackoverflow.com/a/28434831

http://stackoverflow.com/a/28367429
has body: From JQuery docs on replaceWith(): The .replaceWith() method removes content from the DOM and inserts new content in its place with a single call. So, you'll have to add the content manually on each interation of the replace: var $window = $(window); var windowsize = $window.width(); function wrapContent(){ if (windowsize < 800) { $('.pick-country > span').each(function () { $(this).replaceWith(' '+ $(this).html() +' '); }); $('.pick-country > option').wrapAll(' '); } } wrapContent(); $(window).resize(wrapContent); PICK A COUNTRY London Cape Town Beijing Tokyo Hong Kong Kuala Lumpur Singapore Mumbai Shanghai Sydney St. Petersburg São Paulo San Francisco Dallas New York Dubai
downvote count: 0
has comment: http://stackoverflow.com/comment/45076001
has comment: http://stackoverflow.com/comment/45075980
has comment: http://stackoverflow.com/comment/45075978
has comment: http://stackoverflow.com/comment/45076093
type: Answer
answers question: http://stackoverflow.com/q/28367354
score: 2
upvote count: 2

http://stackoverflow.com/a/28348724
type: Answer
score: 1
upvote count: 1
has body: The content type shown is the type of the response the server is sending you, not the type of request you are sending to the server.
downvote count: 0
answers question: http://stackoverflow.com/q/28348632

http://stackoverflow.com/q/28391448
type: AnsweredQuestion
has body: arraytest.html &lt;script src="https://code.jquery.com/jquery-1.11.2.min.js"&gt;&lt;/script&gt; &lt;input type="button" id="btn" value="go to php" onclick="show()"&gt; &lt;br&gt;&lt;br&gt; &lt;script type="text/javascript"&gt; var a = new Array(6,5); function show(){ $.ajax({ type: "POST", url: "arra.php", data: {test : JSON.stringify(a)}, success: function(data) { alert("success" +data); } }); } &lt;/script&gt; arra.php &lt;?php $arr = json_decode($_POST['test'], true); $v = $arr[0] + arr[1] ; echo $v ; ?&gt; i couldn't add the array values in php file. anybody could help me with this ? am getting the error as: Parse error: syntax error,unexpected '[' in c:\wamp\www\arra.php on line 3
has answer: http://stackoverflow.com/a/28391465
accepted answer: http://stackoverflow.com/a/28391513
tagged with: php
has comment: http://stackoverflow.com/comment/45120209
type: Question
has comment: http://stackoverflow.com/comment/45120563
possible better answer: http://stackoverflow.com/a/28391465
has answer: http://stackoverflow.com/a/28391513
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45120324
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/45120128
has comment: http://stackoverflow.com/comment/45120230
has title: post values from javascript to php and add those values in php
has comment: http://stackoverflow.com/comment/45120532
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45120352

http://stackoverflow.com/comment/45401694
score: 1
has text: Wow, man, this is really comprehensive information for this question.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28517679

http://stackoverflow.com/a/28366618
score: 2
downvote count: 0
has body: Does obj1 and obj2 in the Ruby code each own a copy of the some_method method? Or is it similar to JavaScript where both objects have access to some_method via another object (in this case, via the Child class)? You don't know. The Ruby Language Specification simply says "if you do this, that happens". It does, however, not prescribe a particular way of making that happen. Every Ruby implementation is free to implement it in the way it sees fit, as long as the results match those of the spec, the spec doesn't care how those results were obtained. You can't tell. If the implementation maintains proper abstraction, it will be impossible for you to tell how they do it. That is just the nature of abstraction. (It is, in fact, pretty much the definition of abstraction.) Similarly, when inheritance is taken into account in Ruby, does each Ruby object have a copy of all of the class and superclass methods of the same name? Same as above. There are a lot of Ruby implementations currently, and there have been even more in the past, in various stages of (in)completeness. Some of those implement(ed) their own object models (e.g. MRI, YARV, Rubinius, MRuby, Topaz, tinyrb, RubyGoLightly), some sit on top of an existing object model into which they are trying to fit (e.g. XRuby and JRuby on Java, Ruby.NET and IronRuby on the CLI, SmallRuby, smalltalk.rb, Alumina, and MagLev on Smalltalk, MacRuby and RubyMotion on Objective-C/Cocoa, Cardinal on Parrot, Red Sun on ActionScript/Flash, BlueRuby on SAP/ABAP, HotRuby and Opal.rb on ECMAScript) Who is to say that all of those implementations work exactly the same? My gut tells me that Ruby objects DO NOT have separate copies of the methods inherited from their class, mixed-in modules, and superclasses. Instead, my gut is that Ruby handles method lookup similarly to JavaScript, where objects check if the object itself has the method and if not, it looks up the method in the object's class, mixed-in modules, and superclasses until the loo…
answers question: http://stackoverflow.com/q/28359048
has comment: http://stackoverflow.com/comment/45082229
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28359048
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/a/28326641
has body: To gain more reliability you could use multiple APIs. As soon as one of them does not respond within a given timeout you switch to another API. Here is an overview of IP 2 Location APIs: https://github.com/tokkonopapa/WordPress-IP-Geo-Block/blob/6d883a71b7787e2c68e28f43f6afbaffdb27c679/README.md#attribution Another possibility would be to keep a local copy of the MaxMind GeoLite database and get your results from this database instead of an API. You'll find more information on this here: http://dev.maxmind.com/geoip/geoip2/downloadable/#MaxMind_APIs And last but not least you can setup your own API. Various APIs like freegeoip.net or my own geoip.nekudo.com are open source so you can host your own copy.
answers question: http://stackoverflow.com/q/28292367
downvote count: 0
has comment: http://stackoverflow.com/comment/45018807
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/a/28301813
answers question: http://stackoverflow.com/q/28301428
type: Answer
score: 0
has body: Why don't you try debugging your code before doing any complicated logic with it? Just after echoing your array try the following at the top of your javascript: if(county_med_month.length &gt; 0) console.log("The array was created!, the problem was with my JavaScript code!"); And by the way you don't access an array value with dot notation var a=county_med_month.c; Should have red var a=county_med_month[c];

http://stackoverflow.com/comment/45479739
score: 0
has text: Asking for libraries is typically offtopic on SO.
comment on: http://stackoverflow.com/q/28310185
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28333349
type: Answer
answers question: http://stackoverflow.com/q/28333327
has comment: http://stackoverflow.com/comment/45014340
has comment: http://stackoverflow.com/comment/45014968
score: 1
has comment: http://stackoverflow.com/comment/45013585
has comment: http://stackoverflow.com/comment/45013616
upvote count: 1
has comment: http://stackoverflow.com/comment/45014310
downvote count: 0
has body: EDIT - Solution without adding wrapping element Doing this without a wrapping element is quite a hassle. I managed to get it to work, however this will only work for one liners that are centered vertically AND horizontally. To see the HTML and CSS that goes along with this, see the jsFiddle: http://jsfiddle.net/v8jbsu3m/3/ jQuery('#bigDiv').click(function(e) { // Get the x and y offest from the window margin_top = jQuery(this).offset().top; margin_left = jQuery(this).offset().left; // Get the dimensions of the element. height = jQuery(this).height(); width = jQuery(this).width(); // Retrieve the font_size and remove the px addition font_size = parseInt(jQuery(this).css('font-size').replace('px', '')); // Retrieve the position of the click click_x = e.pageX; click_y = e.pageY; // These variables will be used to validate the end result var in_text_y = false; var in_text_x = false; // Determine the click relative to the clicked element relative_x = click_x - margin_left; relative_y = click_y - margin_top; // Determine whether the y-coordinate of the click was in the text if (relative_y >= (parseFloat(height) / 2) - (parseFloat(font_size) / 2) && relative_y <= (parseFloat(height) / 2) + (parseFloat(font_size) / 2)) in_text_y = true; // This piece of code copies the string and places it in a invisible div // If this div has the same font styling and no paddings etc... it can // be used to get the width of the text text = jQuery(this).text(); text_width = jQuery('#widthTester').html(text).width(); // Determine whether the x-coordinate of the click was in the text if (relative_x >= (parseFloat(width) / 2) - (parseFloat(text_width) / 2) && relative_x < (parseFloat(width) / 2) + (parseFloat(text_width) / 2)) in_text_x = true; // If the x and y coordinates were both in the text then take action if (in_text_x && in_text_y) alert('You clicked the text!'); }); Also, this code can be optimized, since the same calculcation is done multiple times, but I thought that leaving the cal…
has comment: http://stackoverflow.com/comment/45013581

http://stackoverflow.com/comment/45106367
type: QuestionComment
comment on: http://stackoverflow.com/q/28384240
has text: If the `error` parameter is non-null, then that means that whatever it is that you attempted to do failed for some reason. You shouldn't ignore it.
score: 0
type: Comment

http://stackoverflow.com/q/28394097
has comment: http://stackoverflow.com/comment/45982456
has comment: http://stackoverflow.com/comment/47708320
has comment: http://stackoverflow.com/comment/46266713
has comment: http://stackoverflow.com/comment/45124884
has answer: http://stackoverflow.com/a/28394704
has answer: http://stackoverflow.com/a/29716631
answer count: 3
upvote count: 7
has comment: http://stackoverflow.com/comment/45486703
has comment: http://stackoverflow.com/comment/47650141
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/37320823
tagged with: css
has body: Google recommends (https://developers.google.com/speed/docs/insights/OptimizeCSSDelivery) using following JS code to optimize page speed (async CSS loading) &lt;script&gt; var cb = function() { var l = document.createElement('link'); l.rel = 'stylesheet'; l.href = 'small.css'; var h = document.getElementsByTagName('head')[0]; h.parentNode.insertBefore(l, h); }; var raf = requestAnimationFrame || mozRequestAnimationFrame || webkitRequestAnimationFrame || msRequestAnimationFrame; if (raf) raf(cb); else window.addEventListener('load', cb); &lt;/script&gt; When I use the code above, Page Speed Insights (https://developers.google.com/speed/pagespeed/insights/) recognizes it and gives the page higher score. But the problem is, that this code does not work in older IEs. For example, IE 8 throws an error "Object requestAnimationFrame is not defined". The problem is obvious, IE 8 does not support RAF, so it throws an error because of undefined object. I need the website to be functional also in these older IEs, so I decided to update my code as following: &lt;script&gt; function loadCss() { var l = document.createElement('link'); l.href = 'http://static.xyz.com/css/style.min.css?v=23'; l.rel = 'stylesheet'; l.type = 'text/css'; l.media = 'screen'; document.getElementsByTagName('head')[0].appendChild(l); } if (typeof requestAnimationFrame === 'function') { requestAnimationFrame(loadCss); } else if (typeof mozRequestAnimationFrame === 'function') { mozRequestAnimationFrame(loadCss); } else if (typeof webkitRequestAnimationFrame === 'function') { webkitRequestAnimationFrame(loadCss); } else if (typeof msRequestAnimationFrame === 'function') { msRequestAnimationFrame(loadCss); } else if (typeof window.addEventListener === 'function') { window.addEventListener('load', loadCss); } else { window.onload = loadCss; } This code is not so pretty, but it works properly in IE7+, Firefox, Chrome etc. But when I test it via Page Speed Insights, it does not recognize that the CSS is loaded …
has title: Async loading CSS stylesheet using requestAnimationFrame
downvote count: 0
tagged with: pagespeed
has comment: http://stackoverflow.com/comment/45124956
score: 7
type: Question
tagged with: javascript

http://stackoverflow.com/comment/45144795
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28400703
has text: That pattern is nice, thanks. Returning the constructor function as closure from an IIFE never occured to me. But do I need the `privates` parameter? Couldn't I just define privates in the IIFE? To clarify the privates don't hold constant values. They are initialized when creating an instance and will most likely differ with each instance. Once the instance is created they should not be changed though.
type: AnswerComment

http://stackoverflow.com/q/28287425
type: UnansweredQuestion
type: Question
tagged with: gwt
tagged with: java
tagged with: eclipse
has answer: http://stackoverflow.com/a/28293981
has title: SuperDevMode with dependent Project Source
score: 0
answer count: 1
tagged with: javascript
has body: I have a GWT project called ProjectAwhich is a simple web application project generated with the GWT eclipse plugin. Also, I have second project (projectB) which is a pure Java project with the following structure src/com/test/shared/TestClass.java src/com/test/Shared.gwt.xml Shared.gwt.xml lokes like this: &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;module rename-to='shared'&gt; &lt;inherits name='com.google.gwt.user.User'/&gt; &lt;source path='shared'/&gt; &lt;/module&gt; TestClass.java is: public class TestClass { public static void start() { // do something } } In projectA's gwt.xml I included &lt;inherits name="com.test.Shared" /&gt;. I use TestClass.start() in some method of projectA. I then included projectB in projectA. Therefore I right clicked in projectA >Properties > Java Build Path > Projects and added projectB. I switched to the Order and Export tab and activated the checkmark on projectB. So far so good. When I perform a GWT compile on projectA I get no errors, but when I run projectA in SuperDevMode the compiler prints the following errors: GET /recompile/mobilePhoneGapIOS Job test.mobile.MobilePhoneGapIOS_1_4 starting job: test.mobile.MobilePhoneGapIOS_1_4 binding: mgwt.density=xhigh Compiling module test.mobile.MobilePhoneGapIOS Ignored 1 unit with compilation errors in first pass. Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors. Computing all possible rebind results for 'com.gwtplatform.mvp.client.ApplicationController' Rebinding com.gwtplatform.mvp.client.ApplicationController Invoking generator com.gwtplatform.mvp.rebind.ApplicationControllerGenerator [ERROR] The type 'test.mobile.client.BootstrapperImpl' was not found. [ERROR] Errors in 'gen/com/google/gwt/lang/test_00046mobile_00046MobilePhoneGapIOS__EntryMethodHolder.java' [ERROR] Line 3: Failed to resolve 'com.gwtplatform.mvp.client.ApplicationController' via deferred binding [WARN] For the following type(s), generated source was never committed (did you f…
tagged with: gwt-super-dev-mode

http://stackoverflow.com/comment/45201113
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28435382
has text: Access the php page `/getTableFromDB.php` directly from your browser to see if it outputs what it should output. That way you can tell if there is error in your php script or javascript.

http://stackoverflow.com/a/28335965
has comment: http://stackoverflow.com/comment/45018346
accepted answer of: http://stackoverflow.com/q/28335829
downvote count: 0
has body: You could do something like function myFunction(el) { var div = document.getElementById('showme'); var descval = document.getElementById('descval'); descval.innerHTML = el.value; div.style.display = el.value == 'dress' ? 'block' : 'none'; } #showme { display: none; } &lt;form&gt; &lt;input type="text" id="desc" value="" onKeyUp="myFunction(this)" /&gt; &lt;div id="showme"&gt; &lt;input type="text" value="" /&gt; &lt;input type="text" value="" /&gt; &lt;!-- a span is used here so that there wouldn't be multiple appends --&gt; &lt;span id="descval"&gt;&lt;/span&gt; &lt;/div&gt; &lt;/form&gt;
score: 1
answers question: http://stackoverflow.com/q/28335829
has comment: http://stackoverflow.com/comment/45018474
has comment: http://stackoverflow.com/comment/45018400
has comment: http://stackoverflow.com/comment/45018392
upvote count: 1
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/44930088
score: 1
has text: Put your ` ` **after** the ` ` elements.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28288134

http://stackoverflow.com/q/28394297
tagged with: ajax
type: Question
answer count: 2
score: 0
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/28394332
has answer: http://stackoverflow.com/a/28394417
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
has title: Ajax jquery call to GET application/x-javascript
has body: How do I get content of "application/x-javascript" using jquery Ajax call? As it keep getting me null content. What I am trying to use for now: $.ajax({ dataType: "json", contentType: "application/x-javascript;charset=utf-8", url:the_url, async:false, success:function(r){ console.log("el result" + r) ; response = r; } });

http://stackoverflow.com/a/28391647
answers question: http://stackoverflow.com/q/28391615
score: 0
type: AcceptedAnswer
has body: If you store the start time (as in the actual time of day value the moment the stopwatch was started) in a cookie, then any time you open the page from that browser, you can read the start time from the cookie, get the current time, calculate the elapsed time and show the elapsed time. You can then count up the time from there. It will appear that the timer was running the whole time. A nice feature of doing it this way is that you don't have to store anything when the tab is closed (which is sometimes problematic). Instead, you just store the cookie when the stopwatch is started.
type: Answer
accepted answer of: http://stackoverflow.com/q/28391615

canvas
tags question: http://stackoverflow.com/q/28359966
tags question: http://stackoverflow.com/q/28420231
tags question: http://stackoverflow.com/q/28420190
tags question: http://stackoverflow.com/q/28390481
tags question: http://stackoverflow.com/q/28317197
tags question: http://stackoverflow.com/q/28426989
tags question: http://stackoverflow.com/q/28364546
tags question: http://stackoverflow.com/q/28378740
tags question: http://stackoverflow.com/q/28325325
tags question: http://stackoverflow.com/q/28285443
tags question: http://stackoverflow.com/q/28407641
tags question: http://stackoverflow.com/q/28318875
tags question: http://stackoverflow.com/q/28405643
tags question: http://stackoverflow.com/q/28389799
tags question: http://stackoverflow.com/q/28315011
tags question: http://stackoverflow.com/q/28427434
tags question: http://stackoverflow.com/q/28388068
tags question: http://stackoverflow.com/q/28408173
tags question: http://stackoverflow.com/q/28309478
tags question: http://stackoverflow.com/q/28285233
tags question: http://stackoverflow.com/q/28303692
tags question: http://stackoverflow.com/q/28390062
tags question: http://stackoverflow.com/q/28391701
tags question: http://stackoverflow.com/q/28418409
tags question: http://stackoverflow.com/q/28420724
tags question: http://stackoverflow.com/q/28301286
tags question: http://stackoverflow.com/q/28423690
tags question: http://stackoverflow.com/q/28388801
tags question: http://stackoverflow.com/q/28386502
tags question: http://stackoverflow.com/q/28299050
tags question: http://stackoverflow.com/q/28281637
tag name: canvas
tags question: http://stackoverflow.com/q/28405879
tags question: http://stackoverflow.com/q/28321107
tags question: http://stackoverflow.com/q/28376261
tags question: http://stackoverflow.com/q/28291798
type: Tag
tags question: http://stackoverflow.com/q/28376917
tags question: http://stackoverflow.com/q/28321588
tags question: http://stackoverflow.com/q/28326761
tags question: http://stackoverflow.com/q/28341519
tags question: http://stackoverflow.com/q/28375690
tags question: http://stackoverflow.com/q/28429580
tags question: http://stackoverflow.com/q/28332047
tags question: http://stackoverflow.com/q/28344300
tags question: http://stackoverflow.com/q/28371851
tags question: http://stackoverflow.com/q/28414792
tags question: http://stackoverflow.com/q/28309401
tags question: http://stackoverflow.com/q/28284754
tags question: http://stackoverflow.com/q/28319656
tags question: http://stackoverflow.com/q/28433592
tags question: http://stackoverflow.com/q/28304684
tags question: http://stackoverflow.com/q/28398985
tags question: http://stackoverflow.com/q/28429959
tags question: http://stackoverflow.com/q/28407930
tags question: http://stackoverflow.com/q/28413591
tags question: http://stackoverflow.com/q/28338326
tags question: http://stackoverflow.com/q/28355816
tags question: http://stackoverflow.com/q/28387012
tags question: http://stackoverflow.com/q/28301299

http://stackoverflow.com/comment/49425500
comment on: http://stackoverflow.com/q/28324303
has text: Take a look at how it's done in [Matter.MouseConstraint.update](https://github.com/liabru/matter-js/blob/master/src/constraint/MouseConstraint.js#L82-L108)
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/45047302
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28351709
score: 0
has text: Thanks @AMG. But Iconic is a framework, right? This project is already closed but this new requirement just came in as an update. I don't think it is now feasible to start with a new framework altogether. But I dont know Iconic Framework, if we still can make it work by including just a few lines of Iconic code then a little bit of help with code will be greatly appreciated !

http://stackoverflow.com/comment/44945477
type: Comment
comment on: http://stackoverflow.com/a/28296557
has text: Yes even in picker there is no **startDay** present.
type: AnswerComment
score: 0

http://stackoverflow.com/a/28307172
score: 2
downvote count: 0
has body: If the object is publicly readable, you can import it like any other URL: IMPORTDATA("http://storage.googleapis.com/bucket_name/object_name") The wildcard character, *, won't work, though. IMPORTDATA only accepts a single URL at a time.
upvote count: 2
has comment: http://stackoverflow.com/comment/44980193
has comment: http://stackoverflow.com/comment/44965253
type: Answer
answers question: http://stackoverflow.com/q/28303727

cordova
tags question: http://stackoverflow.com/q/28407141
tags question: http://stackoverflow.com/q/28320640
tags question: http://stackoverflow.com/q/28314724
tags question: http://stackoverflow.com/q/28293656
tags question: http://stackoverflow.com/q/28406806
tags question: http://stackoverflow.com/q/28328452
tags question: http://stackoverflow.com/q/28285100
tags question: http://stackoverflow.com/q/28416895
tags question: http://stackoverflow.com/q/28280287
tags question: http://stackoverflow.com/q/28296948
tags question: http://stackoverflow.com/q/28377138
tags question: http://stackoverflow.com/q/28318391
tags question: http://stackoverflow.com/q/28293297
tags question: http://stackoverflow.com/q/28398104
tags question: http://stackoverflow.com/q/28375536
tags question: http://stackoverflow.com/q/28367884
tags question: http://stackoverflow.com/q/28312817
tags question: http://stackoverflow.com/q/28406168
tags question: http://stackoverflow.com/q/28329585
tags question: http://stackoverflow.com/q/28382047
tags question: http://stackoverflow.com/q/28283481
tags question: http://stackoverflow.com/q/28313579
tags question: http://stackoverflow.com/q/28349760
tags question: http://stackoverflow.com/q/28366062
tags question: http://stackoverflow.com/q/28369123
tags question: http://stackoverflow.com/q/28350584
tags question: http://stackoverflow.com/q/28389912
tags question: http://stackoverflow.com/q/28404948
tags question: http://stackoverflow.com/q/28395461
tags question: http://stackoverflow.com/q/28435612
tags question: http://stackoverflow.com/q/28343124
tags question: http://stackoverflow.com/q/28404019
tags question: http://stackoverflow.com/q/28363666
tag name: cordova
tags question: http://stackoverflow.com/q/28355957
tags question: http://stackoverflow.com/q/28333397
tags question: http://stackoverflow.com/q/28317943
tags question: http://stackoverflow.com/q/28398289
tags question: http://stackoverflow.com/q/28402370
tags question: http://stackoverflow.com/q/28340920
tags question: http://stackoverflow.com/q/28337856
tags question: http://stackoverflow.com/q/28404463
tags question: http://stackoverflow.com/q/28320135
tags question: http://stackoverflow.com/q/28372873
tags question: http://stackoverflow.com/q/28294994
tags question: http://stackoverflow.com/q/28293582
tags question: http://stackoverflow.com/q/28327763
tags question: http://stackoverflow.com/q/28405563
tags question: http://stackoverflow.com/q/28435847
tags question: http://stackoverflow.com/q/28345291
tags question: http://stackoverflow.com/q/28297908
tags question: http://stackoverflow.com/q/28405455
tags question: http://stackoverflow.com/q/28336573
type: Tag
tags question: http://stackoverflow.com/q/28431935
tags question: http://stackoverflow.com/q/28295678

http://stackoverflow.com/comment/45026119
type: QuestionComment
comment on: http://stackoverflow.com/q/28340255
type: Comment
has text: What 'data' output are you getting from server??
score: 0

http://stackoverflow.com/comment/44945812
type: QuestionComment
comment on: http://stackoverflow.com/q/28296656
has text: While what you've shown in valid JavaScript syntax, I wouldn't call it "code." :-) All those expression statements that end up being no-ops...
score: 0
type: Comment

http://stackoverflow.com/comment/69790997
has text: Unofficial draft of Web Speech API does not says anything about filtering or profanity language. Looks like web services implemented it without relying on browser side filtering, and seems like there is no mechanism to pass any parameters to speech api, except the `serviceURI` which could have some arguments in it.
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28399616
type: QuestionComment

http://stackoverflow.com/comment/45040081
score: 0
type: AnswerComment
has text: @Vishnu: Because it wasn't at all clear how or why they were two. The question lacks clarity throughout. The above shows all the fundamentals you need, if you need two arrays, adjust accordingly.
comment on: http://stackoverflow.com/a/28347482
type: Comment

http://stackoverflow.com/comment/45061243
score: 1
has text: Theoretically it might as the number of commands to be executed have been increased. But practically have few hundreds of debugger shouldn't create much impact.
comment on: http://stackoverflow.com/q/28359159
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45092034
type: Comment
type: QuestionComment
has text: @Oriol ok. Then what should be my approach?
score: 0
comment on: http://stackoverflow.com/q/28375676

http://stackoverflow.com/q/28430724
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
type: Question
tagged with: pdf.js
has title: how to open base64 String response from server in external viewer (viewer.html) using pdf.js?
linked to: http://stackoverflow.com/q/24535799
favorite count: 0
upvote count: 2
answer count: 1
has body: In my application i am sending a path to the server and which returns me a pdf file contents in base64 string. Now i want to show this string in external viewer (viewer.html) using pdf.js. I am doing in this in following way, what wrong am i doing? var res="JVBERi0xLjUK..."; // Base64 String from response shortened var pdfData = base64ToUint8Array(res); window.open('pdfJs/viewer.html?file='+pdfData); function base64ToUint8Array(base64) { var raw = atob(base64); //This is a native function that decodes a base64-encoded string. var uint8Array = new Uint8Array(new ArrayBuffer(raw.length)); for(var i = 0; i &lt; raw.length; i++) { uint8Array[i] = raw.charCodeAt(i); } return uint8Array; } Output i am getting now: I have gone through some of answers but cant sort it out. So please help me.
score: 2
has answer: http://stackoverflow.com/a/28460405

http://stackoverflow.com/a/28322236
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44992822
has body: Try this: function myForm() { var theForm = document.getElementById("myCheck"); var a = theForm.elements['check[]']; var checkedCheckboxes = ""; for (var i = 0; i &lt; a.length; i++) { if (a[i].checked) { checkedCheckboxes += a[i].value + ", "; } } if (checkedCheckboxes.length &gt; 0) alert(checkedCheckboxes); return checkedCheckboxes.length &gt; 0; } http://jsfiddle.net/p5upLprk/1/
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28321778

bootbox
tags question: http://stackoverflow.com/q/28299172
type: Tag
tag name: bootbox
tags question: http://stackoverflow.com/q/28397930

http://stackoverflow.com/comment/45143993
has text: Ya I have H264 Codec formatted video it's working fine with all browsers even in IE 9 to 11 .. but only in ie -11.0.15 it is not working. Just audio is playing.
score: 0
comment on: http://stackoverflow.com/q/28404742
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28420122
downvote count: 0
has comment: http://stackoverflow.com/comment/45173617
answers question: http://stackoverflow.com/q/28417831
upvote count: 3
type: Answer
has body: For JavaScript applications (SPAs), you are supposed to use the implicit grant, which does not support refresh tokens. Basically, your users are redirected to the auth server, log in and get the access token. When the access token expires, they need to re-authenticate with the auth server. Since you can't keep secrets in a JavaScript application, there's no client ID or secret: The implicit grant type does not include client authentication, and relies on the presence of the resource owner and the registration of the redirection URI.
score: 3

http://stackoverflow.com/comment/45045332
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28350747
type: Comment
has text: See the added explanation.

http://stackoverflow.com/comment/44944616
has text: What do your error logs say? A Server Error 500 normally means your PHP code is failing.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28295935

http://stackoverflow.com/a/28389845
has body: To get rid of scroll bars, try adding scrolling="no" to the iframe. HTML iframe - disable scroll
answers question: http://stackoverflow.com/q/28389783
type: Answer
score: 5
has comment: http://stackoverflow.com/comment/45117475
upvote count: 6
downvote count: 1

http://stackoverflow.com/q/28346938
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28347804
tagged with: accordion
tagged with: parent
has title: Bootstrap Accordion - Adding and removing parent
type: Question
tagged with: twitter-bootstrap
answer count: 1
score: 0
has body: I have a Bootstrap accordion with about 10 panels. I have a checkbox that needs to accomplish the following: unchecked - all panels get closed and only one panel is shown at a time (ie: a parent is defined so that when one panel opens the other one closes) checked - all panels get opened and act independently (ie: no parent is defined) The documentation doesn't cover such a scenario and I'm not sure how to accomplish this. I've tried the following (using the accordion example shown in the Bootstrap documentation as my HTML code) ... Code that runs when the checkbox gets unchecked: $(".collapse").collapse({ parent: "#accordion", toggle: false }, "hide"); Code the runs when the checkbox gets checked: $(".collapse").collapse({ toggle: false }, "show"); However this doesn't seem to work at all. For example when running the second code to show all the panels nothing changes. I seem to be missing something here.

http://stackoverflow.com/a/28352103
score: 0
type: Answer
has body: The default behavior of a border is to extend the overall dimensions of its element. You can change this default behavior with the following rule: box-sizing: border-box; That css is pretty much intended to resolve exactly this situation.
answers question: http://stackoverflow.com/q/28351980

http://stackoverflow.com/a/28420014
has comment: http://stackoverflow.com/comment/45173370
accepted answer of: http://stackoverflow.com/q/28419873
has comment: http://stackoverflow.com/comment/45204967
has comment: http://stackoverflow.com/comment/45174206
has comment: http://stackoverflow.com/comment/45173197
answers question: http://stackoverflow.com/q/28419873
upvote count: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45206178
has comment: http://stackoverflow.com/comment/45210555
type: Answer
has body: If it's just JavaScript, then you can check for the browser version and run a different function depending on the browser. &lt;script&gt; $(document).ready(navigator.appName == 'Microsoft Internet Explorer' ? function(){ /* IE code */ } : function(){ /* Non-IE code */ }); &lt;/script&gt; Other ways to detect IE: console.log($.browser.msie); console.log('ActiveXObject' in window); console.log(!!window.navigator.userAgent.match(/(MSIE |Trident\/)\d+/));
downvote count: 1
has comment: http://stackoverflow.com/comment/45210091
has comment: http://stackoverflow.com/comment/45209972
score: -1

http://stackoverflow.com/a/28427380
type: Answer
has body: This is a calling to Captain ngModel ;) Just bind your input values: &lt;input id='cheapest' name="cheapest" type='text' value='10' ng-model="cheapest" /&gt; &lt;input id='dearest' name="dearest" type='text' value='5000' ng-model="dearest" /&gt; and pass the value to your filter: &lt;div ng-repeat="offer in offers | filter: minMax('Price', cheapest, dearest) "&gt; or access them via $scope.cheapest in your controller. I am not sure with the syntax though but it will work somehow :)
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28427228
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28427228
score: 1

http://stackoverflow.com/q/28313476
has title: How to use gulp-traceur and gulp-webpack?
has answer: http://stackoverflow.com/a/28313592
favorite count: 0
upvote count: 1
type: AnsweredQuestion
tagged with: traceur
score: 1
accepted answer: http://stackoverflow.com/a/28313592
type: Question
tagged with: ecmascript-6
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: gulp
has body: I'm trying to compile ES6 js files. I use gulp-traceur and gulp-wepback in gulp pipe line. gulp.task('default', function () { return gulp.src('js/app.js') .pipe(traceur()) .pipe(webpack()) .pipe(concat('app.js')) .pipe(rename({suffix: '.min'})) .pipe(uglify()) .pipe(gulp.dest('build/js')); When running gulp. I take error: Unexpected reserved word. You may need an appropriate loader to handle this file type. On the line which contains a "class" word. (ES6 Syntax) I can't figure out how to use these plugins together?

passport.js
tags question: http://stackoverflow.com/q/28292135
tags question: http://stackoverflow.com/q/28346746
tag name: passport.js
tags question: http://stackoverflow.com/q/28405135
tags question: http://stackoverflow.com/q/28393254
type: Tag
tags question: http://stackoverflow.com/q/28354709

http://stackoverflow.com/comment/45201585
has text: Is your click being hijacked by the blockScreen? It may be that you think your clicking a button but it is in fact a div element instead? try removing the show loading call just to test this out.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28435078
type: QuestionComment

http://stackoverflow.com/a/28413585
has comment: http://stackoverflow.com/comment/45183598
has comment: http://stackoverflow.com/comment/45183484
downvote count: 0
score: 1
has body: Each KineticJS object, like the image object, has x,y properties that hold its current location. In recent versions of KineticJS, you can fetch an object's x,y using: var x=myImageObject.x(); var y=myImageObject.y(); Or you can fetch an object containing the current x,y like this: // myXY has x,y properties: myXY.x and myXY.y var myXY=myImageObject.position();
has comment: http://stackoverflow.com/comment/45203412
has comment: http://stackoverflow.com/comment/45185519
upvote count: 1
answers question: http://stackoverflow.com/q/28407930
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28407930
type: Answer

http://stackoverflow.com/comment/44938429
type: QuestionComment
comment on: http://stackoverflow.com/q/28292532
has text: plz suggest me on this issue
score: 0
type: Comment

http://stackoverflow.com/q/28293962
tagged with: indexeddb
tagged with: dexie
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28298487
has body: I need to check if some table already exists into IndexedDB just after it was openned. But I don't know how to get DexieDB object inside 'then' statement. this.db = new Dexie("DBNAME"); if (!this.db.isOpen()) { this.db.open().then(function () { //how to get this.db.table(storeName) here? }).catch(function (error) { console.log(error) }); } So this.db doesn't exist inside 'then' statement. How to get it?
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/28298487
favorite count: 0
tagged with: promise
linked to: http://stackoverflow.com/q/28250680
has title: How to get table after indexedDB was just openned via Dexie.js?
downvote count: 0
score: 1
type: Question
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/20279484

http://stackoverflow.com/comment/45159763
type: AnswerComment
comment on: http://stackoverflow.com/a/28413017
score: 0
type: Comment
has text: @panthro Yes I know, I just think it is important to know what `bind` really does. And also what the problem is ;)

http://stackoverflow.com/comment/45362064
type: AnswerComment
comment on: http://stackoverflow.com/a/28400406
score: 0
type: Comment
has text: HTML5 supports SVG tags, so you could dynamically create them with your JavaScript function. Should be very easy with jQuery. And if svg.js is also an option, I think you could create the SVG using JavaScript and let the svg.js library create the SVG string for you. http://svgjs.com/

http://stackoverflow.com/comment/45059398
comment on: http://stackoverflow.com/a/28324663
score: 0
type: AnswerComment
type: Comment
has text: I have implement first two by using this code $locationProvider.html5Mode(true); $locationProvider.hashPrefix('!');

http://stackoverflow.com/q/28356390
tagged with: kendo-ui
score: 0
has body: I have a kendo ui grid and I add a new row and then I update the new rows values like so... function RespondToRequest(id, sequence) { x = parseInt(sequence) + 1 var grid = $('#ParameterGrid_' + id + '').data("kendoGrid"); grid.addRow(); var tr = $('#ParameterGrid_' + id + ' tr:last'); $('#ParameterGrid_' + id + ' tr:last-child td:nth-child(1)').html(id); $('#ParameterGrid_' + id + ' tr:last-child td:nth-child(1)').val(id); $('#ParameterGrid_' + id + ' tr:last-child td:nth-child(2)').html(x); $('#ParameterGrid_' + id + ' tr:last-child td:nth-child(2)').val(x); $(".k-grid-Accept", "#ParameterGrid_" + id + "").hide(); $(".k-grid-Respond", "#ParameterGrid_" + id + "").hide(); } but when I submit the new row with the updated data... function SuggestNewParameter(id) { var grid = $('#ParameterGrid_2').data("kendoGrid"); grid.saveChanges(); } the 2 values are not updated in the posted model... [AcceptVerbs(HttpVerbs.Post)] public ActionResult ParameterGrid_Create([DataSourceRequest] DataSourceRequest request, RequestParameter requestparameter) { if (requestparameter != null &amp;&amp; ModelState.IsValid) { var new_requestparameter = new RequestParameter { RequestId = requestparameter.RequestId, UserId = 1, //viewmodel.UserId, Sequence = requestparameter.Sequence + 1, Request_Response_Date = DateTime.Now, DateNeeded = requestparameter.DateNeeded, Duration = requestparameter.Duration, Frequency = requestparameter.Frequency, Comments = requestparameter.Comments, IsLatestEntry = true }; db.RequestParameters.Add(new_requestparameter); db.SaveChanges(); } return Json(new[] { requestparameter }.ToDataSourceResult(request, ModelState)); } how do I make the changes I made get caught in the model that is passed back? thanks in advance
has answer: http://stackoverflow.com/a/28373948
type: AnsweredQuestion
tagged with: asp.net-mvc
type: Question
tagged with: c#
answer count: 1
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28373948
has title: Updated Kendo UI Grid values using jQuery does not update the passed back model

http://stackoverflow.com/q/28290422
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/44934477
has answer: http://stackoverflow.com/a/28290493
has body: I cannot figure out why the data is not getting inserted to my mysql database when it is being logged to the console properly. My form as follows: &lt;form id="insertForm" type="post"&gt; name: &lt;input type="text" id="name" name="name"&gt; activity: &lt;input type="text" id="activity" name="activity"&gt; level: &lt;input type="number" id="level" name="level"&gt; &lt;input type="button" name="add" id="add" value="add"&gt; &lt;/form&gt; My ajax call: &lt;script type="text/javascript"&gt; $(document).ready(function() { $("#add").click(function(e){ var Data = $("#insertForm").serializeArray(); console.log(Data); $.ajax({ url : "insert.php", type: "POST", data : Data, success:function(data, textStatus, jqXHR) { $('#msg').html(data); } }); $("#msg").slideDown("slow"); e.preventDefault(); }); }); &lt;/script&gt; My PHP insert: &lt;?php if (!empty($_POST)) { $dbhost = 'localhost'; $dbuser = 'lot_root'; $dbpass = ''; $con = mysql_connect($dbhost, $dbuser, $dbpass); $name = mysql_real_escape_string($_POST['name']); $activity = mysql_real_escape_string($_POST['activity']); $level = $_POST['level']; $sql = "INSERT INTO lottt ". "(name, activity, level) ". "VALUES('$name','$activity', '$level')"; mysql_select_db('lot'); mysql_close($con); } ?&gt; When i insert the data via the input fields it gets logged to the js console fine like so [Object, Object, Object]0: Objectname: "character_name"value: "aSD"__proto__: Object1: Object2: Objectlength: 3__proto__: Array[0] but nothing is inserted into the mysql database after a quick check.
has comment: http://stackoverflow.com/comment/44934543
tagged with: php
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28290493
type: Question
has comment: http://stackoverflow.com/comment/44934565
has title: Ajax request not sending data to php page but logging in console fine
answer count: 1
tagged with: javascript

three.js
tags question: http://stackoverflow.com/q/28373189
tags question: http://stackoverflow.com/q/28311393
tag name: three.js
tags question: http://stackoverflow.com/q/28429579
tags question: http://stackoverflow.com/q/28398498
tags question: http://stackoverflow.com/q/28356118
tags question: http://stackoverflow.com/q/28325153
tags question: http://stackoverflow.com/q/28343612
tags question: http://stackoverflow.com/q/28369417
tags question: http://stackoverflow.com/q/28420708
tags question: http://stackoverflow.com/q/28415594
tags question: http://stackoverflow.com/q/28289132
tags question: http://stackoverflow.com/q/28306643
tags question: http://stackoverflow.com/q/28425982
tags question: http://stackoverflow.com/q/28381750
tags question: http://stackoverflow.com/q/28407710
tags question: http://stackoverflow.com/q/28414530
tags question: http://stackoverflow.com/q/28397857
tags question: http://stackoverflow.com/q/28431969
tags question: http://stackoverflow.com/q/28280266
tags question: http://stackoverflow.com/q/28417150
tags question: http://stackoverflow.com/q/28291911
tags question: http://stackoverflow.com/q/28360253
tags question: http://stackoverflow.com/q/28431494
tags question: http://stackoverflow.com/q/28281170
type: Tag
tags question: http://stackoverflow.com/q/28285573
tags question: http://stackoverflow.com/q/28365948
tags question: http://stackoverflow.com/q/28435308
tags question: http://stackoverflow.com/q/28391394
tags question: http://stackoverflow.com/q/28280235
tags question: http://stackoverflow.com/q/28321947

http://stackoverflow.com/comment/45018478
comment on: http://stackoverflow.com/q/28336080
type: Comment
type: QuestionComment
score: 0
has text: As I said you cannot include JSON files via HTML. However, you don't have JSON, you have JavaScript, so just use a ` ` element.

http://stackoverflow.com/comment/44961314
has text: 1) Where did you put the clearRect call ? Could you add it to your code ? 2) You should ensure your images are loaded before launching your game.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28301299
score: 0

http://stackoverflow.com/a/28327335
has comment: http://stackoverflow.com/comment/45005134
has comment: http://stackoverflow.com/comment/45004403
has comment: http://stackoverflow.com/comment/45004662
has comment: http://stackoverflow.com/comment/45005467
type: AcceptedAnswer
downvote count: 0
has body: add a function to your controller. something like $scope.stripAddr = function(address) { return address.substring(5); } and change your html to &lt;td&gt;{{stripAddr(person.address)}}&lt;/td&gt; please excuse and errors in my javascript I use coffescript all time but I hope you get the idea
type: Answer
score: 6
accepted answer of: http://stackoverflow.com/q/28326921
upvote count: 6
has comment: http://stackoverflow.com/comment/45005648
answers question: http://stackoverflow.com/q/28326921

http://stackoverflow.com/a/28415074
answers question: http://stackoverflow.com/q/28414764
has body: If there is no submit button, then pressing enter will never submit the form. Simply locate your submit button (either the input type="submit" or button) present and change your element to a type of button and assign a click handler to submit the form. &lt;input id="formSubmit" type="button" value="Submit" /&gt; Don't forget, &lt;button&gt; implicitly has a type of submit, so if you use one, make sure that it is type="button" as well. $("#formSubmit").click(function(){ $(this).closest("form").submit() });
score: 0
type: Answer

http://stackoverflow.com/q/28388850
has comment: http://stackoverflow.com/comment/45115686
has answer: http://stackoverflow.com/a/47034912
has comment: http://stackoverflow.com/comment/45116120
has comment: http://stackoverflow.com/comment/45115444
has comment: http://stackoverflow.com/comment/45115255
has comment: http://stackoverflow.com/comment/45123820
favorite count: 0
has comment: http://stackoverflow.com/comment/45122879
upvote count: 5
tagged with: angularjs
type: UnansweredQuestion
tagged with: localforage
has title: How do I assign a variable from localForage as I do in localStorage?
has comment: http://stackoverflow.com/comment/60905425
downvote count: 0
has answer: http://stackoverflow.com/a/31609706
has comment: http://stackoverflow.com/comment/45115327
type: Question
answer count: 2
score: 5
has body: Please help me with the following. I have been converting my AngularJS application from localStorage to localForage. throughout my application I was assigning the localStorage value like this. window.localStorage.setItem('localSavedValue','SavedValue'); and then I was retrieving the data like this, var myValue = window.localStorage.getItem('localSavedValue'); So when I console.log(myValue); // it outputted 'SavedValue' I cannot seem to do this with localForage when I try, $localForage.setItem('localSavedValue','SavedValue'); var myValue = $localForage.getItem('localSavedValue'); console.log(myValue); // returns an object. I don't get the value set to myValue. I am sure this is something do do with promises as when I use the callback I can access the correct 'myValue' however I want to get it out of the call back to use in the rest of the service. Also to note, I am in a service so can't assign to $scope (unless I don't know how). Appreciate any help. Thanks B
tagged with: javascript

http://stackoverflow.com/comment/45002712
has text: No. This stacking is just for display purposes; it has nothing to do with storing images. If you want to save space, you want to look into compression.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28327165

http://stackoverflow.com/comment/45041219
comment on: http://stackoverflow.com/q/28348537
has text: Think about giving a complet base with your html and maybe more JS
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/45067187
has text: No? Don't take a quick-look, read them carefully.
comment on: http://stackoverflow.com/q/28361824
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28435398
score: 3
has comment: http://stackoverflow.com/comment/45201870
upvote count: 3
answers question: http://stackoverflow.com/q/28435262
downvote count: 0
has comment: http://stackoverflow.com/comment/45201540
type: Answer
has body: This is a nice one. It's because your example its so minimal. The browser automatically wraps the Sorry, your browser does not support JavaScript! A browser without support for JavaScript will show the text inside the noscript element.
has comment: http://stackoverflow.com/comment/45200882

http://stackoverflow.com/comment/45056501
type: QuestionComment
has text: on the Blob constructor?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28355830

http://stackoverflow.com/comment/92472655
has text: @kangkyu Except the currently accepted answer spends more time trying to be Ruby-ish than actually giving a javascript answer. It also recommends writing your own wrapper (which *really* isn't necessary) and does so in a potentially harmful way (i.e. extending the prototype for something that isn't a polyfill)
type: AnswerComment
comment on: http://stackoverflow.com/a/34588812
type: Comment
score: 11

http://stackoverflow.com/a/28335197
score: 0
has body: You didn't name it, thus it has no name. foo = function(){ return (arguments.callee.name); }; bar = function foobar() { return (arguments.callee.name); }; function foobar () { return (arguments.callee.name); } console.log(foo()); //"" console.log(bar()); //"foobar" console.log(foobar()) //"foobar" The difference between foo() and foobar() is that foo() is a function expression, whereas foobar() is a declared function. The difference between foo() and bar() and is that one has a name, the other doesn't. Both are function expressions. Declared functions need a name, function expressions do not. See this canonical question for more info: var functionName = function() {} vs function functionName() {}
accepted answer of: http://stackoverflow.com/q/28335109
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28335109
type: Answer

http://stackoverflow.com/comment/45024395
has text: Thanks! I actually did what you describe here except that my second (nested) for loop looked like this `for (k=0;k<playerNumber;k++)` ...and I was getting `TypeError: playersArray[k] is undefined`. From your code I understand that I should have focused on the actual array length rather then on absolute number of players. I also found an alternative solution of the exercise using `if(dealerAssigned && inputDealer=='yes'){alert("already assigned"); playersArray[i] = new player(inputName, 'no');`. Thanks a lot for your time and effort. Your code with all the comments is really helpful.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28338678
score: 0

http://stackoverflow.com/q/28385245
upvote count: 1
type: Question
tagged with: javascript
downvote count: 0
tagged with: meteor
favorite count: 0
linked to: http://stackoverflow.com/q/22521850
tagged with: twitter-bootstrap
has title: Uncaught TypeError: Cannot read property 'offsetWidth' of undefined or No login services configured
type: UnansweredQuestion
has body: I'm trying to make a sample app with meteor together with bootstrap. Unfortunately I get either Uncaught TypeError: Cannot read property 'offsetWidth' after running 'meteor remove insecure autopublish' command in order to work with accounts-ui package - following post Sign In form disappeared? Meteor tutorial. It seems I get either 'No login services configured' message if autopublish+insecure are installed or 'Cannot read property 'offsetWidth' of undefined' in case bootstrap is installed. Needless to say each solution works separately. How do I overcome this weird mutex? Thanks in advance, Igor
answer count: 0
score: 1

http://stackoverflow.com/comment/45002550
score: 0
has text: @xproofx - The Element.getElementsByTagName() method returns a live HTMLCollection of elements with the given tag name. The subtree underneath the specified element is searched, excluding the element itself. The returned list is live, meaning that it updates itself with the DOM tree automatically. See https://developer.mozilla.org/en-US/docs/Web/API/Element.getElementsByTagName
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28327227

encryption
tags question: http://stackoverflow.com/q/28384718
tags question: http://stackoverflow.com/q/28309387
tags question: http://stackoverflow.com/q/28427817
tags question: http://stackoverflow.com/q/28352882
tag name: encryption
tags question: http://stackoverflow.com/q/28291516
tags question: http://stackoverflow.com/q/28280950
tags question: http://stackoverflow.com/q/28387058
tags question: http://stackoverflow.com/q/28384599
tags question: http://stackoverflow.com/q/28342426
tags question: http://stackoverflow.com/q/28364434
type: Tag

http://stackoverflow.com/q/28294145
downvote count: 0
possible better answer: http://stackoverflow.com/a/28294305
favorite count: 0
accepted answer: http://stackoverflow.com/a/28294569
answer count: 5
has answer: http://stackoverflow.com/a/28294616
tagged with: http://stackoverflow.com/tag/html
has title: Navigate through multiple divs using next/prev
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28294569
has answer: http://stackoverflow.com/a/28294763
has answer: http://stackoverflow.com/a/28294305
type: Question
has answer: http://stackoverflow.com/a/28296139
tagged with: javascript
tagged with: jquery
score: 4
upvote count: 4
has body: So basically my DIV will look like this. one two three four next prev SUBMIT This is just an example, I could even have 10 or 20 divs. I want to navigate from one to four in this example. When it reaches end it must hide the next button and show submit button. And when I navigate back to first page it must hide the prev button Here's what I have tried so far: $("#next").click(function () { $("#prev").show(); $("#one").hide(); $("#one").addClass("current"); $(".current").next().addClass("current").show(); $(".current").prev().removeClass("current").hide(); }); $("#prev").click(function () { $("#prev").show(); $("#one").hide(); $("#one").addClass("current"); $(".current").prev().addClass("current").show(); $(".current").next().removeClass("current").hide(); }); This works for certain navigation after that it gets messes up. Some guidance will be helpful to me and others. Thanks JSFIDDLE : http://jsfiddle.net/aVJBY/450/

qunit
tags question: http://stackoverflow.com/q/28304459
type: Tag
tag name: qunit

http://stackoverflow.com/q/28424230
answer count: 2
tagged with: javascript
tagged with: jquery
tagged with: asp.net
has title: Confirm alert when leaving page if form is filled
has comment: http://stackoverflow.com/comment/45181274
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28424424
type: UnansweredQuestion
type: Question
has body: I need help. I want to display confirm alert if user leave page and if form is filled or at least some of the fields on form are filled. I have following code that is functioning in Chrome but not working in Firefox. Also the alert is displayed even when the form fields are empty. Following is my code, $(window).bind('beforeunload', function () { return ''; //Are you sure you want to leave?'; }); So I need help so I can produce alert in Firefox, and all other browsers when form is completely or partially filled but not produce any alert when form is empty. I tried making use of viewstate. Checking if viewstate value is different then produce alert, but it's not working as I expected another piece of code I tried is window.onbeforeunload = function (e) { var message = "Your confirmation message goes here.", e = e || window.event; // For IE and Firefox if (e) { e.returnValue = message; } // For Safari return message; }; But the above code does not check if form is filled or not. I want alert when form is partially or completely filled
has answer: http://stackoverflow.com/a/28425133

http://stackoverflow.com/a/28432825
answers question: http://stackoverflow.com/q/28432350
type: Answer
has body: The touchend event should, logically, have zero touch points, only changedTouches. Here's a demo. function startHandler (e) { window.console.log('Start:', e.originalEvent.touches[0].pageX); } function endHandler (e) { window.console.log('End:', e.originalEvent.changedTouches[0].pageX); } $(document).on('touchstart', '#menu', startHandler); $(document).on('touchend', '#menu', endHandler); See also: Simulating touchstart and touchend events? if you are having trouble testing touch events.
upvote count: 2
score: 2
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28432350

http://stackoverflow.com/comment/45203487
type: QuestionComment
has text: What you are asking for has nothing to do with ES6 classes. In the first case you are declaring the method inside the constructor, in the second case on the prototype. Of course these will yield different results (because lexical scope), but that's independent of ES6 classes. You could also define the method inside `constructor` if you wanted to.
comment on: http://stackoverflow.com/q/28422988
score: 1
type: Comment

http://stackoverflow.com/comment/45027697
comment on: http://stackoverflow.com/q/28340920
score: 1
has text: I don not know how to make exception through javascript but once my application got crashed when i used a style class which is actually written twice in .css.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45114552
type: Comment
comment on: http://stackoverflow.com/a/28387859
has text: try to var_dump the whole array and add some custom data so you know that at least you are receiving it?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45162108
type: QuestionComment
type: Comment
has text: How is "christmas tree effect of calls" (aka [callback hell](http://google.com/search?q=callback+hell)) making the "process not finish before exiting"? Or are they two separate problems?
comment on: http://stackoverflow.com/q/28413820
score: 0

http://stackoverflow.com/q/28318049
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44985434
has comment: http://stackoverflow.com/comment/44985827
answer count: 0
type: Question
has title: Angular binding deosn't update view
has comment: http://stackoverflow.com/comment/44985138
tagged with: javascript
score: 0
has body: In the below scenario An external function is updating the $scope.contacts, before exiting the function I call the $scope.$apply(), since the scope is updated outside AngularJS context. But it still doesn't render the view for me. P.S. In debugging I can see $scope.contacts properly filled with the elements. I am quite new to AngularJS, is that anything I am missing or not doing properly? module.controller('ContactController', function ($scope, $http, $sce) { $scope.contacts = []; ... $scope.load = function () { ... external function(){ ... for(){ var contact = { id: id.slice(id.length-1), Name: fullname, Email: email, Phone: phone }; $scope.contacts.push(contact); } $scope.$apply(); } } }); Any help is appreciated. Thanks in advance

http://stackoverflow.com/q/28360729
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
has title: How to input multiple values into input(textarea) field?
has answer: http://stackoverflow.com/a/28360869
favorite count: 0
tagged with: input
has body: I want to make make suggested text, that a user can click on and create a sentence in a tag. If I have sentences like "my cat is", "my dog is", and "awesome", the user could click them and make sentences like: "my dog is awesome" or "my cat is awesome" depending on which button the user clicks first. But with longer text in the buttons (like sentences). I don't have code yet because I don't know where to start. I only have an image to demonstrate my idea:
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/5324415
downvote count: 0
score: 1
type: Question
tagged with: tags
answer count: 1
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28360869

http://stackoverflow.com/a/28355003
downvote count: 0
has body: It's Catmull-Rom fitting: the code tries to find an appropriate tangent through point X, based on the location of points X-1 and X+1, such that the tangent is parallel to the line (X-1)--(X+1), and then fiddles with the control points that yields, to make sure the "incoming" and "outgoing" tangents yield an aesthetically pleasing curve. have points assume tangent equal to (p-1)--(p+1) that generally looks horrible scale control points a little for better fit How you do step 4 is technically no longer Catmull-Rom, because genuine Catmull-Rom splines stop once the tangent's been set up. The usual approach if you do need a step 4 is to scale the points in based on projected distance: if you project point X on the line (X-1)--(X+1), it'll rarely ever be exactly in the middle of the line, but at some distance v% from point X-1 and distance (100-v)% from point X+1, so you scale the found tangent accordingly.
has comment: http://stackoverflow.com/comment/45617656
has comment: http://stackoverflow.com/comment/45581154
accepted answer of: http://stackoverflow.com/q/28353918
upvote count: 3
answers question: http://stackoverflow.com/q/28353918
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45633633
has comment: http://stackoverflow.com/comment/45585333
type: Answer
has comment: http://stackoverflow.com/comment/45600875
has comment: http://stackoverflow.com/comment/45655803
has comment: http://stackoverflow.com/comment/45617770
score: 3

http://stackoverflow.com/a/28360337
has body: The solution I found is to modify the function _fnCamelToHungarian(). It was was erroring because it was finding the prototype methods in the _hungarianMap and trying to get the charAt[0]. Solved this problem by changing the method to only look at enumerable types using Object.keys(user). The modified part of code is as follows: function _fnCamelToHungarian ( src, user, force ) {... ... ... /** MODIFIED **/ $.each(/user/ Object.keys(user), function (key, val) { hungarianKey = src._hungarianMap[ val ]; ... } ... } Instead of getting object name (user), now we got all its keys in it.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28319654

http://stackoverflow.com/q/28342375
has comment: http://stackoverflow.com/comment/45031778
has answer: http://stackoverflow.com/a/28350741
has title: Best practice for generating html ids with grails
tagged with: gsp
type: Question
has comment: http://stackoverflow.com/comment/45029710
has body: I have a template that could be rendered multiple times within the same view. The template contains a form and I have some jquery event listeners attached to the form elements using the html id. For now I'm using 'g:set' to create an elementId variable at the top of the template using the current time in milliseconds and appending it to each element on the form. This way each form element will have a unique id within the page no matter how many times the same template is rendered. My approach works but it seems to me that there must be a better way to achieve what I want to do? Heres an example of my approach : &lt;g:set var="elementId" value="${'elementId-' + new Date().getTime()}" /&gt; &lt;form&gt; &lt;g:textField id="${elementId}name" name="name"/&gt; &lt;g:textField id="${elementId}address" name="address"/&gt; &lt;/form&gt; &lt;script&gt; $("#${elementId}name").on("click", myFunction()) $("#${elementId}address").on("click", myFunction()) &lt;/script&gt;
tagged with: javascript
has comment: http://stackoverflow.com/comment/45029818
tagged with: grails
score: 0
has comment: http://stackoverflow.com/comment/45029628
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/45029453
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

highcharts
tags question: http://stackoverflow.com/q/28292577
tags question: http://stackoverflow.com/q/28292318
tags question: http://stackoverflow.com/q/28337641
tags question: http://stackoverflow.com/q/28301604
tags question: http://stackoverflow.com/q/28304071
tags question: http://stackoverflow.com/q/28301994
tags question: http://stackoverflow.com/q/28318227
tags question: http://stackoverflow.com/q/28301434
tags question: http://stackoverflow.com/q/28380894
tags question: http://stackoverflow.com/q/28408664
tags question: http://stackoverflow.com/q/28305949
tags question: http://stackoverflow.com/q/28313524
tags question: http://stackoverflow.com/q/28418611
tags question: http://stackoverflow.com/q/28434845
tags question: http://stackoverflow.com/q/28298025
tags question: http://stackoverflow.com/q/28332143
tags question: http://stackoverflow.com/q/28360789
tags question: http://stackoverflow.com/q/28320413
tags question: http://stackoverflow.com/q/28418999
tags question: http://stackoverflow.com/q/28407034
tags question: http://stackoverflow.com/q/28294681
tags question: http://stackoverflow.com/q/28426562
tags question: http://stackoverflow.com/q/28425608
tags question: http://stackoverflow.com/q/28285190
tags question: http://stackoverflow.com/q/28406793
tags question: http://stackoverflow.com/q/28322138
tags question: http://stackoverflow.com/q/28298551
tags question: http://stackoverflow.com/q/28341152
tags question: http://stackoverflow.com/q/28283609
tags question: http://stackoverflow.com/q/28330095
tags question: http://stackoverflow.com/q/28340184
tags question: http://stackoverflow.com/q/28426196
tags question: http://stackoverflow.com/q/28388334
tags question: http://stackoverflow.com/q/28423730
tags question: http://stackoverflow.com/q/28303918
tags question: http://stackoverflow.com/q/28283012
tags question: http://stackoverflow.com/q/28296118
tags question: http://stackoverflow.com/q/28428179
tags question: http://stackoverflow.com/q/28310526
tags question: http://stackoverflow.com/q/28337912
type: Tag
tags question: http://stackoverflow.com/q/28344195
tags question: http://stackoverflow.com/q/28300923
tag name: highcharts
tags question: http://stackoverflow.com/q/28313158

http://stackoverflow.com/q/28386450
type: UnansweredQuestion
has body: This is what I am trying to do: I have an API response that contains a field with names. I am successfully able to get the response but using JavaScript I want to count how many times a name repeats. For example: John John Stefany Steven Steven I want to be able to count that John appears 2 times, Stefany appears 1 time, and Steven appears 2 times. What have I tried so far? $(function () { $.ajax({ url: "API_CALL", dataType: 'jsonp', success: function (results) { var imagesArray = new Array(); var allMedia = results.data._embedded.media; for (var i = 0; i < allMedia.length; i++) { var media1 = allMedia[i]; var imagesHtml = " "; imagesHtml += "{0} ".replace("{0}", media1._embedded.person.name); imagesHtml += " "; imagesArray.push(media1.images.square); $("#list").append(imagesHtml); } var numItems = $('.person_name').length console.log(numItems); } }); });
tagged with: count
has title: How can I count the amount of times a name appears?
has answer: http://stackoverflow.com/a/28386717
score: 1
has comment: http://stackoverflow.com/comment/45110872
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45110713
has answer: http://stackoverflow.com/a/28386695
has comment: http://stackoverflow.com/comment/45110788
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45110791
has comment: http://stackoverflow.com/comment/45110845
answer count: 2
has comment: http://stackoverflow.com/comment/45111018
downvote count: 0
has comment: http://stackoverflow.com/comment/45110815
favorite count: 0
has comment: http://stackoverflow.com/comment/45110859

http://stackoverflow.com/a/44426835
type: Answer
score: 1
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28386534
has body: Is a simple code with javascript to send methods GET,POST,PUT,DELETE declare header: &lt;meta name="csrf-token" content="{{ Session::token() }}"&gt; function addCarrito(Urldir,paramt) { $(function(){ $.post(Urldir,{ _token: $('meta[name=csrf-token]').attr('content'), _method : 'PUT', data : }, function(response){ if(response != '') { console.log('good'); } }); }); }

http://stackoverflow.com/q/28352924
type: Question
has comment: http://stackoverflow.com/comment/45051308
tagged with: javascript
has title: How to promisify your own javascript api which uses another promisified api with Bluebird?
has comment: http://stackoverflow.com/comment/45051896
answer count: 2
has comment: http://stackoverflow.com/comment/45050177
has body: I'm struggling with this a bit. I want to build an abstraction layer over a database driver module in node. I've already promisified the driver module by doing the following: var sql = Promise.promisifyAll(require('sql-driver')); Then within my own js file I want to wrap queries like so: function query(queryString, transaction) { sql.connectAsync(config).then(function() { var req = new sql.Request(transaction); req.queryAsync(queryString).then(function(resultSet)) { console.log(resultSet); }); }); } How can I promisify (using bluebird) so that my query function is also promisified and returns a promise or thenable? Update: I want my wrapper method to also be promisified so that the user can do something like this: var myDbWrapper = require('my-db-wapper'); function getData() { myDbWrapper.startTransaction() .then(function(transaction) { return myDbWrapper.query('select 1 as number', transaction); }) .then(function(resultSet) { console.log(resultSet); }). .catch(function(e) { console.error(e); }); } I'm sure this isn't working code, just trying to convey the idea. Also, this example only shows one query and doesn't show the commit method, which is also part of the wrapper. Can someone show me an example use promises to do a whole transaction with more than one query and then a 'commit' if no errors? Update 2: idbehold's example below won't allow me to do this type of thing assuming that we don't care about a transaction at this time, just a simple query: myDbWrapper.query(queryString, undefined) .then(function(recordSet) { console.log(recordSet); }) .catch(function(err) { console.error(err); }); How can I enable my query method to work that way? Update 3: I've found my answer. See below.
favorite count: 0
tagged with: promise
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45049989
tagged with: bluebird
has answer: http://stackoverflow.com/a/28373546
has answer: http://stackoverflow.com/a/28353083
score: 1
downvote count: 1

http://stackoverflow.com/q/28331192
accepted answer: http://stackoverflow.com/a/28336240
tagged with: d3.js
score: 0
has title: Support both pan&zoom and brush operations in force directed graphs
type: AnsweredQuestion
has body: In my app I would like to support both pan&amp;zoom operations but also be able to switch to brush operations. During the pan&amp;zoom operations I am able to click on a node and move it in the graph using drag operations. I am also able to handle mouse events successfully. When I switch to brush operations it seems that I cannot drag nodes any more. When I move the cursor over a node, nothing happens even though I have mouse events defined on that node. On the bright side I can select multiple nodes using the brush and I can move them with the arrow keys. My problem is that I would like to be able to move the selected nodes (while in brush mode) with the mouse in addition to the arrow keys. Handling mouse events would also be nice. I have created a fiddle at http://jsfiddle.net/vrdqonf2/2/ that demonstrates my problem.
has answer: http://stackoverflow.com/a/28336240
tagged with: javascript
type: Question
answer count: 1

http://stackoverflow.com/comment/45189665
comment on: http://stackoverflow.com/q/28428961
score: 0
has text: by mistake i add other code, i have updated the correct code above.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28365583
accepted answer of: http://stackoverflow.com/q/28365375
type: Answer
downvote count: 0
score: 1
has body: You can pass angular's $event &lt;p ng-click="abc($event)"&gt; Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptas, nemo, numquam, incidunt similique quisquam dolor blanditiis quis veniam at laudantium quibusdam beatae ad ea voluptates impedit molestiae cum modi quam! &lt;/p&gt; and get the innerHtml $scope.abc = function(e) { alert(e.target.innerHTML); } Plunker
answers question: http://stackoverflow.com/q/28365375
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/45005114
type: Comment
score: 1
has text: You have to "wait" for the script to finish loading before trying to use it. Loading something async means it will load in the background and finish loading sometime later while other things in the loading process continue. If you have jQuery already available, you can use `$.getScript()` and use the success handler callback function to know when it has finished loading.
type: QuestionComment
comment on: http://stackoverflow.com/q/28328517

http://stackoverflow.com/q/28389315
has comment: http://stackoverflow.com/comment/45116235
tagged with: javascript
answer count: 2
accepted answer: http://stackoverflow.com/a/28390551
downvote count: 0
favorite count: 0
has body: When reading javascript blogs and articles I see a lot of interest in ES6 Generators but I fail to understand how they differ in essence to a current sequence made with an array of functions. For example, the factory below would take an array of funtion steps and yield between steps. function fakeGen(funcList) { var i = 0, context; return function next() { if (i&lt;funcList.lenght) { return {value: funcList[i++](context)} } else return {done:true} } } What benefit am I missing and how do transpilers implement the magic in ES6?
type: AnsweredQuestion
tagged with: sequence-generators
score: 3
possible better answer: http://stackoverflow.com/a/28389525
has answer: http://stackoverflow.com/a/28389525
upvote count: 3
has answer: http://stackoverflow.com/a/28390551
has title: Difference between ES6 Generators and Array of Functions
type: Question

http://stackoverflow.com/comment/45115333
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28388526
type: Comment
has text: So it would be a waste to seperate the cats and subcats at this time? @ClarkeyBoy

http://stackoverflow.com/comment/45015572
type: Comment
type: QuestionComment
score: 1
has text: Is there a PHP part to this, or did you mistag it?
comment on: http://stackoverflow.com/q/28334498

http://stackoverflow.com/a/28350026
type: Answer
accepted answer of: http://stackoverflow.com/q/28349895
has body: By using [], you are creating a character class, which means "any one of these symbols". This means your regex is looking for the literal characters /, * (needlessly escaped in char class), or ? for splitting. The * and ? do not take on their meta functionality inside the character class. The regex you'll want is /\/\*?/ (as a regex literal), or with the constructor new RegExp("/\\*?"). You do not need the character class.
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28349895
type: AcceptedAnswer
downvote count: 0

karma-jasmine
tags question: http://stackoverflow.com/q/28370537
tags question: http://stackoverflow.com/q/28302457
type: Tag
tags question: http://stackoverflow.com/q/28355850
tags question: http://stackoverflow.com/q/28306802
tags question: http://stackoverflow.com/q/28396735
tags question: http://stackoverflow.com/q/28410644
tags question: http://stackoverflow.com/q/28411243
tags question: http://stackoverflow.com/q/28297235
tags question: http://stackoverflow.com/q/28356091
tag name: karma-jasmine
tags question: http://stackoverflow.com/q/28280449

http://stackoverflow.com/q/28425884
has comment: http://stackoverflow.com/comment/45184065
has answer: http://stackoverflow.com/a/28425951
answer count: 1
upvote count: 11
has comment: http://stackoverflow.com/comment/45183908
accepted answer: http://stackoverflow.com/a/28425951
tagged with: function
downvote count: 0
tagged with: javascript
has title: Javascript Date MAX_VALUE
tagged with: jquery
tagged with: date
linked to: http://stackoverflow.com/q/11526504
score: 11
type: AnsweredQuestion
tagged with: max
favorite count: 0
has body: In JavaScript, what is the maximum value for the year in a Date? How can I find this out in code? I have tried the following: new Date().getFullYear().MAX_VALUE; Thanks in advance.
type: Question
has comment: http://stackoverflow.com/comment/45183947

http://stackoverflow.com/comment/58903709
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28311479
has text: Thanks! The [current documentation](https://docs.amcharts.com/javascriptstockchart/LegendSettings) refers to `valueTextComparing` and `valueTextRegular` just in case `valueText` doesn't work.
score: 0

http://stackoverflow.com/q/28351231
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28351337
has answer: http://stackoverflow.com/a/28351337
tagged with: http-redirect
tagged with: css
accepted answer: http://stackoverflow.com/a/28351390
tagged with: refresh
type: AnsweredQuestion
type: Question
answer count: 2
tagged with: javascript
has title: How to make a page redirect upon refreshing page?
score: 0
has answer: http://stackoverflow.com/a/28351390
has body: From a HTML page, is there a way to auto redirect to the home page since the javascript don't run when i refresh the page? how do i add in a 3 seconds interval before redirecting it to another page? (at the end of my quiz) seconds = seconds -1; if (seconds &lt;= 0) { window.location.href="#select"; }

http://stackoverflow.com/comment/45083720
has text: @DontVoteMeDown If you are going to build a huge array and tell the browser how many elements it will have, the browser can reserve the space in memory. Increasing the size at the insertion of each element may be slower.
score: 3
comment on: http://stackoverflow.com/a/28371493
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28421483
has comment: http://stackoverflow.com/comment/45177114
has comment: http://stackoverflow.com/comment/45176706
upvote count: 3
has body: Your question is "why". The answer is because at the moment you are trying to use jQuery to find the element, it hasn't yet been added to the DOM. That doesn't happen until the digest cycle runs. $timeout works because the function call is now deferred until after the next digest cycle. The problem with that solution is that there are cases where the DOM still won't yet have been modified. Looking in more detail, this will have several failure modes. The error you are showing is sent because you are actually triggering a click in the second to last element already added, and you are doing it from inside of a digest cycle. If you already have two or more items added to the collection, this triggers angular's ng-click on the second to last one (which happens to not be the one you think), which assumes it is called outside of a digest cycle and calls $apply, which fails with the error you see because it's actually inside of a digest cycle. The "angular way" to achieve what you want is to use a directive. .directive('triggerClick', function($parse) { return { restrict: 'A', link: function(scope, elem, attr) { var fn = $parse(attr['triggerClick']); if(scope.$last) { //or some other logic fn(scope); } } } }) div class="list-group link-list" ng-show="linksForPerson"> link.engine.name link.engine.base_url link.user_sync_id link.group_sync_id Add a new link This works because the link function of the directive will be called after the node has been constructed and added to the DOM. Note the addition of "trigger-click" to your ng-repeat element. elem in the directive is a jQuery object wrapped around the instance of the ng-repeat item. Angular will call the link function for every instance of the directive, which in this case is every instance of the ng-repeat. Even more "angular" would be to not use a click event at all. You don't include the implementation of showLinkDetail, but rather than trigger a click, just call it in your controller. As a gener…
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45176509
type: Answer
has comment: http://stackoverflow.com/comment/45176533
has comment: http://stackoverflow.com/comment/45176647
has comment: http://stackoverflow.com/comment/45176574
answers question: http://stackoverflow.com/q/28421198
score: 3
accepted answer of: http://stackoverflow.com/q/28421198

http://stackoverflow.com/a/28411659
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28396983
score: 3
answers question: http://stackoverflow.com/q/28396983
has body: Please vote for WEB-10556 to have TSLint support included in WebStorm/PHPStorm. You can try configuring tslint as a filewatcher for your .ts files as suggested in https://youtrack.jetbrains.com/issue/WEB-10556#comment=27-747735
upvote count: 3
type: AcceptedAnswer

timer
tag name: timer
tags question: http://stackoverflow.com/q/28403462
tags question: http://stackoverflow.com/q/28340913
tags question: http://stackoverflow.com/q/28402130
type: Tag
tags question: http://stackoverflow.com/q/28285795
tags question: http://stackoverflow.com/q/28405051
tags question: http://stackoverflow.com/q/28300744
tags question: http://stackoverflow.com/q/28395977
tags question: http://stackoverflow.com/q/28421735
tags question: http://stackoverflow.com/q/28312575

http://stackoverflow.com/q/28433394
tagged with: backbone.js
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45204066
has comment: http://stackoverflow.com/comment/45198515
has body: I have this input field where the user can enter a suggested price for a purchase. In every browser when the user clickes on the field to enter the price a dropdown list opens with more suggested prices. &lt;span class="text-input"&gt; &lt;input type="text" class="price" name="value" data-round="false" data-min="1" data-max="1000" value="'+this.model.get('price')+'" list="price-values-" /&gt; &lt;/span&gt; Only in IE9 the user can enter the price by clicking on the field but the list with the suggested prices does not open. Any idea?? fyi: I use backbone.js I am using HTML 5 datalist and this is how I call it:$(".price" ,this.el).dataList();
tagged with: internet-explorer
has comment: http://stackoverflow.com/comment/45232197
type: Question
has comment: http://stackoverflow.com/comment/45197377
has title: Input field dropdown list doesn't work in IE9
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45196964
has comment: http://stackoverflow.com/comment/45197977
score: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/61342243
answers question: http://stackoverflow.com/q/28429190
score: 0
type: Answer
has body: I had the same issue. But I have created a code for time picker. I will be very helpful for multiple time picker also. This code works for 01:00:00 that means H:i:s $('.timepicker').timepicker().on('changeTime.timepicker', function (e) { let timePicked = $(this).val(); (timePicked.length &lt; 8) ? $(this).val("0" + timePicked) : ''; }); This code works for only H:i $('.timepicker').timepicker().on('changeTime.timepicker', function (e) { let timePicked = $(this).val(); (timePicked.length &lt; 5) ? $(this).val("0" + timePicked) : ''; });

http://stackoverflow.com/comment/45184277
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28412853
type: Comment
has text: You can also try using a watch on $scope.details.

http://stackoverflow.com/a/50860258
type: Answer
has body: It's been a while but if anyone stumbles upon this you have to update Highcharts to at least version 5. Example Replace: With:
downvote count: 1
score: -1
upvote count: 0
answers question: http://stackoverflow.com/q/28301604

http://stackoverflow.com/q/28415619
has comment: http://stackoverflow.com/comment/45333516
has title: Callback in Coffee Script
downvote count: 0
tagged with: javascript
score: 1
tagged with: callback
answer count: 3
has comment: http://stackoverflow.com/comment/45171934
has answer: http://stackoverflow.com/a/28418827
favorite count: 0
has comment: http://stackoverflow.com/comment/45169115
has comment: http://stackoverflow.com/comment/45173241
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/45169237
has body: I have the following function in coffeescript : @get_person = (person_id) -&gt; $.ajax '/people/'+person_id, type: 'GET' dataType: 'text' error: (jqXHR, textStatus, errorThrown) -&gt; $('body').append "AJAX Error: #{textStatus}" success: (data, textStatus, jqXHR) -&gt; $('.right-bar').html(data) -&gt; alert 1 $('#interaction_filter').chosen() The part of $('.right-bar').html(data) -&gt; works perfectly, but the call back below that, does not execute. What am I doing wrong? Nothing is shown in the console either.
has answer: http://stackoverflow.com/a/28419328
tagged with: coffeescript
has answer: http://stackoverflow.com/a/28416538
type: Question

http://stackoverflow.com/comment/45039558
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28347549
has text: The controller is defined in the module config, but thank you very much for the response anyway, I found the solution :)

http://stackoverflow.com/q/28305247
tagged with: javascript
has comment: http://stackoverflow.com/comment/44963349
has comment: http://stackoverflow.com/comment/44962960
score: 0
has comment: http://stackoverflow.com/comment/44962078
answer count: 1
has comment: http://stackoverflow.com/comment/44961907
has comment: http://stackoverflow.com/comment/44963826
has title: document.write("anything") does not execute in internet explorer as an external script
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28305324
has comment: http://stackoverflow.com/comment/44961653
has comment: http://stackoverflow.com/comment/44963176
has comment: http://stackoverflow.com/comment/44961673
type: Question
has comment: http://stackoverflow.com/comment/44961671
has body: my javascript file only executes as an internal style, when linked as an external style, it fails to execute. I am previewing the webpage in internet explorer.. however it executes in chrome whether as an inline or external javascript file. here is my html: * What We do Sell Shoes Sell Cars Sell Pets Sell Interiors ACP standards Quality guarantee Home Products Services Contact Us DW Demwu International here is my javascript: document.write("new web page");
has comment: http://stackoverflow.com/comment/44961987

clearinterval
tags question: http://stackoverflow.com/q/28340589
tag name: clearinterval
type: Tag

http://stackoverflow.com/q/28344550
type: Question
upvote count: 20
accepted answer: http://stackoverflow.com/a/28345762
has comment: http://stackoverflow.com/comment/45035996
tagged with: javascript
tagged with: date
has title: How to handle datetime between php (Laravel api) and javascript (AngularJS)
score: 20
possible better answer: http://stackoverflow.com/a/42990538
answer count: 2
has comment: http://stackoverflow.com/comment/45034013
has answer: http://stackoverflow.com/a/42990538
downvote count: 0
has comment: http://stackoverflow.com/comment/45034462
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28345762
has body: I'm utterly stuck trying to make php api exchange dates with angular frontend. From PHP to JS I seem to have it sorted. Since Laravel handles dates through Carbon I just added \Carbon\Carbon::setToStringFormat('c'); to app.php which makes dates come out in ISO 8601. PHP example: 2015-02-04T00:53:51+02:00 AngularJS date filter also seems to understand this format well and even reads the timezone correctly. What I have yet to get working is posting JS date objects back to PHP api. JS example: 2015-02-05T13:00:00.000Z Javascript date format ends up with milliseconds added to the string and in default configuration Carbon complains about trailing data. Also browsers seem to automatically translate my dates into UTC time. Manually using new Carbon('jsDateString') seems to work at first but on closer inspection timezone data is not considered. So my question is what would be the best and most automatic solution to send dates back to Laravel php api from AngularJS frontend?
tagged with: php
tagged with: laravel
type: AnsweredQuestion

http://stackoverflow.com/comment/44975368
type: QuestionComment
type: Comment
score: 4
has text: @AhmedAborady please provide something YOU'VE tried and we'll lead you in the right direction.
comment on: http://stackoverflow.com/q/28312489

http://stackoverflow.com/a/29391788
answers question: http://stackoverflow.com/q/28285909
type: Answer
has comment: http://stackoverflow.com/comment/75506258
score: 0
has body: Its not working because you had included the take_snapshot() function in document.addEventListener("DOMContentLoaded", function(event) { function. Please follow the tutorial... You code should look like: &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Javascript Webcam Demo - &lt;MyCodingTricks/&gt;&lt;/title&gt; &lt;link href="http://mycodingtricks.com/demo/style.css" rel="stylesheet"/&gt; &lt;/head&gt; &lt;body&gt; &lt;h3&gt;Demonstrates simple 320x240 capture &amp;amp; display&lt;/h3&gt; &lt;div id="my_camera"&gt;&lt;/div&gt; &lt;!-- A button for taking snaps --&gt; &lt;form&gt; &lt;input type=button class="btn btn-success" value="Take Snapshot" onClick="take_snapshot()"&gt; &lt;/form&gt; &lt;div id="results" class="well"&gt;Your captured image will appear here...&lt;/div&gt; &lt;script src="http://mycodingtricks.com/demo/script.js"&gt;&lt;/script&gt; &lt;!-- First, include the Webcam.js JavaScript Library --&gt; &lt;script type="text/javascript" src="webcam.min.js"&gt;&lt;/script&gt; &lt;!-- Configure a few settings and attach camera --&gt; &lt;script language="JavaScript"&gt; Webcam.set({ width: 320, height: 240, image_format: 'jpeg', jpeg_quality: 90 }); Webcam.attach( '#my_camera' ); function take_snapshot() { // take snapshot and get image data Webcam.snap( function(data_uri) { // display results in page document.getElementById('results').innerHTML = '&lt;h2&gt;Here is your image:&lt;/h2&gt;' + '&lt;img src="'+data_uri+'"/&gt;'; Webcam.upload( data_uri, 'upload.php', function(code, text) { // Upload complete! // 'code' will be the HTTP response code from the server, e.g. 200 // 'text' will be the raw response content }); } ); } &lt;/script&gt; &lt;/body&gt; &lt;/html&gt;

http://stackoverflow.com/comment/44958316
type: Comment
has text: So how would you use this to access `TestList`?
type: AnswerComment
comment on: http://stackoverflow.com/a/28293278
score: 0

http://stackoverflow.com/comment/45021162
has text: Till where it's executing ? Share output with us.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28337778

http://stackoverflow.com/a/28330793
upvote count: 1
downvote count: 0
type: Answer
score: 1
has body: Here's an example of doing it with just CSS. HTML Vert Text Column Somethin? CSS .page_block { margin:0px; padding:10px; } #header { position: relative; } .verticaltext { transform: rotate(45deg); transform-origin: right, top; -ms-transform: rotate(45deg); -ms-transform-origin:right, top; -webkit-transform: rotate(45deg); -webkit-transform-origin:right, top; position: absolute; color: #ed217c; }
answers question: http://stackoverflow.com/q/28330725

http://stackoverflow.com/comment/44925125
comment on: http://stackoverflow.com/q/28285510
has text: Only two of the menu items are actually using `showDD()`. That's why the other submenus aren't displaying.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28320471
score: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28320558
type: Question
has body: My server request is returning image/png content type header. Server link is like this: http://locahost/PrintView?locate=12,12 My browser is showing image successful. But I need to get image via ajax call. But ajax result is coming encoded format. So I can not appent it to html img or another element. $.ajax({ url: "http://localhost:7741/PrintView/Crop", type: "GET", crossDomain: true, data: { "locate":param }, success: function (response) { $('#crop').html('&lt;img src="' + response + '" /&gt;'); console.log(response) }, error: function (xhr, status) { alert("error"); } });
has answer: http://stackoverflow.com/a/28321082
answer count: 2
tagged with: javascript
tagged with: jquery
tagged with: ajax
has title: Content type image/png ajax
has comment: http://stackoverflow.com/comment/44989266
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/28326979
has comment: http://stackoverflow.com/comment/45002114
has body: You can definitely learn to program backend languages as others have suggested, and develop your own custom CMS. That said, if you are mostly a front-end developer (working graphics, javascript, and the like) you may just want to learn to utilize one of the many free CMSs out there. DotNetNuke (DNN) is based on .NET. Drupal or Joomla are also decent products, if you want to go with a PHP based solution. Alot of these already have pre-defined modules you can add in to give you a lot of backend functionality without much programming. Its pretty easy to learn how to create a skin or template to convert your HTML/css design for use with these systems. As you want more custom functionality you can create your own custom modules by building them through PHP or .NET.
score: 0
has comment: http://stackoverflow.com/comment/45004491
type: Answer
answers question: http://stackoverflow.com/q/28326606

http://stackoverflow.com/comment/45145321
comment on: http://stackoverflow.com/q/28405051
has text: Seems to work fine if you don't use an epoch date. Are you sure it supports that method? It's not mentioned anywhere in the documentation http://jsfiddle.net/d7asx17j/1/
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28288250
downvote count: 0
score: 1
has body: Two options I laid out below. You can attach an on load even to your opening body tag: 1 2 3 4 5 Or you can move your script to the bottom of your body: 1 2 3 4 5 Either of these will force the script to run after the page loads.
answers question: http://stackoverflow.com/q/28288134
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28288134
type: Answer

http://stackoverflow.com/comment/45086896
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28358201
has text: @ChrisBouchard - yep. Fixed now.

http://stackoverflow.com/comment/45039320
score: 0
type: Comment
type: QuestionComment
has text: Fix your HTML with proper closing tags first
comment on: http://stackoverflow.com/q/28347206

http://stackoverflow.com/q/28342426
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28342536
has title: How to make a String out of a CryptoJS AES Object?
answer count: 1
tagged with: cryptojs
favorite count: 0
tagged with: encryption
has body: I have CryptoJS running and I need to do the following: I have a username and a password. U encrypt the username with the password: var encrypted = CryptoJS.AES.encrypt("user", "pass"); How can I create a String out of this object to store it in my LocalStorage? At the end I need to load it from my LocalStorage and compare it to: var encrypted2 = CryptoJS.AES.encrypt("user", "pass"); if encrypted === encrypted2 all is fine. But I can't get out a string of encrypted it's an CryptoJS.AES Object and when I use JSON.stringify I get the error: TypeError: Converting circular structure to JSON
type: AnsweredQuestion
score: 4
has answer: http://stackoverflow.com/a/28342536
tagged with: http://stackoverflow.com/tag/json
type: Question
upvote count: 4
downvote count: 0

http://stackoverflow.com/comment/45134270
type: QuestionComment
has text: Maybe you can use them without the prototype extension?http://emberjs.com/guides/configuring-ember/disabling-prototype-extensions/#toc_functions
comment on: http://stackoverflow.com/q/28397953
score: 0
type: Comment

http://stackoverflow.com/q/28330563
has body: The below code works seperately in different php page. But when combining both in one page, nothing works. In firebug, the error says, TypeError: $(...).datepicker is not a function $("#test1").datepicker({ CODE FOR DATEPICKER CODE FOR AUTOCOMPLETE
type: Question
has title: Conflict b/w datepicker and autocomplete jquery
has answer: http://stackoverflow.com/a/28330672
tagged with: jquery-ui
has answer: http://stackoverflow.com/a/28332102
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 2
has comment: http://stackoverflow.com/comment/45008658
has comment: http://stackoverflow.com/comment/45009372
favorite count: 0
has comment: http://stackoverflow.com/comment/45008384
has comment: http://stackoverflow.com/comment/45008544
type: UnansweredQuestion
tagged with: datepicker
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/45009603
has comment: http://stackoverflow.com/comment/45008788
has comment: http://stackoverflow.com/comment/45008940
score: 1

http://stackoverflow.com/comment/117204968
score: 0
type: AnswerComment
type: Comment
has text: Thanks I *thought* I saw it somewhere before but now I'm guessing it was vuejs where you can actually declare/use components directly in the HTML file. Apparently in 2021 this can't be done in react either.
comment on: http://stackoverflow.com/a/28362515

http://stackoverflow.com/comment/45080741
comment on: http://stackoverflow.com/q/28369782
score: 0
has text: Your issue does not seem correct. `.sort()` is a method of a jQuery object and that's why it works on a jQuery object. Are you mistakenly compiling jQuery as if it were typescript code?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45053826
type: AnswerComment
score: 0
type: Comment
has text: Those kinds of issues are often the result of you invoking methods in a slightly different order each time, because they rely on timing of asynchronous events. You'll need to be diligent in your code about not assuming a particular invocation order unless you explicitly set it up via callbacks or promises.
comment on: http://stackoverflow.com/a/28348505

http://stackoverflow.com/a/28483942
upvote count: 4
answers question: http://stackoverflow.com/q/28390006
has comment: http://stackoverflow.com/comment/45918923
downvote count: 0
score: 4
type: Answer
has body: I've spent a bit of time trying to optimize an AngularJS application for one of the biggest banks in Holland. Although it's no Durandal, this might still give you some ideas. So what did we use for bundling and minification? Out-of-the-box bundling and minifcation from ASP.NET MVC ( which is from the system.web.optimization namespace ) You need to get a couple of things in order to leverage this: Organize your files Organize your code files in a way that they can easily be bundled. We had a large tree structure under the /app folder in the web project. Something like: - App |- Modules | |-Common | | |- Directives | | |- Templates | | |- Filters | --User | ... | app.js So the application skeleton was inside the app.js and all the other JS files were required by the application. Point being: all SPA code is separated from vendor javscript files and the rest of course Set up the budling inside the bundle configuration That's a breeze now, just do regular-old-bundling from your Global.asax.cs: Make sure there's a line in the Application_Start() with: BundleConfig.RegisterBundles(BundleTable.Bundles); That calls into your BundleConfig class which only needs 1 bundle to pack up the whole /app folder: bundles.Add(new ScriptBundle("~/bundles/app") .Include("~/app/*.js") .IncludeDirectory("~/app", "*.js", true)); We needed the app.js to load first - therefore we put it explicitly at the top. Don't worry, it will not be requested twice. For bundling - only the sequence of files can be important. However, through including that file explicitly, we could control that and it worked like a charm. Minification Now for minification we had to do some code changes. AngularJS can be used with different types of syntax - some of which can be minified, others give problems. Example: angular.module('myapp').controller(function($http,$scope) { ... }); can not be minified. The minifyer will change the name of $http so something shorter, after which the injector cannot do dependency injecti…

http://stackoverflow.com/comment/44936144
type: QuestionComment
comment on: http://stackoverflow.com/q/28291087
has text: `class="modal hide"` is wrong for Bootstrap v3. Should just be `class="modal"`.
score: 0
type: Comment

http://stackoverflow.com/comment/45096333
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28378044
type: Comment
has text: you also have a `;` at the end of your module definition which seems to be out of place. Are you getting errors in your console?

http://stackoverflow.com/q/28360130
tagged with: css
has comment: http://stackoverflow.com/comment/45062969
answer count: 0
tagged with: wordpress
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45063022
has body: Is it possible to let users redirect to a "page not found" when they click a css/js from the view source of their browser. Or maybe something like this My goal for this is not let the user see the content of my files so that they will have no idea what plugins I am using. I am using wordpress and my client doesn't want me to let his users see what plugins he is using. I already found a plugin called http://codecanyon.net/item/hide-my-wp-no-one-can-know-you-use-wordpress/4177158 but the probleme with that plugin is that when users try to view source their browser, they will see the styles.css or other js files, and in those files, that content usually has its plugin name. Some of you might suggest to not write the name of the plugin on those css/js files, but I don't have control on that. So any ideas or suggestions on how to come up with this solution will be greatly appreciated. Thanks! :)
score: 0
has comment: http://stackoverflow.com/comment/45063127
has comment: http://stackoverflow.com/comment/45063129
tagged with: jquery
has title: Redirect users to a page not found when they click on a css/js file from view source
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28282744
has body: I am using the http://jqueryvalidation.org/ to validate my forms and by default this is called when the form gets submitted. I am wanting to start the validation when the function I have wrapped it into is called. So basically, I have this for the validation: function ticketCreateSubmit() { $("#ticketForm").validate({ ... }); } And then this is getting called by: ticketCreateSubmit(); in my payments page. The form does have the id of ticketForm. The function does get called, but the validation does not take action? I searched the validation website and I found that if I put onsubmit: false, it doesn't process it on form submit, but that still didn't get the validation to run when the function is being called? How would I go about this? Just so everyone understands, I'm only needing to call the VALIDATION so it runs from the external script. I'm not needing to do anything else. Just execute the validation.
tagged with: php
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28283155
has comment: http://stackoverflow.com/comment/44920221
score: 0
tagged with: forms
has comment: http://stackoverflow.com/comment/44920315
type: Question
tagged with: javascript
has title: Jquery Validation From Another Function
accepted answer: http://stackoverflow.com/a/28283155
answer count: 2
possible better answer: http://stackoverflow.com/a/28283206
tagged with: validation
has answer: http://stackoverflow.com/a/28283206
tagged with: jquery

http://stackoverflow.com/q/28340566
tagged with: jquery-select2
type: Question
score: 0
has comment: http://stackoverflow.com/comment/45028462
tagged with: select
has comment: http://stackoverflow.com/comment/45028791
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28342409
type: UnansweredQuestion
has title: select2 jQuery plugin: how do I get a reference of the list of tag replacements?
has body: with the following code $('select.my-select').select2().on('select2:opening', function (event) { console.log(event, this); }); the logged this is the 'original' &lt;select&gt; DOM element. But how do I get its replacement/representation? I'm talking about the &lt;ul&gt; with class select2-results__options. I'm using the latest select2 beta version (currently 4.0.0 Beta 3). thanks
tagged with: jquery
has comment: http://stackoverflow.com/comment/45026714

http://stackoverflow.com/comment/44933468
score: 0
has text: smooth.mergeVertices; is not a function call, even though mergeVertices is a function
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28280235

http://stackoverflow.com/a/33493025
downvote count: 0
answers question: http://stackoverflow.com/q/28397135
score: 3
has body: After 2 hours of fiddling with this, this solution worked for me. var img = new Image(); img.src = "data:image/jpeg;charset=utf-8;base64, " + profilepic; $("#profilepict").css("background-image", "url('" + img.src + "')");
type: Answer
upvote count: 3

http://stackoverflow.com/comment/44971062
score: 0
comment on: http://stackoverflow.com/q/28309629
type: Comment
type: QuestionComment
has text: The information looks absent from the picture when it's displayed.

http://stackoverflow.com/comment/45023032
score: 1
comment on: http://stackoverflow.com/q/28338816
type: Comment
type: QuestionComment
has text: No, hide is a method, but you're calling it like a property instead of what it really is.

http://stackoverflow.com/comment/45062262
type: QuestionComment
has text: Can you post your entire html?
comment on: http://stackoverflow.com/q/28358780
score: 0
type: Comment

http://stackoverflow.com/comment/45004020
type: AnswerComment
type: Comment
has text: If I understand you correctly then it shouldn't matter. The `innerHTML` property returns a representation of the content of an `HTMLElement`, whether its text or descendant elements. If there is anything inside the element (including an empty space), then the condition will be false and the `else` block will be executed.
comment on: http://stackoverflow.com/a/28328021
score: 0

http://stackoverflow.com/comment/45196703
type: Comment
has text: I mean is there another way to use the observer without injecting code in pages that are not yours ?
comment on: http://stackoverflow.com/a/28398072
score: 0
type: AnswerComment

http://stackoverflow.com/q/28308933
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44970507
has title: How to Parse RSS urls from an external server or site from where the feed is displayed
has comment: http://stackoverflow.com/comment/45269727
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45285840
has comment: http://stackoverflow.com/comment/52923252
has body: I use a plugin to parse rss feeds to my site the HTML mark up is below. &lt;body&gt; script src="lib/jquery-1.6.4.min.js"&gt;&lt;/script&gt; &lt;script src="src/jquery.rss.js"&gt;&lt;/script&gt; &lt;script&gt; jQuery(function($) { $("#rss-feeds").rss("http://feeds.feedburner.com/premiumpixels") }) &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="rss-feeds"&gt;&lt;/div&gt; My question is, how can I place the rss url on a another site or server and parse it to my site via JSON? basically I need to know how to Parse rss urls on my site with the url feeds coming from an external site or server via JSON.
linked to: http://stackoverflow.com/q/11736431
tagged with: rss
type: UnansweredQuestion
tagged with: atom-feed
has answer: http://stackoverflow.com/a/28309077
tagged with: http://stackoverflow.com/tag/json
type: Question
score: 0

http://stackoverflow.com/comment/45219824
score: 0
has text: Wow this looks really like the perfect solution for my problem. Thanks
type: Comment
comment on: http://stackoverflow.com/a/28423798
type: AnswerComment

http://stackoverflow.com/comment/44998487
has text: i will try with the Array
type: Comment
comment on: http://stackoverflow.com/q/28325172
type: QuestionComment
score: 0

http://stackoverflow.com/q/28435488
has comment: http://stackoverflow.com/comment/45201327
has comment: http://stackoverflow.com/comment/45201442
has comment: http://stackoverflow.com/comment/45201672
type: Question
has title: Call to $.post() Jquery not passing parameters successfully
tagged with: javascript
has comment: http://stackoverflow.com/comment/45201724
has comment: http://stackoverflow.com/comment/45201390
score: 0
linked to: http://stackoverflow.com/q/1354691
has comment: http://stackoverflow.com/comment/45203115
tagged with: jquery
type: UnansweredQuestion
tagged with: php
has body: /** * Created by quantumveil on 2/10/15. */ $(document).ready(function(){ $('a').on('click',function(){ //$href=$(this).attr('href'); //console.log($href); var $convoid=$(this).attr('id'); console.log($convoid); //$('#convoarea').load($href); $.get('inbox.php',{convoid:$convoid},function(data){$('#convoarea').html(data);//the callback sets whati t had to //now add the on click handler to send button $('#send').on('click',function(){ var $msgbody=$('#sendbody').val(); console.log($msgbody); ///now what i have to do is sent this $msgbody to the inbox.php thru get k $.post('inbox.php',{sendbody:$msgbody,convoid:$convoid},function(data){ $('#sendbody').before(data); console.log('here'+$msgbody); });//the callback function will append it to other messages :3 return false; }); }//callback ends hre ); return false; }); //for send button }); Hi. I'm trying to code a social networking site and I want the inbox to be responsive and dynamic. I've recently started learning Jquery for the purpose being. I've googled this before and found no help and so it brings me here on this community. The above Javascript/Jquery code is supposed to pass some post parameters when the SEND button is clicked. Another file, inbox.php, is to receive those and work appropriately. Now here's what bugs me. The callback function to $.post() is executed, so I'm assuming the parameters are being passed to inbox.php. But when I try accessing them in inbox.php using following line if($msgbody=get_post('sendbody')&amp;&amp;$convoid=get_post('convoid')) I only receive a value of 1 and not the message's actual body. Here's how the function get_post is defined function get_post($var1){ if(isset($_POST[$var1])){$var=$_POST[$var1]; return filter($var);} else return 0; } I've tried accessing them directly through $_POST['sendbody'] but an error of undefined index is being generated. Any help will be highly appreciated. (PS the other call to .get() in the beginning of this js file is passing the parameters so th…
answer count: 0
has comment: http://stackoverflow.com/comment/45201410

http://stackoverflow.com/q/28349241
has comment: http://stackoverflow.com/comment/45042562
has answer: http://stackoverflow.com/a/28364810
tagged with: javascript
has comment: http://stackoverflow.com/comment/45044059
has body: I would like to extend the content and add new dom elements that contain data-binding. In the example runs the add new item, but data-binding does not work. Is it possible to solve my problem?
tagged with: web-component
answer count: 1
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/28364810
has comment: http://stackoverflow.com/comment/45043935
has comment: http://stackoverflow.com/comment/45044246
type: AnsweredQuestion
has title: How to modify existing <content> in a element?
score: 1
has comment: http://stackoverflow.com/comment/45042684
upvote count: 1
type: Question
tagged with: polymer

http://stackoverflow.com/comment/45025000
type: AnswerComment
has text: yeah, but V8 is probably a browser core implementation... (nodejs should be fine, and what else is there really?)
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28339369

http://stackoverflow.com/q/28294267
favorite count: 0
type: UnansweredQuestion
has body: I want to download a saved image after an ajax call. I have a canvas on the site that I am sending to a php file. I already managed to save a temporary image to the server but I want to have a download dialogue after that. My PHP so far: define('UPLOAD_DIR', 'images/'); $img = $_REQUEST['imgBase64']; $img = str_replace('data:image/png;base64,', '', $img); $img = str_replace(' ', '+', $img); $data = base64_decode($img); $file = UPLOAD_DIR . uniqid() . '.png'; $success = file_put_contents($file, $data); $quoted = sprintf('"%s"', addcslashes(basename($file), '"\\')); $size = filesize($file); header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename=' . $quoted); header('Content-Transfer-Encoding: binary'); header('Connection: Keep-Alive'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-Length: ' . $size); My javascrpt: $.ajax({ type: "POST", url: "./ajax/base64ToImage.php", data: { imgBase64: dataURL } }).done(function(o) { console.log('saved'); console.log(o); }); The file is saved correctly but I only get back an empty string. How do I force a download in that call?
tagged with: php
has title: Force Download of image with AJAX call
answer count: 0
upvote count: 1
type: Question
score: 1
has comment: http://stackoverflow.com/comment/44946888
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44941979

http://stackoverflow.com/a/28423765
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45180453
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45180646
has body: You are missing the class selector in the fadein/html code, you are using the class like a descendant selector jQuery(window).scroll(function () { var scrollTop = $(this).scrollTop(); var data = '&lt;img src="//placehold.it/135X55" width="135" height="55" alt="AFL"&gt;' if (scrollTop &gt;= 250) { jQuery('a.navbar-brand').stop().animate({ opacity: 0.0 }, 500, function () { jQuery(this).html(data).animate({ opacity: 1 }); }); } }); Demo: Fiddle Also, once the animation is done, I think the further scrolling should not repeat it so var flag = false; jQuery(window).scroll(function () { var scrollTop = $(this).scrollTop(); var data = '&lt;img src="//placehold.it/135X55" width="135" height="55" alt="AFL"&gt;' if (scrollTop &gt;= 250) { if (!flag) { flag = true; jQuery('a.navbar-brand').stop().animate({ opacity: 0.0 }, 500, function () { jQuery(this).html(data).animate({ opacity: 1 }); }); } } }); Demo: Fiddle As for the lagging, the browser is a single threaded application so when there is a faster scrolling the browser may spend more time on updating the view as per the scroll than in the script executing which handles the fadeIn
answers question: http://stackoverflow.com/q/28423745
accepted answer of: http://stackoverflow.com/q/28423745

http://stackoverflow.com/q/28399097
type: Question
upvote count: 2
has body: Is there any setting/framework that can help to drag text, images and videos smoothly within ckeditor? From dragging, I mean to drag/position all elements anywhere I want them to be.
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/45158396
score: 2
answer count: 0
has title: How to apply dragging to all elements within Ckeditor?
type: UnansweredQuestion
tagged with: javascript
tagged with: ckeditor

http://stackoverflow.com/q/28402779
score: 0
has comment: http://stackoverflow.com/comment/45140757
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/28402815
has body: I'm trying to get all the values in a form when the user selects an option in the droplist. I'm using the Onchange attribute but I don't know how to send the all values to submitForm() via this attribute. Choice 1 Choice 2 Thanks
type: AnsweredQuestion
type: Question
tagged with: javascript
has title: How to get all values in a form with Onchange attribute
tagged with: ajax
accepted answer: http://stackoverflow.com/a/28402815

http://stackoverflow.com/q/28394409
has body: I am trying to create histograms of randomly generated data, so currently I am doing the following: Let's say the following array is created: returns = [0.0024, 0.0231, 0.014, 0.0005, -0.008] I go through the array using: returnsRounded[x] = Math.round(returns[x] * 1000) / 1000; And this will return me: returnsRounded = [0.002, 0.023, 0.014, 0.001, -0.008] Now I am trying to count the number of each particular value (in an array of tens of thousands of values, so I very inefficiently will do something akin to: switch (returnsRounded) { case -0.040: arr[1]++; break; case -0.038: arr[2]++; break; // ... and so on. } And then plug the counted values into my histogram (which works like a bar chart -- in the sense that it only compares counts. I can't just plug in an array and get a histogram. So is there any more efficient way of counting the number of occurrences of a rounded number in an array that is faster or more pretty than what I'm doing? Thanks! Edit: I came up with a much better than my current way, though I don't know if it is still great. Here's a fiddle: http://jsfiddle.net/brockwhittaker/bLu4s8sc/
tagged with: for-loop
tagged with: performance
tagged with: arrays
has answer: http://stackoverflow.com/a/28395653
tagged with: javascript
has comment: http://stackoverflow.com/comment/45125415
has comment: http://stackoverflow.com/comment/45125544
has comment: http://stackoverflow.com/comment/45125370
has comment: http://stackoverflow.com/comment/45127375
has comment: http://stackoverflow.com/comment/45125594
score: 2
has comment: http://stackoverflow.com/comment/45125376
answer count: 1
downvote count: 0
has title: What is the best way to count like-values in JS for a Histogram?
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45125493
has comment: http://stackoverflow.com/comment/45125566
has comment: http://stackoverflow.com/comment/45549666
type: Question

http://stackoverflow.com/q/28334540
upvote count: 3
type: Question
linked to: http://stackoverflow.com/q/11417544
has comment: http://stackoverflow.com/comment/45359517
possible better answer: http://stackoverflow.com/a/39294524
downvote count: 0
has answer: http://stackoverflow.com/a/28522076
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/39294524
tagged with: truncate
answer count: 3
linked to: http://stackoverflow.com/q/298750
has comment: http://stackoverflow.com/comment/45015751
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
accepted answer: http://stackoverflow.com/a/28522076
linked to: http://stackoverflow.com/q/6222616
has title: Truncate text in html with link to show more / less and keep elements inside
has answer: http://stackoverflow.com/a/62600613
has body: I found this fiddle here for truncating text in html from @iambriansreed http://jsfiddle.net/iambriansreed/bjdSF/ It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text. jQuery(function(){ var minimized_elements = $('p.minimize'); minimized_elements.each(function(){ var t = $(this).text(); if(t.length < 100) return; $(this).html( t.slice(0,100)+'... More'+ ''+ t.slice(100,t.length)+' Less' ); }); $('a.more', minimized_elements).click(function(event){ event.preventDefault(); $(this).hide().prev().hide(); $(this).next().show(); }); $('a.less', minimized_elements).click(function(event){ event.preventDefault(); $(this).parent().hide().prev().show().prev().show(); }); }); Its from this post here on stackoverflow: Truncate paragraph first 100 character and hide rest content of paragraph to show/hide rest contenct with more/less link The Problem is it only takes the plain text from the paragraph with .text but what if I want to truncate the text with its html elements like links, bold type and stuff. I tried adding a second variable which selects the text with elements: var h = $(this).html(); and adding it to the slice function: $(this).html( t.slice(0,100)+'... More'+ ''+ h.slice(100,h.length)+' Less' ); It kinda works but sometimes I get words double or cut because it does not count up (100 chars text vs 100 chars text with elements) So that post is 2 years old and I was wondering if there is any plugin or solution for my problem. best regards
type: AnsweredQuestion
score: 3

http://stackoverflow.com/q/28291782
has comment: http://stackoverflow.com/comment/44937682
has comment: http://stackoverflow.com/comment/44938149
type: Question
tagged with: laravel-4
has comment: http://stackoverflow.com/comment/44939986
tagged with: javascript
has comment: http://stackoverflow.com/comment/44939225
has comment: http://stackoverflow.com/comment/44938399
score: 0
has title: How to use search using Ajax in Laravel
has comment: http://stackoverflow.com/comment/44937110
has comment: http://stackoverflow.com/comment/44937617
has comment: http://stackoverflow.com/comment/44938863
has comment: http://stackoverflow.com/comment/44937278
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44938678
has comment: http://stackoverflow.com/comment/44937294
has comment: http://stackoverflow.com/comment/44937733
has comment: http://stackoverflow.com/comment/44939192
has body: im trying to search a values from database to retreive corresponding data form database to text box using laravel. the problem is..im enter a value but no result. my controller.php public function executeSearch() { $keywords=Input::get('keywords'); $users=User::all(); $searchUsers=new\Illuminate\Database\Eloquent\Collection(); foreach($users as $u) { if(Str::contains(Str::Lower($u-&gt;username),Str::Lower($keywords))) $searchUsers-&gt;add($u); } return View::make('searchUsers') -&gt;with('users',$searchUsers); } search js page var keywords=$('#search-input').val(); if(keywords.length&gt;0) { $.post('http://localhost/lara/lara/public/search',{keywords:keywords},function(markup) { $('#search-result').html(markup); }); } i think problem is this line ...$.post('http://localhost/lara/lara/public/search',{keywords:keywords},function(markup)
has comment: http://stackoverflow.com/comment/44938575
has comment: http://stackoverflow.com/comment/44939048

http://stackoverflow.com/comment/45065970
type: AnswerComment
has text: I agree with your offer to use Element.getClientRects()
score: 0
comment on: http://stackoverflow.com/a/28361839
type: Comment

http://stackoverflow.com/comment/45102740
comment on: http://stackoverflow.com/q/28377882
has text: Exactly, what is not working without `e.append`? Your question is regarding animation, which works fine if you remove that unnecessary code.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28430511
has body: The single $ is usually a short name for jQuery object. The double $$ could be anything. In Angular, seems to designate a private identifier. You can do something like this when you hate your colleagues : $$$$($$$[$]);
has comment: http://stackoverflow.com/comment/45191793
type: Answer
has comment: http://stackoverflow.com/comment/45191696
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45191821
answers question: http://stackoverflow.com/q/28430468
accepted answer of: http://stackoverflow.com/q/28430468
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/comment/45001457
has text: @eicto - You have to have something that speaks socket.io on BOTH ends for communication to work properly. A plain Unix socket does not, by itself, know how to initiate a socket.io connection (which starts out as an HTTP request and is then upgraded to a webSocket) or know how to speak socket.io events. You could get code to go on the Unix server that would speak socket.io and was listening on the port that you are going to connect and then you could use it.
comment on: http://stackoverflow.com/a/28316240
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28424390
tagged with: http://stackoverflow.com/tag/html
tagged with: asp.net
has body: In my login page, I have a checkbox, that has to do something on change event,I have wrote change event in my js and I have to check whether it is checked or unchecked, I have used many methods like $(".checkbox").is(":checked")/ $(".checkbox").attr("checked")/ $(".checkbox").prop("checked") but all the above are not working, the last two return undefined where as the first one returns false always. I have fiddled this here .please help me to figure out the error html &lt;div class="checkbox"&gt; &lt;label&gt; &lt;asp:CheckBox ID="checkbox" runat="server" cssClass="remember-me" Checked="false" /&gt; Remember Me &lt;/label&gt; &lt;/div&gt; js $(document).ready(function () { $('.remember-me').change(function () { alert($(".remember-me").is(":checked")); }); });
has comment: http://stackoverflow.com/comment/45181602
tagged with: checkbox
has title: how to check checkbox status on change event
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28424412
accepted answer: http://stackoverflow.com/a/28424412
possible better answer: http://stackoverflow.com/a/28424433
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45181608
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/45181677
has answer: http://stackoverflow.com/a/28424433

http://stackoverflow.com/comment/44974762
comment on: http://stackoverflow.com/a/28312085
type: Comment
has text: I think that should be `No wrap - in `. (Although it is "wrapped in the head section")... you'd think the fiddle was just an example of the problem; not _the_ problem!
score: 0
type: AnswerComment

http://stackoverflow.com/q/28326418
has comment: http://stackoverflow.com/comment/45000524
upvote count: 2
has title: How to add class if used started scroll inside div?
has answer: http://stackoverflow.com/a/28326572
tagged with: css
score: 2
type: AnsweredQuestion
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has body: I have atleast 4 div boxes which needs add new class after started to scroll to bottom. The same class need to be removed if the user scrolled to top. Refer this link for beter understanding. http://jsfiddle.net/xj4wbv5c/5/ Here we need to add class scrolled if user started scroll and remove class scrolled once the scroll bar touch the top after scrolling. I already tried something but it doesn't help. Please suggest.
has answer: http://stackoverflow.com/a/28326517
accepted answer: http://stackoverflow.com/a/28326517
possible better answer: http://stackoverflow.com/a/28326572
favorite count: 0

http://stackoverflow.com/q/28399252
type: AnsweredQuestion
downvote count: 0
type: Question
has comment: http://stackoverflow.com/comment/45134239
has body: So Im starting with AngularJs and i see you can create controllers and modules in AngularJS scripts. My app runs on asp.net MVC 4, so should i translate my controllers to Angular or Just use my MVC controllers. What are the pro and cons of using angularJS controllers, can someone please elaborate that? thank you!
tagged with: asp.net-mvc
has answer: http://stackoverflow.com/a/28399330
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28399330
score: 4
has comment: http://stackoverflow.com/comment/45134302
answer count: 1
has title: AngularJS vs MVC controllers What to choose?
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45134455
upvote count: 4
has comment: http://stackoverflow.com/comment/45134323

http://stackoverflow.com/q/28409008
favorite count: 0
has answer: http://stackoverflow.com/a/43711996
accepted answer: http://stackoverflow.com/a/43711996
has comment: http://stackoverflow.com/comment/45152292
type: AnsweredQuestion
score: 3
downvote count: 0
type: Question
has title: wheel event brokes mousewheel javascript
has body: In latest Chrome there are two wheel events: wheel and mousewheel. So this code works good: document.addEventListener('mousewheel', function () { console.log('mousewheel fires'); }, false); But in this case: document.addEventListener('mousewheel', function () { console.log('mousewheel never fires'); }, false); document.addEventListener('wheel', function () { console.log('wheel fires'); }, false); mousewheel doesn't work. So if I write some third-party script (jquery plugin for example) and use mousewheel there, it doesn't work on sites that used wheel event. On the contrary if I use wheel event in script - it will broke sites that used mousewheel. What to do in this situation? (and sorry for my english). Update Thanks to Tintu C Raju: As per MDN "the wheel event is fired when a wheel button of a pointing device (usually a mouse) is rotated. This event replaces the non-standard deprecated mousewheel event."
tagged with: javascript
upvote count: 3
has comment: http://stackoverflow.com/comment/45152018
answer count: 1

http://stackoverflow.com/q/28425409
has title: Implementing Scanline Algorithm
tagged with: javascript
score: 0
linked to: http://stackoverflow.com/q/10061146
has comment: http://stackoverflow.com/comment/45185466
has comment: http://stackoverflow.com/comment/45227477
has comment: http://stackoverflow.com/comment/45222331
has comment: http://stackoverflow.com/comment/45201423
has comment: http://stackoverflow.com/comment/45183318
answer count: 0
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45184426
tagged with: algorithm
tagged with: scanline
has comment: http://stackoverflow.com/comment/45183234
has body: I'm trying to implement a scan line filling algorithm for random triangles given 3 points as arrays and a color. I'm getting some weird results. Please ignore the optimization of the code, I'm just trying to get it to work and then try to optimize it. I have a method which uses the Bresenham line algorithm to draw lines. I cannot figure out why I'm getting these results. http://postimg.org/image/qh1sdizwv/ var dx1; var dx2; var dx3; var S= new Int32Array([0,0]); var E= new Int32Array([0,0]); var A=new Int32Array([0,0]); var B=new Int32Array([0,0]); var C=new Int32Array([0,0]); var xmin = Math.min(v0[0],v1[0],v2[0]); var xmax = Math.max(v0[0],v1[0],v2[0]); var ymin = Math.min(v0[1],v1[1],v2[1]); var ymax = Math.max(v0[1],v1[1],v2[1]); /*A,B and C are points sorted by y-coordinates A[1] is ymin, C[1] is ymax S is for start, E is for end*/ if((ymin==v0[1]) &amp;&amp; (ymax==v2[1])){ A[0]=v0[0]; A[1]=v0[1]; B[0]=v1[0]; B[1]=v1[1]; C[0]=v2[0]; C[1]=v2[1]; } if((ymin==v0[1]) &amp;&amp; (ymax==v1[1])){ A[0]=v0[0]; A[1]=v0[1]; B[0]=v2[0]; B[1]=v2[1]; C[0]=v1[0]; C[1]=v1[1]; } if((ymin==v1[1]) &amp;&amp; (ymax==v2[1])){ A[0]=v1[0]; A[1]=v1[1]; B[0]=v0[0]; B[1]=v0[1]; C[0]=v2[0]; C[1]=v2[1]; } if((ymin==v1[1]) &amp;&amp; (ymax==v0[1])){ A[0]=v1[0]; A[1]=v1[1]; B[0]=v2[0]; B[1]=v2[1]; C[0]=v0[0]; C[1]=v0[1]; } if((ymin==v2[1]) &amp;&amp; (ymax==v0[1])){ A[0]=v2[0]; A[1]=v2[1]; B[0]=v1[0]; B[1]=v1[1]; C[0]=v0[0]; C[1]=v0[1]; } if((ymin==v2[1]) &amp;&amp; (ymax==v1[1])){ A[0]=v2[0]; A[1]=v2[1]; B[0]=v0[0]; B[1]=v0[1]; C[0]=v1[0]; C[1]=v1[1]; } if(B[1]-A[1] &gt;0) dx1=((B[0]-A[0])/(B[1]-A[1])); else dx1=0; if(C[1]-A[1] &gt;0) dx2=((C[0]-A[0])/(C[1]-A[1])); else dx2=0; if(C[1]-B[1] &gt;0) dx3=((C[0]-B[0])/(C[1]-B[1])); else dx3=0; S[0]=A[0]; S[1]=A[1]; E[0]=A[0]; E[1]=A[1]; if(dx1&gt;dx2){ for(;S[1]&lt;=B[1]; S[1]++, E[1]++, S[0]=S[0]+dx2, E[0]=E[0]+dx1) bresenhamAlg(S,E,color); E[0]=B[0]; E[1]=B[1]; for(;S[1]&lt;=C[1]; S[1]++, E[1]++, S[0]=S[0]+dx2, E[0]=E[0]+dx3) bresenhamAlg(S,…
tagged with: webgl

acrobat
type: Tag
tags question: http://stackoverflow.com/q/28373030
tags question: http://stackoverflow.com/q/28422213
tags question: http://stackoverflow.com/q/28285592
tag name: acrobat
tags question: http://stackoverflow.com/q/28359001

http://stackoverflow.com/comment/45057395
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28357001
has text: Does using `getElementById` then $(contactForm) have performance advantages compared to simple `$("#contact-form")`?
type: AnswerComment

http://stackoverflow.com/comment/44920110
comment on: http://stackoverflow.com/a/28282216
type: Comment
has text: @jamez14 Thanks I will add that to the answer too.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45072262
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28328848
type: Comment
has text: Thanks man:) I already realized it. Should have read documentation closer https://developers.google.com/apps-script/reference/spreadsheet/sheet#getRange%28Integer,Integer,Integer,Integer%29

http://stackoverflow.com/comment/45181612
type: Comment
type: QuestionComment
has text: I don't think I understand the question. Technically, if you call display timer again, the timer will reset. If you want to have a separate `resetTimer` function then it would make sense for you to remove the timer UI updater to another function called `setTime` and just call that in your `resetTimer`. If you want to take it further, maybe create a module for the timer itself.
score: 0
comment on: http://stackoverflow.com/q/28424327

http://stackoverflow.com/a/28298392
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28294515
answers question: http://stackoverflow.com/q/28294515
type: AcceptedAnswer
type: Answer
score: 3
upvote count: 3
has body: Save is problematic in Mongoose as being an exception to the rule of promise returning functions there. I highly recommend that you promisify mongoose using bluebird which exposes a saveAsync function: var Promise = require("bluebird"); var func = require("functions") var mongoose = Promise.promisifyAll(require('mongoose')); var mongo_models = require('./database/mongo_model')(mongoose); And then return the async call as: // Note the suffix return new mongo_models.Tab({avg:0,post:a.one}).saveAsync();

http://stackoverflow.com/comment/45057819
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28357187
has text: The only thing in styles is #map-canvas{ width: 100%; height: 300px; } Even without that and adding it directly to the canvas tag I get the same thing.
score: 0

http://stackoverflow.com/q/28374591
has comment: http://stackoverflow.com/comment/45090309
tagged with: expression
tagged with: javascript
has comment: http://stackoverflow.com/comment/45091161
has answer: http://stackoverflow.com/a/28375796
score: -3
accepted answer: http://stackoverflow.com/a/28375878
type: AnsweredQuestion
upvote count: 0
possible better answer: http://stackoverflow.com/a/28375796
tagged with: jquery
favorite count: 0
type: Question
answer count: 2
tagged with: regex
has comment: http://stackoverflow.com/comment/45090298
has title: Combination of two regex
has comment: http://stackoverflow.com/comment/45091683
has comment: http://stackoverflow.com/comment/45089716
has answer: http://stackoverflow.com/a/28375878
downvote count: 3
has comment: http://stackoverflow.com/comment/45090454
has comment: http://stackoverflow.com/comment/45089687
has body: I'm using form validator in order to validate some fields on my signup form. One of which is a telephone field for which I have prepared two regexes that will provide validation. regexp: { regexp: &gt;/(^01|^02|^071|^073|^074|^075|^076|^077|^078|^079)/, /^((?!(012345|123456|234567|345678|456789|0{6,}|1{6,}|2{6,}|3{6,}|4{6,}|5{6,}|6{6,}|7{6,}|8{6,}|9{6,})).)*$/ message: 'The phone number is not valid' } My issue is that only one of those two will work, not both. Any idea how I could modify this such that they both work?

http://stackoverflow.com/comment/45010820
has text: I've altered your example code to meet my needs, but I'm using jquery datatables. I already have ...... hardcoded in the html page. I need only the to be added below the .. I've entirely deleted from html and I tried to append the js result to table as $('table').append(table); The rows get appended, but the problem, it's a jquery datatables, there is one row above the which is showing as No data available in table. I'm trying every possibility, if you know how to solve this, kindly help me..
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28328149

http://stackoverflow.com/q/28410239
downvote count: 0
type: UnansweredQuestion
score: 1
type: Question
has answer: http://stackoverflow.com/a/28416977
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: angularjs
has body: I have a table with search options that uses trNgGrid.js. I make a query to a Sharepoint list where one of the columns has html content and I want to display this. For doing this I use $sce.trustAsHtml inside the promise, but this is not working. So after some tests I notice that after doing the $scope.requests.push(item) I can do something like this: $scope.requests[x].SubjectText = $sce.trustAsHtml($scope.requests[x].HTMLContent); and this works more or less because the SubjectText column is not for showing html so what it does is to show it as plain text. On the other hand, if I do something like this nothing happens: $scope.requests[x].HTMLContent = $sce.trustAsHtml(angular.copy($scope.requests[x].HTMLContent)); And the column is without data. The most strange thing is that if I do exactly the same, but without telling to which item I put the value it works, so the html content is shown in a perfect way, but all items have the same value that is the last one from the promise. $scope.requests.HTMLContent = $sce.trustAsHtml(angular.copy($scope.requests[x].HTMLContent)); I made a change in the trNgGrid that helps me to have a ng-bind-html in a div in case of having file-name.
tagged with: http://stackoverflow.com/tag/html
has title: how to show html content in trNgGrid with $sce.trustAsHtml

http://stackoverflow.com/q/28423690
accepted answer: http://stackoverflow.com/a/28424721
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I have tried: video.height // never worked video.offsetHeight // worked when video was visible, now returning 0 for the purpose of showing only a processed video, I keep the video element hidden, and if I am drawing it on the screen in certain intervals, the below code works(even witht eh video hidden), var video = document.getElementById('someVid'); var canvas = document.getElementById('someCanvas'); var ctx = canvas.getContext('2d'); ctx.drawImage(video, 0, 0, canvas.height, canvas.width); I need the height and width for some processing, before drawing, so the new draw line would be: ctx.drawImage(video, x, y, w, h, 0, 0, canvas.height, canvas.width); for calculation of that x,y,w,h I need hidden video's height, width. p.s: no need IE support, only firefox and chrome.
tagged with: video
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28424721
type: Question
has title: get height and width of hidden video
tagged with: canvas
tagged with: javascript
linked to: http://stackoverflow.com/q/4129102
score: 0

http://stackoverflow.com/comment/45022667
score: 1
has text: http://stackoverflow.com/questions/9152373/php-flushing-while-loop-data-with-ajax
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28338638

http://stackoverflow.com/comment/45178668
comment on: http://stackoverflow.com/a/28422345
has text: Its a float left so if it has room it will sit in under first line. see this http://jsbin.com/vacihixigu
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/28323977
answer count: 2
has body: I have a svg and I can draw multiple shapes on this svg. Now my requirement is I want to listen keyboard events like ctrl+C, ctrl+V, ctrl+D, Esc, Delete so that I can copy, paste , duplicate selected shape. But I have no idea about listening keyboard events on SVG . I tried following code but no luck !! mySVG.on("keydown", function () { //code to handle keydown }); Any help ? Thanks in advance.
upvote count: 12
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/15261447
has answer: http://stackoverflow.com/a/28324178
tagged with: events
has comment: http://stackoverflow.com/comment/44995851
has comment: http://stackoverflow.com/comment/44996033
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
score: 12
accepted answer: http://stackoverflow.com/a/28324178
tagged with: keydown
has comment: http://stackoverflow.com/comment/44995779
has comment: http://stackoverflow.com/comment/44995953
type: AnsweredQuestion
has title: How to listen keyboard events on svg
possible better answer: http://stackoverflow.com/a/68885356
has answer: http://stackoverflow.com/a/68885356
type: Question

http://stackoverflow.com/comment/44921051
type: QuestionComment
has text: @epascarello perfect thxs. Wanna add as an answer so i can accept it?
comment on: http://stackoverflow.com/q/28283344
score: 0
type: Comment

http://stackoverflow.com/a/28382665
has body: I found the solution by setting the width to 0 of the div which the player is in :D
type: Answer
answers question: http://stackoverflow.com/q/28371081
score: 0

http://stackoverflow.com/comment/45135796
comment on: http://stackoverflow.com/q/28394340
score: 0
has text: Could you show the updated screenshots of the errors?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44990910
score: 0
has text: @w3d It is the id of the canvas.
type: Comment
comment on: http://stackoverflow.com/q/28321107
type: QuestionComment

http://stackoverflow.com/a/42691058
score: 0
type: Answer
has body: I don't find option but it changed code in jquery.fileupload.js } else if (entry.isDirectory) { // directory drag prevent //dirReader = entry.createReader(); //readEntries(); } else {
answers question: http://stackoverflow.com/q/28292816

http://stackoverflow.com/a/28312515
score: 0
has body: If you only want to print any non-null value in the array, instead of printing the whole array I'd use a for loop that only prints non-null values. It'd be something like this... for (i = 0; i &lt; mydata.length; i++) { if(mydata[i]!= null){ console.log(mydata[i]); } }
answers question: http://stackoverflow.com/q/28312448
type: Answer

http://stackoverflow.com/comment/57541379
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28396969
score: 0
has text: I don't see ng-if anywhere in your code, do you mean the ng-show at auth-panel? I think the problem might be that the two scopes for the two controllers are independent of each other.

http://stackoverflow.com/comment/45034003
has text: ah in that case, i feel silly and will be back with an edit to correct
comment on: http://stackoverflow.com/a/28344838
score: 0
type: AnswerComment
type: Comment

leaflet
tags question: http://stackoverflow.com/q/28399939
type: Tag
tags question: http://stackoverflow.com/q/28394867
tags question: http://stackoverflow.com/q/28368118
tags question: http://stackoverflow.com/q/28341742
tags question: http://stackoverflow.com/q/28427986
tags question: http://stackoverflow.com/q/28365969
tags question: http://stackoverflow.com/q/28426522
tags question: http://stackoverflow.com/q/28386532
tags question: http://stackoverflow.com/q/28395487
tags question: http://stackoverflow.com/q/28365791
tags question: http://stackoverflow.com/q/28374026
tags question: http://stackoverflow.com/q/28320928
tags question: http://stackoverflow.com/q/28299256
tags question: http://stackoverflow.com/q/28420883
tags question: http://stackoverflow.com/q/28296948
tag name: leaflet

http://stackoverflow.com/comment/45073043
type: Comment
comment on: http://stackoverflow.com/a/28365684
score: 0
has text: did the sample do what you expected? i built the solution based on that understanding.
type: AnswerComment

http://stackoverflow.com/comment/44929435
comment on: http://stackoverflow.com/a/28287669
has text: It would be unusual for a non-dom object to have a `nodeType`, but you make a good point.
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28405951
has body: ng-repeat is slow, you will know when you have good amount of data to start researching about better performance of ng-repeat. You first question if I change $scope.actions in controller to some other value, would it be updated in ng-repeat? Yes, however if it doesn't work use angular's '$timeout' $timeout(function(){ $scope.actions = []; },0) Your second question Is this the best way to update data values for ng-repeat between view and controller? it is the best way though it is suggested supplementing ng-repeat with limitTo together with Infinite scrolling. Take a look at this stack overflow question
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28405639
answers question: http://stackoverflow.com/q/28405639
upvote count: 1

http://stackoverflow.com/comment/71061872
comment on: http://stackoverflow.com/q/28393105
type: Comment
type: QuestionComment
score: 0
has text: Ok, we will need to spam the Chrome team so that they will know **many** people **need** Chrome Extensions to support UDP/TCP. GO to https://docs.google.com/forms/d/e/1FAIpQLSenHdpA8_eqKiVOrWDjWe_KTfJmoSBEqFIh6SMwQ-NRDJnx1Q/viewform?c=0&w=1&fbzx=5919424429593565000 and type this in:

http://stackoverflow.com/q/28307625
has answer: http://stackoverflow.com/a/28308106
has body: I'm using several CSS animations on a project. My problem is these animations get triggered only once, when scrolling down. I need them to be triggered every time the user scrolls by them, whether going up or down the page. CSS .slideRight{ animation-name: slideRight; -webkit-animation-name: slideRight; animation-duration: 1.5s; -webkit-animation-duration: 1.5s; animation-timing-function: ease-in-out; -webkit-animation-timing-function: ease-in-out; visibility: visible !important; } @keyframes slideRight { 0% { transform: translateX(-150%); } 50%{ transform: translateX(8%); } 65%{ transform: translateX(-4%); } 80%{ transform: translateX(4%); } 95%{ transform: translateX(-2%); } 100% { transform: translateX(0%); } } @-webkit-keyframes slideRight { 0% { -webkit-transform: translateX(-150%); } 50%{ -webkit-transform: translateX(8%); } 65%{ -webkit-transform: translateX(-4%); } 80%{ -webkit-transform: translateX(4%); } 95%{ -webkit-transform: translateX(-2%); } 100% { -webkit-transform: translateX(0%); } } HTML Something JavaScript $(window).scroll(function() { $('.animation-test').each(function(){ var imagePos = $(this).offset().top; var topOfWindow = $(window).scrollTop(); if (imagePos < topOfWindow+400) { $(this).addClass("slideRight"); } }); }); $('.element-to-hide').css('visibility', 'hidden'); JSFiddle
has comment: http://stackoverflow.com/comment/44966540
type: Question
tagged with: javascript
score: 9
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
upvote count: 9
has title: How to Trigger css animation both on scrolling down and up
accepted answer: http://stackoverflow.com/a/28308106
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion

google-chrome
tags question: http://stackoverflow.com/q/28334242
tags question: http://stackoverflow.com/q/28344494
tags question: http://stackoverflow.com/q/28313759
tags question: http://stackoverflow.com/q/28383739
tags question: http://stackoverflow.com/q/28281449
tags question: http://stackoverflow.com/q/28372729
tags question: http://stackoverflow.com/q/28386682
tags question: http://stackoverflow.com/q/28394290
tags question: http://stackoverflow.com/q/28391198
tags question: http://stackoverflow.com/q/28351312
tags question: http://stackoverflow.com/q/28372731
tags question: http://stackoverflow.com/q/28301063
tags question: http://stackoverflow.com/q/28403942
tags question: http://stackoverflow.com/q/28413626
tags question: http://stackoverflow.com/q/28285459
tags question: http://stackoverflow.com/q/28393885
tags question: http://stackoverflow.com/q/28381901
tags question: http://stackoverflow.com/q/28353520
tags question: http://stackoverflow.com/q/28354209
tags question: http://stackoverflow.com/q/28388530
tags question: http://stackoverflow.com/q/28414580
tags question: http://stackoverflow.com/q/28398550
tags question: http://stackoverflow.com/q/28378708
tags question: http://stackoverflow.com/q/28413007
tags question: http://stackoverflow.com/q/28399616
tags question: http://stackoverflow.com/q/28342194
tags question: http://stackoverflow.com/q/28349285
tags question: http://stackoverflow.com/q/28287833
tags question: http://stackoverflow.com/q/28348008
tags question: http://stackoverflow.com/q/28379253
tags question: http://stackoverflow.com/q/28411135
tags question: http://stackoverflow.com/q/28415508
tags question: http://stackoverflow.com/q/28419990
tags question: http://stackoverflow.com/q/28411604
tags question: http://stackoverflow.com/q/28320088
tags question: http://stackoverflow.com/q/28421599
tags question: http://stackoverflow.com/q/28401138
tags question: http://stackoverflow.com/q/28393684
tags question: http://stackoverflow.com/q/28391937
tags question: http://stackoverflow.com/q/28321316
tags question: http://stackoverflow.com/q/28393105
tags question: http://stackoverflow.com/q/28282073
tags question: http://stackoverflow.com/q/28295785
type: Tag
tags question: http://stackoverflow.com/q/28402959
tags question: http://stackoverflow.com/q/28377607
tags question: http://stackoverflow.com/q/28427728
tags question: http://stackoverflow.com/q/28421015
tags question: http://stackoverflow.com/q/28340589
tag name: google-chrome
tags question: http://stackoverflow.com/q/28312778
tags question: http://stackoverflow.com/q/28366849
tags question: http://stackoverflow.com/q/28348587
tags question: http://stackoverflow.com/q/28366865
tags question: http://stackoverflow.com/q/28409881
tags question: http://stackoverflow.com/q/28282221
tags question: http://stackoverflow.com/q/28332106
tags question: http://stackoverflow.com/q/28434311
tags question: http://stackoverflow.com/q/28400437
tags question: http://stackoverflow.com/q/28343748
tags question: http://stackoverflow.com/q/28434937
tags question: http://stackoverflow.com/q/28380078
tags question: http://stackoverflow.com/q/28413591
tags question: http://stackoverflow.com/q/28316589
tags question: http://stackoverflow.com/q/28324153
tags question: http://stackoverflow.com/q/28337409
tags question: http://stackoverflow.com/q/28292580

http://stackoverflow.com/a/28423221
has comment: http://stackoverflow.com/comment/45179722
downvote count: 0
has comment: http://stackoverflow.com/comment/45180532
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28423197
answers question: http://stackoverflow.com/q/28423197
score: 1
has comment: http://stackoverflow.com/comment/45179656
has body: You can't reference the created element by ID because it hasn't been added to the DOM yet and jQuery searches the DOM for ID's. Instead save a reference to the element and attach the click to that. var div = $('&lt;div&gt;').attr('id', 'div'); var link = $('&lt;a&gt;') .attr('href', '#') .attr('id', 'new') .on('click', function(e) { e.preventDefault(); alert('click'); }) .appendTo(div);
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45199613

http://stackoverflow.com/a/28334988
has comment: http://stackoverflow.com/comment/45056943
has comment: http://stackoverflow.com/comment/45263347
accepted answer of: http://stackoverflow.com/q/28334566
has comment: http://stackoverflow.com/comment/45058731
has comment: http://stackoverflow.com/comment/45059164
has comment: http://stackoverflow.com/comment/45058348
has comment: http://stackoverflow.com/comment/45307470
has comment: http://stackoverflow.com/comment/45058160
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45308632
has comment: http://stackoverflow.com/comment/45307926
has comment: http://stackoverflow.com/comment/45058957
has comment: http://stackoverflow.com/comment/45021845
upvote count: 2
has comment: http://stackoverflow.com/comment/45306620
type: Answer
has comment: http://stackoverflow.com/comment/45057867
has comment: http://stackoverflow.com/comment/45306453
has comment: http://stackoverflow.com/comment/45306140
score: 2
has comment: http://stackoverflow.com/comment/45018715
has comment: http://stackoverflow.com/comment/45306551
has comment: http://stackoverflow.com/comment/45304920
has comment: http://stackoverflow.com/comment/45305177
has comment: http://stackoverflow.com/comment/45306626
has comment: http://stackoverflow.com/comment/45058547
has comment: http://stackoverflow.com/comment/45059313
has comment: http://stackoverflow.com/comment/45306529
has body: Maybe you should check the php return data. here: echo "We Have A Result, There Are ".$result-&gt;num_rows." Rows"; see,the return data is not pure json. I think that may be the key. When you expect data for "json", you have to keep the return data is only json ,not anything else.Otherwise ,the ajax will get an parse error which is not displayed directly,and your "success" function will not be executed.And it seems like you don't get the data,but actually it's because you get the wrong format data. It works like this:
answers question: http://stackoverflow.com/q/28334566
downvote count: 0
has comment: http://stackoverflow.com/comment/45308590

http://stackoverflow.com/q/28432486
answer count: 1
has answer: http://stackoverflow.com/a/28432513
tagged with: javascript
type: AnsweredQuestion
has title: How do I get another value in this javascript code(imagepicker)?
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28432513
has body: I want to forward the user to other pages by letting them choose the appropriate image. There is a problem when the user chooses two images. I don't know how to set forwarding when the user chooses these 2 images, any ideas? Here's the tool that I used %windir%\Temp folder . Thanks you guys for help! Kliknij tu i Dołącz do Poliglotów
type: Question
linked to: http://stackoverflow.com/q/5866169
score: 0

http://stackoverflow.com/comment/100645044
type: AnswerComment
comment on: http://stackoverflow.com/a/28301981
type: Comment
score: 2
has text: Piyush, this is now supported directly by Fabric.js. You can zoom the canvas using built in APIs. I wouldn't use this if I were you.

http://stackoverflow.com/comment/45173197
comment on: http://stackoverflow.com/a/28420014
type: Comment
has text: `$.browser` was removed starting in jQuery 1.9 and should not be used.
type: AnswerComment
score: 2

http://stackoverflow.com/q/28303939
score: -1
has title: Wait for functions in for loop to finish
type: Question
possible better answer: http://stackoverflow.com/a/28304344
answer count: 2
tagged with: for-loop
has comment: http://stackoverflow.com/comment/44959130
has answer: http://stackoverflow.com/a/28304344
upvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28304368
tagged with: node.js
favorite count: 0
has body: I have a for loop in NodeJS. Inside the loop is a function that gets data from a database. var player2.schedule = { opponent: //string datetime: //date object } var schedule = ""; for (i=0; i&lt;player2.schedule.length; i++) { User.findOne({ id: player2.schedule[i].opponent }.select("name").exec(function(err, opponent) { schedule += opponent.name; }); } The loop adds to a variable schedule with the results from the database call each time the loop goes round. Now my problem is if I have code after the for loop that relies on this schedule variable, it can't. Because the variable is updated in the callback function from the database call, any code after the for loop happens asynchronously, so the variable hasn't been updated in time. How can I make sure the next batch of code waits for the for loop and callbacks to finish first?
downvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28304368

http://stackoverflow.com/comment/45115191
has text: Could you provide us with a specific reproducable example? Thanks.
comment on: http://stackoverflow.com/q/28324153
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28375673
has body: Did you try removing the single quote's? so your code should look like this: back true
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/28375372
downvote count: 0
score: 1

http://stackoverflow.com/q/28422995
has answer: http://stackoverflow.com/a/28424135
type: AnsweredQuestion
downvote count: 3
accepted answer: http://stackoverflow.com/a/28424135
has comment: http://stackoverflow.com/comment/45180601
type: Question
has body: My Controller: angular.module('apartmentCtrl', []) .controller('ApartmentController', function ($scope, $http, Apartment) { $scope.loading = true; $scope.myLocation = ''; Apartment.get($scope.myLocation).success(function (data) { $scope.apartments = data; $scope.loading = false; }); }); My Service angular.module('apartmentService', []) .factory('Apartment', function ($http) { return { get: function (myLocation) { //return $http.get('/api/apartments'); return $http({ method: 'GET', url: '/api/apartments', //headers: {'Content-Type': 'application/x-www-form-urlencoded'}, params: {location: myLocation} }); } }; }); My HTML: &lt;input type="text" name="myLocation" class="form-control" ng-model="myLocation"&gt; How can I get data from GET method by AngularJS and pass it to params
has comment: http://stackoverflow.com/comment/45180896
upvote count: 0
has comment: http://stackoverflow.com/comment/45178934
tagged with: javascript
has title: AngularJS - How can I get data from GET method
answer count: 1
has comment: http://stackoverflow.com/comment/45179184
favorite count: 0
has comment: http://stackoverflow.com/comment/45179137
tagged with: angularjs
score: -3
has comment: http://stackoverflow.com/comment/45179157
has comment: http://stackoverflow.com/comment/45181664

http://stackoverflow.com/comment/73658965
comment on: http://stackoverflow.com/q/28388885
has text: See http://node.green/
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28502593
answers question: http://stackoverflow.com/q/28429007
score: 0
has body: First of I wan't to give credit to Imyers previous response, it led me on the right track. Anyhow: You can access each group in the grid by: $scope.gridOptions.ngGrid.rowFactory.aggCache Each group has a collapse-value of true|false When the user open or collapses a group I was able to catch the event by adding a custom aggregateTemplate on my gridOptions: $scope.gridOptions = { data: "myData", showGroupPanel: true, aggregateTemplate: "&lt;div ng-click='row.toggleExpand(); saveGroupState()' ng-style='rowStyle(row)' class='ngAggregate ng-scope' style='top: 0px; height: 48px; left: 0px;'&gt;"+ "&lt;span class='ngAggregateText ng-binding'&gt;"+ "{{row.label CUSTOM_FILTERS}} ({{row.totalChildren()}} {{AggItemsLabel}})"+ "&lt;/span&gt;"+ "&lt;div ng-class="{true: 'ngAggArrowCollapsed', false: 'ngAggArrowExpanded'}[row.collapsed]"&gt;&lt;/div&gt;"+ "&lt;/div&gt;" } The saveGroupState() function then saves each rows collapse-state in localStorage based on the rows Label $scope.saveGroupState = function () { var groups = $scope.gridOptions.$gridScope.renderedRows; for (var i = 0; i &lt; groups.length; i++) { localStorage.setItem("taskListGroup_" + groups[i].label, groups[i].collapsed); } } Now you have the states of your groups save in localStorage and a function that catches the toggle event and updating that value. Next step is to simply compare the initial collapse state with your value in localstorage when the ng-grid has loaded and toggle the row if necessary using: $scope.gridOptions.ngGrid.rowFactory.aggCache[rowIndex].toggleExpand(); I realize there are many ways to optimize this, I was simply looking for a way to quickly make it work, a poc. Ideas for improvements are welcome.
type: Answer

http://stackoverflow.com/comment/48204227
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/30028002
has text: @vedant1811 This does provide an answer to the question. The answerer may give this type of response as comment if he have a sufficient reputation.
type: Comment

http://stackoverflow.com/a/45656540
score: 8
answers question: http://stackoverflow.com/q/28405444
has comment: http://stackoverflow.com/comment/78272029
has comment: http://stackoverflow.com/comment/78272353
downvote count: 0
upvote count: 8
type: Answer
has body: React-Responsive will let you use a certain use-case of media queries. It lets you wrap react element elements with media specifications. The wrapped elements will be rendered only if they media specification is met. It's not a general-purpose solution because it doesn't let you add arbitrary css properties.

http://stackoverflow.com/comment/44959453
has text: @TrueBlueAussie It's due to the removal of `return false`. That's stopping the propagation to the delegated event handler.
score: 1
comment on: http://stackoverflow.com/q/28304023
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28434831
answers question: http://stackoverflow.com/q/28428322
has body: It's because you are the same selector class collapsible for two different items. That's collapsible js invocation is doing for the first time invocation on same selector class it is initializing and for the second time it is destroying it. You need to give different selectors for two different items and invoke accordingly javascript accordingly. For first collapsible item- $('.collapsible-item1').collapsible({ accordion : false }); For second collapsible item- $('.collapsible-item1').collapsible({ accordion : false });
score: 0
type: Answer

http://stackoverflow.com/comment/45042562
score: 3
has text: Have you seen https://www.polymer-project.org/docs/polymer/databinding-advanced.html#boundhtml? I'm not sure that it will work with add bindings to light dom nodes though. You could make a copy of distributed nodes though, run injectBoundHTML, and add them to a container in your SD.
comment on: http://stackoverflow.com/q/28349241
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28343585
type: UnansweredQuestion
score: -3
has title: How to put Javascript file (.js file) in a web server?
has body: I want to put javascript in a web server. After that I need to inject that script in c# code using src="http:\...". Please tell me what to do from the beginning
tagged with: webserver
type: Question
has comment: http://stackoverflow.com/comment/45031650
answer count: 1
tagged with: javascript
favorite count: 0
downvote count: 3
has comment: http://stackoverflow.com/comment/45040064
tagged with: c#-4.0
has answer: http://stackoverflow.com/a/28343974
upvote count: 0

http://stackoverflow.com/comment/45135321
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28399697
has text: Thank you for your answer but it didn't work. When I click the button, nothing happens.

http://stackoverflow.com/q/28367048
has title: Google maps api javascript doesn't work in mozilla
favorite count: 0
tagged with: google-maps-api-3
has comment: http://stackoverflow.com/comment/45076407
tagged with: http://stackoverflow.com/tag/html
score: -6
upvote count: 0
type: UnansweredQuestion
tagged with: mozilla
type: Question
tagged with: google-maps
has body: I found a script on google maps api page where user can select location and send data to PHP -> MySQL. It works fine in chrome and IE, but when i try to save location in mozilla, all it does is refresh parent page. I'm pretty much clueless when it comes to javascript, so if anyone can find error, would appreciate it :) Code Google Maps JavaScript API v3 Example: Map Simple
has answer: http://stackoverflow.com/a/28367222
answer count: 1
tagged with: javascript
downvote count: 6

http://stackoverflow.com/comment/45221708
has text: Well, there was a lengthy discussion about ES6 classes and for a variety of reasons we ended up where we are now, with no private variables, unless you count the semi-privacy provided by using Symbol's as keys. As Felix mentioned, you still define any local variables you want in your constructor, and then close around them in methods defined within your constructor, granted not a very elegant solution. At the same time, no one is forcing you to use ES6 classes, and many people say you shouldn't, so you can stay with or go back to whatever idioms you have come to love.
comment on: http://stackoverflow.com/q/28422988
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/28287924
type: Question
tagged with: internet-explorer
tagged with: asp.net-mvc
has title: IE 9 Ajax Request posts null values to MVC App
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
has body: I have an application posting to an asp.net MVC webservice via Ajax. This seems to work like a champ in all browsers except IE 9. What could be causing this? The javascript console.log(data); $.ajax ({ type: 'POST', url: '//localhost:65201/User/CreateAsynch', data: data, cache: false, success: function (response) { // Do stuff }, error: function (xhr, msg) { // Do stuff }}); The Controller This is what happens when I post in IE vs other browsers (Chrome, in this example) See how some of the values are populating? Then there's IE9 Here's what the requests look like (from fiddler) Chrome POST http://localhost:65201/User/CreateAsynch HTTP/1.1 Host: localhost:65201 Connection: keep-alive Content-Length: 184 Accept: */* Origin: http://localhost:56076 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.93 Safari/537.36 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Referer: http://localhost:56076/retail/registrationform/index.html Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.8 Username=drew.j.wyatt%40gmail.com&amp;FirstName=Drew&amp;LastName=Wyatt&amp;Email=drew.j.wyatt%40gmail.com&amp;RawPassword=boom&amp;RawConfirmPassword=boom&amp;CountryCode=USA&amp;UserTypeID=2&amp;RegisterForStore=31 IE9 POST http://localhost:65201/User/CreateAsynch HTTP/1.1 Accept: */* Origin: http://localhost:56076 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko Host: localhost:65201 Content-Length: 184 DNT: 1 Connection: Keep-Alive Pragma: no-cache Username=drew.j.wyatt%40gmail.com&amp;FirstName=Drew&amp;LastName=Wyatt&amp;Email=drew.j.wyatt%40gmail.com&amp;RawPassword=boom&amp;RawConfirmPassword=boom&amp;CountryCode=USA&amp;UserTypeID=2&amp;RegisterForStore=31 What am I missing?
favorite count: 0
tagged with: ajax
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44932067
answer count: 0
upvote count: 1

http://stackoverflow.com/comment/45041317
has text: @ankur - Your example is straddling two different approaches so I can't really tell what it is you're doing. You say the attribute key values are generated dynamically and that's fine. But your javascript functions have hard coded references to the "dynamic" key `da`. Here: `this.salary(this.basic()+this.da()+this.hra());` If `da` is dynamic then how do you expect the javascript to be updated to include other dynamic fields in the calculation?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28348216
type: AnswerComment

http://stackoverflow.com/q/28308249
has comment: http://stackoverflow.com/comment/44967366
accepted answer: http://stackoverflow.com/a/28308474
type: Question
has comment: http://stackoverflow.com/comment/44967568
tagged with: javascript
tagged with: jquery
has body: I have a form, containing a select dropdown, and an input box. The input box should be hidden unless "Other" option is selected from the dropdown. My problem is that there is a button, that clones this code, and create additional copies. I don't know how to manage in JS to show only the input box related to the select dropdown, as i can't number them it's not static. It can be even 10 or just 1. Dietary Requirements None Vegetarian Gluten Free Lactose Free Kosher Other (specify below) Dietary Requirements None Vegetarian Gluten Free Lactose Free Kosher Other (specify below)
answer count: 1
has answer: http://stackoverflow.com/a/28308474
has comment: http://stackoverflow.com/comment/44967590
has comment: http://stackoverflow.com/comment/44967599
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44967591
has title: Hide / Show Dynamically Generated input box with JavaScript
score: 0

http://stackoverflow.com/comment/45128747
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28392358
has text: Did you look at the error? I only misspelled it in the question.
type: Comment

http://stackoverflow.com/comment/45021673
comment on: http://stackoverflow.com/q/28337812
type: Comment
type: QuestionComment
has text: Onchange will do the job
score: 0

http://stackoverflow.com/comment/45111338
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28386825
has text: And your code is...?

http://stackoverflow.com/comment/45097874
type: AnswerComment
score: 0
type: Comment
has text: Correct, that would be a better solution, it saves cache busting for no reason
comment on: http://stackoverflow.com/a/28377846

http://stackoverflow.com/q/28390231
type: Question
tagged with: function
tagged with: firefox
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28391402
tagged with: html-table
score: 0
answer count: 2
has title: Table Format Issues and Functions not working
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28390260
accepted answer: http://stackoverflow.com/a/28390260
has answer: http://stackoverflow.com/a/28391402
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45118003
has body: I programed a simple tic-tac-toe game. When the table shows up it is all squished. Is there a way to keep the table empty but not squished? Also, I'm using NotePad++ and when I try to run my program in FireFox the functions do not work. I'm not sure why, anyone know? I can get it to work in Chrome, but it needs to be able to work in FireFox. Here is my program: Tic-Tac-Toe! message will be here Start New Game

http://stackoverflow.com/comment/44935960
has text: Thanks, missed your response. Was looking at Eric J's.Will try both
comment on: http://stackoverflow.com/q/28291202
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28372994
tagged with: meteor
favorite count: 0
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28372995
has body: How do you use jQuery to synchronize the scrolling of two divs of a template in meteor? Where should this jQuery code be placed in the .js file?
downvote count: 1
type: Question
has title: [Meteor][jQuery] Synchronize the scrolling of two divs
tagged with: javascript
tagged with: jquery
score: -1
upvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/28372995

http://stackoverflow.com/a/28433114
answers question: http://stackoverflow.com/q/28387775
has body: with Aurelia, you can install dependent libraries using jspm. you can see an example of that here. jspm will get the packages for you and bring them into subfolders in your project. jspm uses an index (stored in config.js) to know where to locate the files (similar to how requirejs, but works for amd, commonjs, and es6 modules). there is also an example of using the aurelia libraries with requirejs amd loader. this example uses a bundle of aurelia libraries generated by r.js as shown here
score: 0
type: Answer

http://stackoverflow.com/comment/45114479
type: Comment
comment on: http://stackoverflow.com/q/28387805
type: QuestionComment
has text: the values getting posted in the console
score: 0

http://stackoverflow.com/q/28297744
score: 2
has comment: http://stackoverflow.com/comment/44948036
answer count: 0
has body: I am trying to change the allowed file extensions of a valums file uploader that is being used by a (wordpress) plugin I have to use. Since I don't want to change the plugin's source files, I am trying to set these from outside of the plugin. The plugin init's the FileUploader within a closure and does not expose the variable. Is there a way to access the instances of the FileUploaders via the global qq or otherwise? I examined the qq object in the console and checked out the source code but don't see any way to access it's instances :/. If there is no way to access it, is it possible to destroy and rebuild the instances of the FileUploader without having access to the var it was assigned to? Update: this is how the plugin creates the file uploader: (function($){ // ... var BpfbPhotoHandler = function () { var createMarkup = function () { // ... var uploader = new qq.FileUploader({ "element": $('#bpfb_tmp_photo')[0], "listElement": $('#bpfb_tmp_photo_list')[0], "allowedExtensions": ['jpg', 'jpeg', 'png', 'gif'], "action": ajaxurl, "params": { "action": "bpfb_preview_photo" }, "onSubmit": function (id) { //... }, "onComplete": createPhotoPreview, template: '...' }); }; }; // ... })(jQuery); Thanks.
type: Question
has comment: http://stackoverflow.com/comment/44947554
tagged with: javascript
tagged with: jquery
tagged with: valums-file-uploader
has title: How to get instance of valums FileUploader from outside of closure
downvote count: 0
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44957679

http://stackoverflow.com/q/28356623
type: AnsweredQuestion
tagged with: npm
upvote count: 2
type: Question
has answer: http://stackoverflow.com/a/28361498
has body: I have been creating some React.js components and publishing them as modules to npm. I am using the following gulp task to convert all of my jsx components into js, using gulp-react: var react = require('gulp-react'); gulp.task('react', function () { return gulp.src('./jsx/*.jsx') .pipe(react({ harmony: true })) .pipe(gulp.dest('./js/')); }); So in my published module I have components in the js and jsx folder. My question is which is it better to point the main file to in my package.json? js "main": "js/todo.js", or jsx "main": "jsx/todo.jsx", I would assume if I point them to the jsx then they will need to have gulp-react installed, so would I add that into peerDependencies?
tagged with: reactjs
answer count: 2
score: 2
downvote count: 0
tagged with: javascript
tagged with: gulp
accepted answer: http://stackoverflow.com/a/28361498
favorite count: 0
possible better answer: http://stackoverflow.com/a/44418187
has title: When exporting reactjs components as node modules to npm, do I include jsx or js
has answer: http://stackoverflow.com/a/44418187
tagged with: node.js

http://stackoverflow.com/comment/45022918
type: AnswerComment
comment on: http://stackoverflow.com/a/28337973
type: Comment
has text: I am trying to console log the req.body.data but it is undefined. Can you please answer me with more info. Thanks
score: 0

knockout.js
tags question: http://stackoverflow.com/q/28363596
tags question: http://stackoverflow.com/q/28348391
tags question: http://stackoverflow.com/q/28371228
tags question: http://stackoverflow.com/q/28308987
tags question: http://stackoverflow.com/q/28388458
tags question: http://stackoverflow.com/q/28388996
tags question: http://stackoverflow.com/q/28433589
tags question: http://stackoverflow.com/q/28315672
tags question: http://stackoverflow.com/q/28412319
tags question: http://stackoverflow.com/q/28328629
tags question: http://stackoverflow.com/q/28383200
tag name: knockout.js
tags question: http://stackoverflow.com/q/28369613
tags question: http://stackoverflow.com/q/28389259
tags question: http://stackoverflow.com/q/28300809
tags question: http://stackoverflow.com/q/28312661
tags question: http://stackoverflow.com/q/28414166
tags question: http://stackoverflow.com/q/28332604
tags question: http://stackoverflow.com/q/28283953
tags question: http://stackoverflow.com/q/28295132
tags question: http://stackoverflow.com/q/28342211
tags question: http://stackoverflow.com/q/28364257
type: Tag
tags question: http://stackoverflow.com/q/28401922
tags question: http://stackoverflow.com/q/28286620
tags question: http://stackoverflow.com/q/28282043
tags question: http://stackoverflow.com/q/28371477
tags question: http://stackoverflow.com/q/28381353
tags question: http://stackoverflow.com/q/28366997
tags question: http://stackoverflow.com/q/28363977
tags question: http://stackoverflow.com/q/28305555
tags question: http://stackoverflow.com/q/28415912
tags question: http://stackoverflow.com/q/28287040
tags question: http://stackoverflow.com/q/28345940
tags question: http://stackoverflow.com/q/28349163
tags question: http://stackoverflow.com/q/28374086
tags question: http://stackoverflow.com/q/28299896
tags question: http://stackoverflow.com/q/28301842

http://stackoverflow.com/comment/44952560
has text: @BrunoLowagie - Thanks Bruno :) I love the variable's name!
comment on: http://stackoverflow.com/q/28289963
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45187870
has text: @roy james-Sir Simple blank activity is showing when i use second url.
comment on: http://stackoverflow.com/q/28427540
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/44934058
type: QuestionComment
has text: @localghost tried that as well with the same issue.
comment on: http://stackoverflow.com/q/28286505
score: 0
type: Comment

http://stackoverflow.com/comment/45191644
type: QuestionComment
has text: oops didn't read question properly. `$('#btn_click').click(function() { $('#check_list').val() });`
comment on: http://stackoverflow.com/q/28430403
score: 0
type: Comment

http://stackoverflow.com/q/28367526
has comment: http://stackoverflow.com/comment/45075994
has comment: http://stackoverflow.com/comment/45083722
type: Question
linked to: http://stackoverflow.com/q/20689481
has body: My problem is similar to this question but I need an answer in javascript. It is very simple to achieve this in jquery. I also debug the jquery file but it seems more confusing to me. //if there is any ajax request document.getElementById("loader").style.display="block"; //on success: document.getElementById("loader").style.display="none";
linked to: http://stackoverflow.com/q/8567114
tagged with: javascript
has comment: http://stackoverflow.com/comment/45076728
score: 0
has comment: http://stackoverflow.com/comment/45076328
has comment: http://stackoverflow.com/comment/45079740
has title: How to know if there if any xhr request made and success on document using javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45083746
linked to: http://stackoverflow.com/q/9740939
answer count: 0

http://stackoverflow.com/comment/45012958
has text: I am aware that I can just change to button to an anchor link like I stated on my previous comment but I want to know if there is a way without changing the structure of the form or the button.
comment on: http://stackoverflow.com/q/28332800
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44992870
score: 1
comment on: http://stackoverflow.com/q/28319995
has text: What does not work? What happens? What errors do you get?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44923308
has text: @JonathanSampson Hey, I used to be an IE fanboy a long time ago. I'm more than willing to give you guys a fighting chance!
type: AnswerComment
comment on: http://stackoverflow.com/a/28284236
score: 0
type: Comment

http://stackoverflow.com/q/28309576
has comment: http://stackoverflow.com/comment/44973249
has comment: http://stackoverflow.com/comment/44970209
favorite count: 0
tagged with: cross-domain
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/44972569
linked to: http://stackoverflow.com/q/24633393
type: UnansweredQuestion
tagged with: iframe
has comment: http://stackoverflow.com/comment/44970240
duplicate of: http://stackoverflow.com/q/24633393
upvote count: 1
has comment: http://stackoverflow.com/comment/44972897
has answer: http://stackoverflow.com/a/28309985
score: 1
linked to: http://stackoverflow.com/q/11769066
has title: Access an element inside a dynamically-created, cross-domain iFrame?
type: Question
has body: I want to access an element inside an iFrame, but because of the way the iFrame is being called, I am not succeeding. This is the target page (www1.k9webprotection.com/...). The iframe is on a different subdomain: &lt;iframe src="http://license.k9webprotection.com/..." ...&gt;&lt;/iframe&gt; Setting a timeout or an event listener for when the iframe is loaded, did not help.
has comment: http://stackoverflow.com/comment/44972315
tagged with: greasemonkey
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/45018072
comment on: http://stackoverflow.com/a/28335955
type: AnswerComment
score: 0
type: Comment
has text: Awesome. Another thing I just noticed is that if you click new row twice then column 2 it becomes funky. Do you know how to solve this?

http://stackoverflow.com/q/28395667
tagged with: onclick
tagged with: forms
type: Question
answer count: 3
possible better answer: http://stackoverflow.com/a/28395812
has answer: http://stackoverflow.com/a/28395796
has comment: http://stackoverflow.com/comment/45127608
has answer: http://stackoverflow.com/a/28395812
tagged with: javascript
favorite count: 0
score: 0
has answer: http://stackoverflow.com/a/28395821
tagged with: http://stackoverflow.com/tag/html
has body: In the body of the HTML page is a button that calls the Javascript function from an onclick event, and in the head is the Javascript function that I would like to run with more permanent results. Quoi,Qui : Ville : N°Département : Valeurs par défaut But if same function is called in the body tag on load the page, the changes are permanent. My question is perhaps due to my lack of knowledge of Javascript !
accepted answer: http://stackoverflow.com/a/28395821
has comment: http://stackoverflow.com/comment/45127569
upvote count: 1
downvote count: 1
has title: Why js function does not change the html code permanently?
tagged with: onload
has comment: http://stackoverflow.com/comment/45127681
type: AnsweredQuestion

http://stackoverflow.com/q/28301372
has comment: http://stackoverflow.com/comment/44965376
has body: I am trying to rebuild this intro effect using ScrollMagic and GSAP: http://airnauts.com Notice how the intro 'slides' (with text) show and dissappear one after another when scrolling. Basically, I have set up a stage controller, a scene (the containing div - '.hero-unit') and some tweens for the animation. However, I just can't get the hang of how to animate each slide (three in total) in such a order: You enter the website and start scrolling. The first slide is animated (using the staggerFromTo method). When the slide is fully animated, lower its opacity back to 0 (or move it out of the screen or whatever). Show the second slide, as in 2. Same as 3. and so on. I tried everything that I managed to find as a solution on the internet. I tried using 'TimelineMax', tried hiding the slides when done animating them with onComplete, but nothing seems to work. Here's the code I have so far: var pinOrigin = { opacity: 0 }; var pinEnd = { opacity: 1, yoyo: true, ease: Back.easeOut } var tl = TweenMax.staggerFromTo('.hero-unit .scene:first-of-type', 1, {opacity:0}, {opacity: 1}); var pin = new ScrollScene({ triggerElement: '.hero-unit', triggerHook: 'onLeave', duration: 1000 }).setPin('.hero-unit').setTween(tl).addTo(controller); To recap: how does one manage to stage different scenes and change between them with a nice transition while scrolling??
upvote count: 3
has answer: http://stackoverflow.com/a/28307288
type: AnsweredQuestion
score: 3
has title: Animating multiple scenes in a sequence with ScrollMagic
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28307288
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28317517
downvote count: 0
tagged with: gsap
favorite count: 0
accepted answer: http://stackoverflow.com/a/28317517
tagged with: scrollmagic

http://stackoverflow.com/q/28322098
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/28359216
favorite count: 0
has comment: http://stackoverflow.com/comment/44992347
score: 2
has title: How do i make toggle from left whitout jquery-ui
upvote count: 2
accepted answer: http://stackoverflow.com/a/28359216
tagged with: toggle
type: AnsweredQuestion
has body: How do i make toggle from left without using jquery-ui Javascript $(document).ready(function(){ $("button").click(function(){ $("#content").slideToggle(); }); }); HTML This is a paragraph. my toggle CSS #content { background:khaki; padding:10px; } jsfiddle
tagged with: javascript
type: Question

http://stackoverflow.com/q/28344233
type: Question
tagged with: livecycle-designer
answer count: 1
tagged with: javascript
has title: LiveCycle : Looping through dynamic checkboxes
score: 0
has answer: http://stackoverflow.com/a/29262466
type: UnansweredQuestion
has body: I am new to LiveCycle and javascript. I am working on a form which dynamically populates values from a web service call. I have to use these valus to filter out some pre populated values. The dynamically populated values has check boxes to it. I need to go through this dynamically populated values and return corresponding clciked value of the checkbox. I tried many things to access the value of the dynamic checkbox like Root.subformpath.resolveNode.("checkboxname["+ i +"]").rawValue to try to loop through values. But it always returns null value. this.checkboxname.rawValue on click event returns the dynamic name. But I need to loop through all checkbox every time a click event happens

http://stackoverflow.com/comment/45193727
type: Comment
has text: Thank you very much. It seems pretty straight forward, but my sound is still not playing. Where am i supposed to store the song file? And yes, i am trying to make a piano :)
comment on: http://stackoverflow.com/a/28367079
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45143729
type: Comment
type: QuestionComment
has text: You just got only one downvote.. :/ (_I didn't downvote you_)
comment on: http://stackoverflow.com/q/28404078
score: 0

http://stackoverflow.com/comment/45162193
comment on: http://stackoverflow.com/a/28414373
type: Comment
score: 0
type: AnswerComment
has text: Good too. I chosed the other answer only because it is close to my actual code. Thanks a lot to boths!

http://stackoverflow.com/comment/44953525
score: 1
has text: hard to say with the information you have given us, possibly some kind of permissions issue, I would highly recommend using WAMP, MAMP or something similar, it will help resolve these and other issues down the line
comment on: http://stackoverflow.com/q/28301063
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28318986
has comment: http://stackoverflow.com/comment/44987662
tagged with: node.js
has comment: http://stackoverflow.com/comment/44987170
upvote count: 2
has body: How to call method with callback in cycle? Suppose I need to call http.get but be sure that only one request is awaiting response in a time (that is not putting too much presser on a server) http.get(url, function(res) { console.log("Got response: " + res.statusCode); }).on('error', function(e) { console.log("Got error: " + e.message); });
has answer: http://stackoverflow.com/a/28320768
type: Question
has title: Node.js: How to call method with callback in a cycle?
has answer: http://stackoverflow.com/a/28322585
tagged with: javascript
has comment: http://stackoverflow.com/comment/44987100
answer count: 2
score: 2
downvote count: 0
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/45147422
has text: After using the nav-btn open and close and when resizing larger than 1000px 3 of the 4 navigation items disappear.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28406445

http://stackoverflow.com/a/28280930
accepted answer of: http://stackoverflow.com/q/28280902
answers question: http://stackoverflow.com/q/28280902
score: 4
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44916047
type: Answer
upvote count: 4
downvote count: 0
has body: When you're calling it with the loop, aren't you missing the second parameter? from traverseUp(elParent); to traverseUp(elParent, attr); ?

http://stackoverflow.com/comment/45156546
comment on: http://stackoverflow.com/a/28411041
has text: No, page 2 just contain several div's. Page 2 does'n have head.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45044289
comment on: http://stackoverflow.com/q/28350236
type: QuestionComment
has text: because the developer uses a JS Engine that supports it?
type: Comment
score: 0

http://stackoverflow.com/comment/64233743
comment on: http://stackoverflow.com/a/28393175
type: AnswerComment
has text: @Mario: It seems sockets only work in apps (for ChromeOS), not extensions.
type: Comment
score: 1

list
type: Tag
tags question: http://stackoverflow.com/q/28415926
tag name: list
tags question: http://stackoverflow.com/q/28400400
tags question: http://stackoverflow.com/q/28307338
tags question: http://stackoverflow.com/q/28285505
tags question: http://stackoverflow.com/q/28377352

http://stackoverflow.com/a/28437294
has comment: http://stackoverflow.com/comment/45225890
type: Answer
has body: That's not correct. The feed edge is basically an array of Post objects. You can use the Field Expansion together with time pagination as follows: GET /{page_id}/feed?fields=id,shares,likes.summary(true)&amp;since={start_unix_timestamp}&amp;until={end_unix_timestamp} See https://developers.facebook.com/docs/graph-api/reference/v2.2/page/feed/#read https://developers.facebook.com/docs/graph-api/using-graph-api/v2.2#fieldexpansion https://developers.facebook.com/docs/graph-api/using-graph-api/v2.2#paging
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28436851
has comment: http://stackoverflow.com/comment/45215834
answers question: http://stackoverflow.com/q/28436851
upvote count: 2
has comment: http://stackoverflow.com/comment/45234266
type: AcceptedAnswer

http://stackoverflow.com/q/28410843
has title: XML : Remove parent, clone to siblings
answer count: 1
has comment: http://stackoverflow.com/comment/45156964
has comment: http://stackoverflow.com/comment/45155168
accepted answer: http://stackoverflow.com/a/28411442
tagged with: http://stackoverflow.com/tag/xml
tagged with: xpath
type: AnsweredQuestion
has body: My source xml: // x number of items // x number of items // x number of pricelists Now, would like to build an editor for given xml that automatically: I. Removes all the unwanted parents, based on their children attribute values. In my example: Delete all where is x,y. I partially solved this one. The selection is /company/pricelist[category[@id='90' or @id='89']] that now has to be removed, probably removeChild(); II. Clone and into all sibling s. I have no clues yet how to start on this one. I was thinking of a loop which goes through all the pricelists, copies their and and somehow clones them to the each of the sibling inside the pricelist (category and subcategory are unique under each pricelist). Step II result: cat1 sub1 cat1 sub1 cat1 sub1 cat1 sub1 ...
type: Question
has comment: http://stackoverflow.com/comment/45155516
tagged with: javascript
has answer: http://stackoverflow.com/a/28411442
score: 0

http://stackoverflow.com/comment/45180707
type: Comment
has text: Thank you Barmar, May you guide me the way to pull my array into html please? Can't find any info
comment on: http://stackoverflow.com/a/28423863
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45596568
has text: Thanks. i also use to like creating everything my self(and sometime still do) but if there's something already working and working good. there's no reason re inventing the wheel - if that makes sense :-)
type: AnswerComment
comment on: http://stackoverflow.com/a/28620814
score: 0
type: Comment

http://stackoverflow.com/comment/45161744
comment on: http://stackoverflow.com/q/28414199
has text: Have you tried running it through a debugger and see what happens?
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/28303762
has title: How to add two radial progress bars (JS) in the same page
type: Question
answer count: 1
has answer: http://stackoverflow.com/a/28303883
tagged with: javascript
tagged with: jquery
tagged with: progress-bar
score: 0
has body: I'm trying to insert two identical radial progress bars in the same page but the code for the second one is ignored/invisible. It's surely a JS issue so I'm here to ask your help. JS Code: var el = document.getElementById('graph'); // get canvas var options = { percent: el.getAttribute('data-percent') || 25, size: el.getAttribute('data-size') || 120, lineWidth: el.getAttribute('data-line') || 10, rotate: el.getAttribute('data-rotate') || 0 } var canvas = document.createElement('canvas'); var span = document.createElement('span3'); span.textContent = options.percent + '%'; if (typeof(G_vmlCanvasManager) !== 'undefined') { G_vmlCanvasManager.initElement(canvas); } var ctx = canvas.getContext('2d'); canvas.width = canvas.height = options.size; el.appendChild(span); el.appendChild(canvas); ctx.translate(options.size / 2, options.size / 2); // change center ctx.rotate((-1 / 2 + options.rotate / 180) * Math.PI); // rotate -90 deg //imd = ctx.getImageData(0, 0, 240, 240); var radius = (options.size - options.lineWidth) / 2; var drawCircle = function(color, lineWidth, percent) { percent = Math.min(Math.max(0, percent || 1), 1); ctx.beginPath(); ctx.arc(0, 0, radius, 0, Math.PI * 2 * percent, false); ctx.strokeStyle = color; ctx.lineCap = 'round'; // butt, round or square ctx.lineWidth = lineWidth ctx.stroke(); }; drawCircle('#efefef', options.lineWidth, 100 / 100); drawCircle('#555555', options.lineWidth, options.percent / 100); Each of the bars are called in the body using a container div with a unique id: &lt;div id="graph"&gt;&lt;/div&gt; How can I use this code twice in the same page or / How can I display this progress bar twice? Thank you!
type: UnansweredQuestion

http://stackoverflow.com/q/28309629
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44971056
has title: Have image open in its own page with information
score: -6
favorite count: 0
downvote count: 6
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44971062
has comment: http://stackoverflow.com/comment/44970950
type: Question
has comment: http://stackoverflow.com/comment/45877709
has body: I have a page with images on it. Each image has information associated with it, and when the image is clicked I'd like to have it open in its own page (not a new tab or window) with some of the associated information displayed around it. Is there a way to do this where I don't have to manually make a page for each image? I'm dealing with a large set of pictures so automation is key.
has comment: http://stackoverflow.com/comment/44970467
upvote count: 0
has comment: http://stackoverflow.com/comment/44970845
answer count: 1
has answer: http://stackoverflow.com/a/28310726
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28310726

adobe-analytics
tags question: http://stackoverflow.com/q/28379214
tag name: adobe-analytics
tags question: http://stackoverflow.com/q/28319498
type: Tag

http://stackoverflow.com/comment/45059880
has text: i have the api, (slim api) ready and working for reading the mysql table records; and using the angularjs factory service to access and store the data
score: 0
comment on: http://stackoverflow.com/q/28346334
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28340833
has body: how to check check box and getting whether checkbox is checked in javascript selenium and node. I tried using .click on the element also tried using native javascript code to do that.but nothing worked for me. driver.findElement(webdriver.By.id('//* [@id="myTable"]/table/tbody/tr[1]/td[1]/input')). then(function(element){ element.click().then(function(){//body goes here }; I have edited the code in SO itself so there might be braces problem.in actual code its not the braces problem. any solutions to do so?
favorite count: 0
has title: how to check check box and getting whether checkbox is checked in javascript selenium
has comment: http://stackoverflow.com/comment/45027252
has comment: http://stackoverflow.com/comment/45026779
upvote count: 1
tagged with: checkbox
tagged with: node.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28540699
tagged with: selenium
downvote count: 1
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45026944
has comment: http://stackoverflow.com/comment/45026633
answer count: 1
has answer: http://stackoverflow.com/a/28540699

http://stackoverflow.com/q/28355621
has comment: http://stackoverflow.com/comment/45055203
has title: Pub/Sub in Javascript explaination needed
has comment: http://stackoverflow.com/comment/45055176
has comment: http://stackoverflow.com/comment/45054791
answer count: 0
has comment: http://stackoverflow.com/comment/45054851
type: Question
has comment: http://stackoverflow.com/comment/45055126
tagged with: javascript
has body: im trying to understand the pub/sub design pattern with Pluralsight and there is a line of code that i don't understand. there is arguments in each method of js that like array but it is not. and in the pub method they use the arguments to iterate and invoke each callback and return those arguments that the method was sending. it looks like this: define("EventHandler", [], function () { var cache = {}; return { pub: function(id) { var args = [].splice.call(arguments, 1); if (!cache[id]) cache[id] = []; for (var i = 0; i &lt; cache[id].length; i++) { cache[id][i].apply(null, args); } }, sub: function(id, callback) { if (!cache[id]) cache[id] = [callback]; else cache[id].push(callback); } }}); the line that i dont understand is: var args = [].splice.call(arguments, 1); thanks in advance.
score: 0
has comment: http://stackoverflow.com/comment/45054803
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45055116

http://stackoverflow.com/a/28390448
has body: Well.. it's a bitwise NOT, so you can use it when working with bits. As for practical applications when you normally don't find yourself working with bits, here's a little trick: if (~arr.indexOf(val)) doStuff(); //instead of if (arr.indexOf(val) &gt; -1) doStuff(); --edit-- I realize I didn't see you ask for an explanation for using ~ with indexOf. Simply put, ~-1 evaluates to 0. When you are using an if statement, 0 is a false value. It's a shorthand way for writing arr.indexOf(val) &gt; -1.
upvote count: 1
answers question: http://stackoverflow.com/q/28390381
downvote count: 0
type: Answer
score: 1

http://stackoverflow.com/a/28301320
downvote count: 0
score: 1
upvote count: 1
type: Answer
has body: Ok there's a ton of things wrong here, I've been at it for about 30 minutes and I haven't found everything. Here's where I've made it to: http://jsfiddle.net/4j4y2rq3/4/ First you were missing brackets. $(document).ready(function { $("#search").click(function({ I added them in my fiddle. I then fixed the element ids called in the validation to match the input fields. I cut some of the useless code, and replaced some of the calls in your if statements to correspond to an element, rather than the text value of the input. (i.e you cannot do this $('input').val().hasClass("valid")) Some fixes that still need to occur: Near the bottom you have a bunch of code like $("result").show(); That is calling a tag like &lt;result&gt; you need to make an element with an id or class called result, then make it look like this $('.result') or $('#result') You'll also need to trigger the validation before you post. If you trigger the validation of the form submission on the submit/#search, the post will override all of your javascript.
answers question: http://stackoverflow.com/q/28299852

http://stackoverflow.com/a/28314657
type: Answer
answers question: http://stackoverflow.com/q/28314514
has comment: http://stackoverflow.com/comment/44979548
has body: I highly suggest to use http://api.jquery.com/jquery.post/ instead of writing old JS Ajax. Still if you feel using the old system, you can do it by... parameter1='bio='+document.getElementById('bio').value; parameter2='good='+document.getElementById('good').value; postdata = parameter1 + parameter2; xmlhttp.send(postdata);
score: 0
has comment: http://stackoverflow.com/comment/44979320

http://stackoverflow.com/comment/45133253
score: 0
comment on: http://stackoverflow.com/a/28398025
type: AnswerComment
type: Comment
has text: Thank you both, having a conceptual understanding helps a great deal. Coming from other OOPs that I am also learning, its good to understand the distinctions. Appreciate your time =)

http://stackoverflow.com/q/28285776
tagged with: jquery
has comment: http://stackoverflow.com/comment/44926533
has comment: http://stackoverflow.com/comment/44926695
downvote count: 0
tagged with: jsp
has comment: http://stackoverflow.com/comment/44925740
favorite count: 0
has title: Hide or show an input when a checkbox is checked or unchecked in JSP file
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: checkbox
has body: Can anyone explain me why this piece of code does not work in Eclipse. I tried to compile the code on this site http://jsfiddle.net and it's working. <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> Insert title here
answer count: 0
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44940357
type: Question
tagged with: javascript

http://stackoverflow.com/comment/45122990
type: Comment
has text: @webkit Would not help. As I understand the question, the other link could appear anywhere on the page. It's not generally sensible to solve this with CSS.
comment on: http://stackoverflow.com/a/28392722
score: 0
type: AnswerComment

http://stackoverflow.com/a/28314028
has body: To dynamically style using Knockout, we do not generally use the style binding any longer, in the same sense that we no longer use the style attribute any longer, either. In the Knockout documentation, take a look at the Knockout CSS binding. Create a Knockout observable or Knockout computed observable on your model, and then using the CSS binding, de-reference that observable. Your observable should store or compute the CSS class that should be attached to your element, and simply return a string representing the class name. Then go off to the side and write your CSS class or classes.
downvote count: 1
score: 0
has comment: http://stackoverflow.com/comment/59164825
has comment: http://stackoverflow.com/comment/44978844
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28299896

http://stackoverflow.com/comment/45078506
has text: thks for your help :)
type: AnswerComment
comment on: http://stackoverflow.com/a/28368144
score: 1
type: Comment

http://stackoverflow.com/comment/45121629
type: Comment
has text: Nice, I still seem to have it stuck in a call back how ever! I just want to use it now when I get back into my exports.StartApiCall for example I want this to be set to var result and then bellow the myRequest.call() use the variable result
comment on: http://stackoverflow.com/a/28391946
type: AnswerComment
score: 0

http://stackoverflow.com/q/28284702
has comment: http://stackoverflow.com/comment/44923373
downvote count: 2
has body: I found some .JS scripts, but am now converting them to C# (I understand C# better). I'm stuck on this seemingly simple statement: JS: if (Physics.Raycast (transform.position - Vector3(0,0.25,0), Vector3(0,-1,0), hit)){} Error msg is no overload method takes these arguments. is it because 0.25 is a double and not float? tried the literal's f. What I've tried in C#: if (Physics.Raycast (transform.position - new Vector3(0,0.25,0), new Vector3(0,-1,0), hit)){} (I get overload(float,float,float) error on first new Vector3) if (Physics.Raycast (transform.position - new Vector3(0.0f,0.25f,0.0f), new Vector3(0,-1,0), hit)){} if (Physics.Raycast (transform.position - new Vector3(0.0f,0.2f,0.0f), new Vector3(0,-1,0), hit)){} Vector3 tempVec = new Vector3(0.0f,0.25f,0.0f); Vector3 tempVec2 = new Vector3(0,-1,0); if (Physics.Raycast (transform.position - tempVec, tempVec2, hit)){} I've tried lots more, but you get the point. If it is a double issue, then how was it in a Vector3 overload in the first place? and how can I put it back in in c#? Update: 'new Vector3(0.0f,0.25f,0.0f)' and 'new Vector3(0,-1,0)' works outside of the 'if' statement. But inside, I now get the Error: 'The best overloaded method match for 'UnityEngine.Physics.Raycast(UnityEngine.Vector3, UnityEngine.Vector3, out UnityEngine.RaycastHit)' has some invalid arguments'
type: Question
accepted answer: http://stackoverflow.com/a/28285562
tagged with: c#
upvote count: 0
score: -2
tagged with: javascript
has title: new vector3(float, float, float) overload error?
has comment: http://stackoverflow.com/comment/44923659
has comment: http://stackoverflow.com/comment/44923618
has comment: http://stackoverflow.com/comment/44923640
has comment: http://stackoverflow.com/comment/44924036
answer count: 1
has comment: http://stackoverflow.com/comment/44924522
has comment: http://stackoverflow.com/comment/44924667
favorite count: 0
has answer: http://stackoverflow.com/a/28285562
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44924359

http://stackoverflow.com/a/28285998
answers question: http://stackoverflow.com/q/28285900
has body: Look at your last if statement in the ShiftGears function: if(FrontLeftWhell.rpm * GearRatio[i]&gt;MinEngineRPM){ Your loop is using j as the current index, but you are using i to access the GearRatio array. Use j here instead.
score: 0
type: Answer

http://stackoverflow.com/a/77141459
answers question: http://stackoverflow.com/q/28337009
score: 0
has body: In Ext4 you can add KeyMap on any editable component like this: var map = new Ext.util.KeyMap( Ext.getCmp('textfield').getEl(), [{ key: [10,13], fn: function(ord, e){ alert("Enter was pressed inside textfield"); } }, { key: "abc", fn: function(){ alert('a, b or c was pressed'); } } ]); If you want to listen keyboard events on a divs, don't forget to set an element focusable: autoEl: { tabindex: 0 }. Here is an KeyMap example for textfield, empty panel and on a window: textfield, panel, window KeyMap example
type: Answer

http://stackoverflow.com/a/28310860
score: 1
type: AcceptedAnswer
downvote count: 0
has body: underscore.js might be useful. Underscore is a JavaScript library that provides a whole mess of useful functional programming helpers without extending any built-in objects. var JSONArray = [ {'key1':'a1','key2':'a2','key3':'a3'}, {'key1':'b1','key2':'b2','key3':'b3'} ]; _.map(JSONArray, function (x) { return _.omit(x, 'key3') }); =&gt; [{'key1':'a1','key2':'a2'}, {'key1':'b1','key2':'b2'}] Working sample
type: Answer
has comment: http://stackoverflow.com/comment/44972656
has comment: http://stackoverflow.com/comment/44972809
upvote count: 1
answers question: http://stackoverflow.com/q/28310796
accepted answer of: http://stackoverflow.com/q/28310796

http://stackoverflow.com/comment/45028772
type: QuestionComment
type: Comment
has text: @doldt i changed this however the console is still not called
score: 0
comment on: http://stackoverflow.com/q/28342046

http://stackoverflow.com/q/28404639
tagged with: css
answer count: 0
score: 1
has body: As the title says, the ion-slide-box's pager point will disappears when when scrolling ion-content up and down on device. Anyone know what's happening? how to fix this problem?
upvote count: 1
tagged with: ionic-framework
type: Question
tagged with: javascript
downvote count: 0
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: The ion-slide-box's pager point will disappears when when scrolling ion-content up and down

http://stackoverflow.com/a/28426973
score: 1
has comment: http://stackoverflow.com/comment/45185762
accepted answer of: http://stackoverflow.com/q/28426548
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28426548
has comment: http://stackoverflow.com/comment/45190424
type: Answer
upvote count: 1
has body: i will do like dddd1919 says and add the parameter spide to the url in homecontroller : myApp.controller("HomeController", function ($scope, $http,GENERAL_CONFIG,$filter) { $scope.callGetDetail = function(spider){ console.log("callGetDetail"); $location.path("/YourDomaine/#/details/getdetailsbyspider="+spider); } }); in the view where you want to make the call, home.html &lt;tbody&gt; &lt;tr ng-repeat="row in finished"&gt; &lt;td&gt; {{row.project}} &lt;/td&gt; &lt;td&gt; &lt;a href="#details" ng-click="callGetDetail(row)"&gt; {{row.spider}}&lt;/a&gt; &lt;/td&gt; in the router when('/details/:params', { templateUrl: 'Details.html', controller: 'detailsController' }). in the detailsController: myApp.controller("detailsController", function ($scope, $http, GENERAL_CONFIG, $filter,$routeParams) { $scope.getdetailsbyspider = function(spider){ console.log("getdetailsbyspider "+ spider) } function myUrlToArray(url) { var paramsFormatted = {}; var paramstmp = decodeURI(url).split("&amp;"); for (var index = 0; index &lt; paramstmp.length; ++index) { var tmp = paramstmp[index].split("="); paramsFormatted[ tmp[0] ] = tmp[1]; } return paramsFormatted; } var params = myUrlToArray($routeParams.params) if(params.getdetailsbyspider != null ){ $scope.getdetailsbyspider(params.getdetailsbyspider); } });
has comment: http://stackoverflow.com/comment/45190758

http://stackoverflow.com/comment/45035276
has text: @Andy I am sure that it is working since I changed the typo error (query instead of list). getting these values. But I want to get the value of JID from item node. item = item = item =
score: 0
comment on: http://stackoverflow.com/q/28345272
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28348807
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45042229
has comment: http://stackoverflow.com/comment/45042298
favorite count: 0
has comment: http://stackoverflow.com/comment/45041666
has comment: http://stackoverflow.com/comment/45041938
type: UnansweredQuestion
score: -4
has comment: http://stackoverflow.com/comment/45041757
has comment: http://stackoverflow.com/comment/45041723
has title: Send click event on button loaded dynamically
has comment: http://stackoverflow.com/comment/45041692
has answer: http://stackoverflow.com/a/28349049
tagged with: dom
has answer: http://stackoverflow.com/a/28349045
type: Question
answer count: 2
downvote count: 4
upvote count: 0
has comment: http://stackoverflow.com/comment/45041712
tagged with: javascript
tagged with: jquery
has body: So this is slightly different than all the posts I have found on the subject. I have a button that gets loaded dynamically via Jquery, I save the selector of this button and later on in my code I need to send a click event (Emulate someone clicking on the button) Now normally I would just use $('#myID').click(); and this casts a click. But Since my button is loaded dynamically this does not work. Now I do NOT need to handle the onclick event. I could use $(document).on('click', '#myId',function(e){}); for that. I need to actually send the click event. I have tried .click(); .on('click); .onClick(); .trigger('click'); Any ideas?

http://stackoverflow.com/q/28318113
score: 0
accepted answer: http://stackoverflow.com/a/28318535
has body: I've just started learning JavaScript and got a pretty basic question. I'm going to create a function I call printAnyRange() that takes two arguments: rangeStart and rangeStop. I want this to return a string with all numbers comma-separated in the range. If rangeStart is smaller than rangeStop it should call the function printRange(). If rangeStart is greater than rangeStop it should call the function printRangeReversed(). My question is, should I use a for loop to do this or would it be better with if-else?
type: AnsweredQuestion
type: Question
answer count: 2
tagged with: for-loop
has answer: http://stackoverflow.com/a/28318339
tagged with: if-statement
tagged with: function
has answer: http://stackoverflow.com/a/28318535
has title: For loop or if-statement?
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28318339

http://stackoverflow.com/q/28311196
upvote count: 21
score: 19
type: Question
has answer: http://stackoverflow.com/a/28311228
tagged with: javascript
answer count: 3
has comment: http://stackoverflow.com/comment/44975562
favorite count: 0
possible better answer: http://stackoverflow.com/a/55472292
accepted answer: http://stackoverflow.com/a/28311228
has body: Just wondering why i got an error with the following simple JavaScript function function highest(){ return arguments.sort(function(a,b){ return b - a; }); } highest(1, 1, 2, 3); Error messsage : TypeError: arguments.sort is not a function. I am confused as arguments it is an array (i thought). Please help and explain why. Many thanks
has answer: http://stackoverflow.com/a/55472292
has comment: http://stackoverflow.com/comment/44973256
has title: Javascript arguments.sort() throw error sort is not a function
has answer: http://stackoverflow.com/a/51859940
type: AnsweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/44973269

http://stackoverflow.com/a/28310981
accepted answer of: http://stackoverflow.com/q/28310958
upvote count: 4
answers question: http://stackoverflow.com/q/28310958
score: 4
has body: here render() will also return a promise so I cannot just use the $.ajax promise because load.then(function() { ..... }) should run after rend() completes. Yes you can! That's just the power of then over done: it chains the actions, waiting for the result of the callback (render()) before resolving the returned promise. Use load: function(){ return $.ajax(…).then(function(resp){ // ^^^^ if(resp.error) return $.Deferred().reject(resp.error); … return render(); }); // this will resolve with the result of your render() promise // (or be rejeced with the .error) },
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/a/28435296
score: 0
has body: I recently encountered this issue with my own development and was unable to find a CSS solution that worked consistently with the browsers that the site needed to support. The other answers suggest using word-break: break-word, which will work well in some modern browsers, but some browsers interpret this the same as word-break: break-all. I presume that you are using server-side code to create the table. One way to accommodate older browsers is to break up long words by inserting a zero-width space (&amp;#8203;), giving those older browsers a clue where long words can be broken. When receiving the text, my code would find words longer than 20 characters and break the word into 20-character portions with the zero-width space.
answers question: http://stackoverflow.com/q/28434798
type: Answer

http://stackoverflow.com/comment/45130996
has text: Well you could build the link's query in PHP, containing all the data from $_GET, and stick that in the link (using just html / php).
comment on: http://stackoverflow.com/a/28396914
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28410097
type: Answer
upvote count: 1
has body: I would recommend searching for answers before submitting a new post, we call this research. Loading external pages into a div Stackoverflow: How to load external html into a div? Toggle element Stackoverflow: toggle show/hide div with button?
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28409566

http://stackoverflow.com/q/28375965
type: Question
has comment: http://stackoverflow.com/comment/45093186
has body: I'm trying to show() a div whenever the user submits the form. The whole site is one page. Currently when you submit it, the form is submitted, then .confirmation div shows up for about 1 second and then it goes away, the page refreshes and the div is gone. This is my HTML Thanks for contacting us. We will be in touch with you shortly. Name Email Phone Message Submit CSS .confirmation { display: none; } This is my PHP <?php /* Set e-mail recipient */ $myemail = "krm218@gmail.com"; /* Check all form inputs using check_input function */ $name = $_POST['inputName']; $email = $_POST['inputEmail']; $phone = $_POST['inputPhone']; /* $inquiry = $_POST['inputInquiry']; */ $message = $_POST['inputMessage']; /* Let's prepare the message for the e-mail */ $subject = "Cleaning Services Contact or Estimate"; $message = " Victorias Cleaning Services Contact Form Name: $name Email: $email Phone: $phone Message: $message "; /* Send the message using mail() function */ mail($myemail, $subject, $message); /* Redirect visitor to the thank you page */ header('Location: index.html#contact'); exit(); ?> and a scripts.js file $('#submit-button').click(function(){ $(".confirmation").show(); }); Thanks in advance!!
has answer: http://stackoverflow.com/a/28376594
tagged with: javascript
has comment: http://stackoverflow.com/comment/45092790
answer count: 2
has comment: http://stackoverflow.com/comment/45093164
has comment: http://stackoverflow.com/comment/45093111
has comment: http://stackoverflow.com/comment/45092829
tagged with: submit
has title: Show message in div in submit form
has comment: http://stackoverflow.com/comment/45092773
has comment: http://stackoverflow.com/comment/45093211
accepted answer: http://stackoverflow.com/a/28376594
has comment: http://stackoverflow.com/comment/45093524
has comment: http://stackoverflow.com/comment/45092263
tagged with: php
type: AnsweredQuestion
score: 0
possible better answer: http://stackoverflow.com/a/28376020
tagged with: forms
has answer: http://stackoverflow.com/a/28376020

http://stackoverflow.com/q/28408520
tagged with: onchange
has body: I have a asp.net web page which contains many textboxes. If any of these boxes I run some javascript via the onchange event of each field. The javascript basically changes a textbox to 'Y' so I know which section of the page has changed something. Everything works fine, however I just need to know if there is a way of making the onchange call better/shorter ? Since I have over >100 textboxes, there is a lot of repetitive onchange='CM('3'); on each and every textbox, so I am hoping there is a better way to handle this. There are three divs, each containing some 35 textboxes, so perhaps there is a way of doing it by DIV, which I don't know. Any guidance is appreciated. &lt;asp:TextBox ID="txtDC1_D" runat="server" CssClass="STD_desc160" onchange="CM('3');"&gt;&lt;/asp:TextBox&gt; &lt;asp:TextBox ID="txtDC1_C" runat="server" CssClass="STD_cur30" onchange="CM('3');"&gt;&lt;/asp:TextBox&gt; &lt;asp:TextBox ID="txtDC1_1" runat="server" CssClass="STD_value55" onchange="CM('3');"&gt;&lt;/asp:TextBox&gt; &lt;asp:TextBox ID="txtDC1_2" runat="server" cssClass="STD_value55" onchange="CM('3');"&gt;&lt;/asp:TextBox&gt; &lt;asp:TextBox ID="txtDC1_3" runat="server" cssClass="STD_value55" onchange="CM('3');"&gt;&lt;/asp:TextBox&gt; &lt;asp:TextBox ID="txtDC1_B" runat="server" CssClass="STD_bassis" onchange="CM('3');"&gt;&lt;/asp:TextBox&gt; &lt;br /&gt; &lt;asp:TextBox ID="txtDC2_D" runat="server" CssClass="STD_desc160" onchange="CM('2');"&gt;&lt;/asp:TextBox&gt; &lt;asp:TextBox ID="txtDC2_C" runat="server" CssClass="STD_cur30" onchange="CM('2');"&gt;&lt;/asp:TextBox&gt; &lt;asp:TextBox ID="txtDC2_1" runat="server" CssClass="STD_value55" onchange="CM('2');" &gt;&lt;/asp:TextBox&gt; &lt;asp:TextBox ID="txtDC2_2" runat="server" cssClass="STD_value55" onchange="CM('2');" &gt;&lt;/asp:TextBox&gt; &lt;asp:TextBox ID="txtDC2_3" runat="server" cssClass="STD_value55" onchange="CM('2');" &gt;&lt;/asp:TextBox&gt; &lt;asp:TextBox ID="txtDC2_B" runat="server" CssClass="STD_bassis" onchange="CM('…
has answer: http://stackoverflow.com/a/28408676
has title: asp.net - javascript better way to use onchange with multiple fields
score: 0
has comment: http://stackoverflow.com/comment/45151033
answer count: 1
tagged with: javascript
type: UnansweredQuestion
tagged with: asp.net
has comment: http://stackoverflow.com/comment/45152185
type: Question

http://stackoverflow.com/comment/45213781
has text: This is kind of working a bit better now if I only call the first expect and remove $rootScope.$digest. If I keep the $rootScope digest in the first expect fails Error: Unexpected request: GET which is trying to load one of the projects html templates. The other 2 expects also make the test fail
comment on: http://stackoverflow.com/a/28427810
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28308566
accepted answer: http://stackoverflow.com/a/28367955
has comment: http://stackoverflow.com/comment/45000715
has body: I have been trying to follow along on the video here: http://www.telerik.com/videos/platform/building-mobile-apps-using-telerik-platform---part-i According to the tutorial, from the todos page (which is the main page), when I click the drawer icon/button, then the drawer page should show up. But, my drawer won't open - in Chrome debugger, I keep getting this error: "Uncaught TypeError: Cannot read property 'openFor' of undefined" when I click on the drawer icon. Any help? I am using the in-browser client. Samething is happening with the popup/modal for the new todo. My code is below for the todos.html: Code for categories.html: Categories New
tagged with: telerik-appbuilder
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44996224
type: Question
has answer: http://stackoverflow.com/a/28367955
answer count: 1
tagged with: javascript
tagged with: kendo-ui
score: 0
tagged with: telerik
has title: Drawer will not open from main page

http://stackoverflow.com/comment/45193237
comment on: http://stackoverflow.com/a/28423847
has text: ok! in thath case just uncomment it and all will work fine ( I already edited the post and jsfiddle)
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/28331217
type: Answer
upvote count: 7
has body: Try with this code, it should work. var successHandler = function(position) { alert(position.coords.latitude); alert(position.coords.longitude); }; var errorHandler = function (errorObj) { alert(errorObj.code + ": " + errorObj.message); alert("something wrong take this lat " + 26.0546106 ); alert("something wrong take this lng " +-98.3939791); }; navigator.geolocation.getCurrentPosition( successHandler, errorHandler, {enableHighAccuracy: true, maximumAge: 10000});
has comment: http://stackoverflow.com/comment/45020596
score: 7
accepted answer of: http://stackoverflow.com/q/28330219
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28330219
downvote count: 0
has comment: http://stackoverflow.com/comment/99791571
has comment: http://stackoverflow.com/comment/45020684

http://stackoverflow.com/q/28392651
has body: I want to filter nested array using angularjs filter in controller. following is my sample data dummy=[ { category:'TV', data:[ { title: 'Game of Thrones', path: 'some data1', }, { title: 'Game of Thrones-SD', path: 'some data2' }, { title: 'Game of Thrones-HD', path: 'some data3' }, { title: 'Game of Thrones-Trailer 1', path: "some data4" }, { title: 'Game of Thrones-Trailer 2', path: "some data5" }, { title: 'Game of Thrones-Trailer 3', path: "Ssome data6" }, { title: 'The Vampire Diaries ', path: 'some data7' }, { title: 'The Vampire Diaries -SD', path: 'some data8' }, { title: 'The Vampire Diaries -HD', path: 'some data9' }, { title: 'The Vampire Diaries -Trailer 1', path: 'some data10' } ] }, { category:'LIVE', data:[ { title: 'Game of Thrones - Live Show', path: 'some data11' }, { title: 'The Vampire Diaries - Live Show', path: 'some data11' } ] } ]; for example i want to filter the data on title, so if i search "game of thrones" i want to get following data { category:'TV', data:[ { title: 'Game of Thrones', path: 'some data1', }, { title: 'Game of Thrones-SD', path: 'some data2' }, { title: 'Game of Thrones-HD', path: 'some data3' }, { title: 'Game of Thrones-Trailer 1', path: "some data4" }, { title: 'Game of Thrones-Trailer 2', path: "some data5" }, { title: 'Game of Thrones-Trailer 3', path: "Ssome data6" }, ] }, { category:'LIVE', data:[ { title: 'Game of Thrones - Live Show', path: 'some data11' } ] } I think similar question has been asked here Angularjs filter nested object and i tried to use the following code in my controller but it did not worked var filterdData = $filter('filter')(content, {data: [{title: $scope.filterKey}]});
has answer: http://stackoverflow.com/a/34775082
type: Question
has comment: http://stackoverflow.com/comment/46241255
has comment: http://stackoverflow.com/comment/45122415
has title: Angular Js Filtering nested array in controller
tagged with: javascript
answer count: 2
tagged with: filter
upvote count: 1
has answer: http://stackoverflow.com/a/38007043
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45131895
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45133386
linked to: http://stackoverflow.com/q/18504779
downvote count: 0
has comment: http://stackoverflow.com/comment/45130807
score: 1

http://stackoverflow.com/comment/45113225
score: 0
has text: This means that all your code has to use strings for data paths. Yes, it can be made to work (this question has been examined many other times here on SO), but IMO it make for really ugly code for ALL the accessing of the data - not to mention a lot slower to execute. I'd be surprised if this was actually the cleanest way to write the overall code.
type: AnswerComment
comment on: http://stackoverflow.com/a/28387845
type: Comment

http://stackoverflow.com/a/28388321
has comment: http://stackoverflow.com/comment/45114192
has comment: http://stackoverflow.com/comment/45114359
has body: It's working fine for me: http://jsfiddle.net/8kzdx9wz/ nav bar Is your HTML written correctly and do you have enough content to scroll down to 800px on the page?
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28388268
has comment: http://stackoverflow.com/comment/45114269

http://stackoverflow.com/comment/45096022
type: Comment
has text: @FabrícioMatté Hmm, are you sure, you didn't do "module = undefiend"?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28377914

http://stackoverflow.com/q/28403798
tagged with: signalr
type: Question
tagged with: c#
answer count: 2
tagged with: asp.net-mvc-5
possible better answer: http://stackoverflow.com/a/28403883
tagged with: .net
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/30093185
has body: I am using SignalR in MVC 5 and trying to create the connection with my Hub class (MyHub.cs) through JavaScript but getting below error message : Uncaught TypeError: Cannot read property 'client' of undefined Here is my code from which I am trying to create connection to SignalR : var client= $.connection.myHub; I have explored lot on google but not getting any relevant solution. Please help me to figure out this problem. Thanks in advance.
has title: SignalR Issue : Cannot connect to Hub class
accepted answer: http://stackoverflow.com/a/30093185
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28403883

http://stackoverflow.com/q/28427854
score: 3
has comment: http://stackoverflow.com/comment/45187281
has answer: http://stackoverflow.com/a/28428042
upvote count: 3
has answer: http://stackoverflow.com/a/28436930
has answer: http://stackoverflow.com/a/28427903
tagged with: yii
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
accepted answer: http://stackoverflow.com/a/28428767
answer count: 5
has title: Need to call one javascript function before all ajax and jquery post function
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28428319
downvote count: 0
has answer: http://stackoverflow.com/a/28428767
possible better answer: http://stackoverflow.com/a/28427903
tagged with: php
has body: I have various function with the ajax and $.post syntax which gives call to the server function. But when session gets expired and page is not refreshed my ajax code wont work. In this I want to redirect the page to login controller. As it this is ajax call my redirection code is not working. Is there any code or JavaScript/jQuery function which gets executed before any other jquery ajax and post function. I am using PHP(Yii framework) on server side. Please let me know. Thank you.
type: Question

http://stackoverflow.com/a/28370902
score: 1
has comment: http://stackoverflow.com/comment/45088279
answers question: http://stackoverflow.com/q/28370406
downvote count: 0
type: Answer
has body: $("#formID").on("submit", function(){ //use the condition in your example if(condition==true){ return true; } else{ //display some reason why the form was not submitted. return false; } });
upvote count: 1
has comment: http://stackoverflow.com/comment/45087729

http://stackoverflow.com/comment/45034753
has text: have updated the code
score: 0
comment on: http://stackoverflow.com/q/28345244
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28373360
has comment: http://stackoverflow.com/comment/45087503
has comment: http://stackoverflow.com/comment/45087743
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45087346
score: 0
has answer: http://stackoverflow.com/a/28373455
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/45087499
has comment: http://stackoverflow.com/comment/45087939
has comment: http://stackoverflow.com/comment/45088025
has comment: http://stackoverflow.com/comment/45088124
type: UnansweredQuestion
has title: Delete selected rows from HTML Tables
has comment: http://stackoverflow.com/comment/45087601
has comment: http://stackoverflow.com/comment/45087218
has body: I am trying to delete selected rows (via checkbox) but I don't understand where I am going wrong this is my code JQuery $("#delete").click(function(){ $("table input[type ='checkbox']:checked").parent().parent().remove(); }); HTML Delete Selected Name Number Date The user enters the rows which is why my table by default only has headings. I have stuck on this for a while now and no research is helping me solving the problem. Please help if anyone can, Thanks in advance.
has comment: http://stackoverflow.com/comment/45087416
has comment: http://stackoverflow.com/comment/45088305
has comment: http://stackoverflow.com/comment/45088507
has comment: http://stackoverflow.com/comment/45087387
type: Question

http://stackoverflow.com/q/28343333
has answer: http://stackoverflow.com/a/28343533
answer count: 3
has title: How to create a hide and show FAQ?
has body: I am doing a FAQ page for my website and currently I am stuck in a place. I want to create a page such that on clicking the question the answer is shown and on clicking another question should open and the previous answer should hide automatically. to some far I was successful in doing it, I could open a new question and the previous question was hiding and the new questions answer was shown. But if i go and click on the previous question again it didn't open. here is the code that I had written $(document).ready(function() { $("#container li").click(function() { $("#container p").slideUp(); var text = $(this).children('div.panel'); if (text.is(':hidden')) { text.slideDown('200'); $(this).children('span').html('-'); } else { text.slideUp('200'); $(this).children('span').html('+'); } }) }); #container { list-style: none; font-family: arial; font-size: 20px; } #container li { margin: 10px; border-bottom: 1px solid #ccc; position: relative; cursor: pointer; } #container h3 { margin: 0; font-size: 24px; } #container span { position: absolute; right: 5px; top: 0; color: #000; font-size: 18px; } #container .panel { margin: 5px 0; display: none; } this is first + Hello this is second + helelo this is third + how are you
upvote count: 1
downvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45031843
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28343469
tagged with: css
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28343428
type: Question

http://stackoverflow.com/q/28372873
score: 0
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45103941
has comment: http://stackoverflow.com/comment/45086870
tagged with: java
accepted answer: http://stackoverflow.com/a/28372969
type: Question
has body: I'm developing an app with phonegap and i want to add text size option for users. but i want this text size change saves to app so when the user reopen the app the text size stays the same he/she choose the last time?
answer count: 1
tagged with: javascript
tagged with: android
has title: change font size option for mobile web app?
has answer: http://stackoverflow.com/a/28372969
tagged with: cordova

http://stackoverflow.com/a/28321536
upvote count: 7
score: 7
has body: First you need to find the inside width of the div. You can use for it: $("#divOverflowHidden")[0].scrollWidth Now you need to calculate the position of the element that must be something like this: {element index} * {overflow hidden div inside width} / {number of elements} The code should be something like this: index * $("#divOverflowHidden")[0].scrollWidth / total Now you need to move the scroll bar to the right position using $("#divOverflowHidden").scrollLeft() if you have a horizontal scroll bar or $("#divOverflowHidden").scrollTop() if you have a vertical scroll bar. The result is that the element will be shown in the left of the overflowed div. To centralize the element, you could subtract the result of the calculation, a half of the external width of the overflowed div. So the new formula is: (({element index} * {overflow hidden div inside width}) / {number of elements}) - ({overflow hidden div ouside width} / 2) Finaly... ((index * $("#divOverflowHidden")[0].scrollWidth) / total) - $("#divOverflowHidden").width() / 2)
downvote count: 0
answers question: http://stackoverflow.com/q/28320941
type: Answer

http://stackoverflow.com/q/28376903
possible better answer: http://stackoverflow.com/a/28376948
answer count: 4
favorite count: 0
has body: trying to brush up on some basic javascript and I'm wondering how you would solve this. I found a way but it's pretty ugly and I'd appreciate some more experienced eyes letting me know what they thing. Basically, just iterate over the numbers 1-100 and print all even numbers in groups of five on each line. So line one would be 2,4,5,8,10, line 2 is 12,14,16,18,20. Here is what I have so far: var counter = 0; var line=[]; for(var i = 0; i&lt;=100; i++){ if(i%2==0){ if(line.length &lt;5){ line[counter] = i; counter++ }else{ console.log(line); line=[]; counter=0; line[counter] =i; } } } console.log(line); Thanks so much!
upvote count: 1
tagged with: loops
accepted answer: http://stackoverflow.com/a/28376990
type: AnsweredQuestion
has title: Print even numbers from 1-100 with 5 numbers per line
score: -2
downvote count: 3
has answer: http://stackoverflow.com/a/28376983
type: Question
has answer: http://stackoverflow.com/a/28377092
tagged with: for-loop
has answer: http://stackoverflow.com/a/28376948
tagged with: javascript
tagged with: iteration
has answer: http://stackoverflow.com/a/28376990

http://stackoverflow.com/comment/45234266
comment on: http://stackoverflow.com/a/28437294
has text: Because I need all the likes and comments on a post, but it only gives you the 25 first items. So I have to make more calls for the likes,eg `/{post-i}/likes?after=...`
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44964182
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28288205
has text: Thanks, that was exactly the problem. For some reason that didn't occur to me at all.

http://stackoverflow.com/a/28296139
downvote count: 0
score: 1
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28294145
has body: I am showing another approach where you can set the current item to any element, and it will show the next prev arrows accordingly. $(function() { var updateDiv = function(trigger) { var currentDiv = $(".current"); $("#group div").removeClass("current").hide(); if (trigger.hasClass("next") && currentDiv.next("div").length > 0) { currentDiv.next("div").addClass("current").show(); } else if (trigger.hasClass("prev") && currentDiv.prev("div").length > 0) { currentDiv.prev("div").addClass("current").show(); } updateNavigation(); }; var updateNavigation = function() { var intialDiv = $(".current"); intialDiv.show(); var intialDivIndex = intialDiv.index(); intialDivIndex > 0 ? $("#prev").show() : $("#prev").hide(); intialDivIndex < totalDivs - 1 ? $("#next").show() : $("#next").hide(); }; var totalDivs = $("#group div").length; updateNavigation(); $("#next, #prev").on("click", function() { updateDiv($(this)); }); }); #group div { border: 1px solid red; width: 100px; height: 100px; } #next { margin-left: 100px; } one two three four five six seven eight next prev SUBMIT

http://stackoverflow.com/comment/45121777
has text: You're welcome :) I will take a look at it. It's recommended to post a new question describing what you are trying to achieve and the current problem. This way others get a chance to help as well.
type: AnswerComment
comment on: http://stackoverflow.com/a/28391790
score: 0
type: Comment

http://stackoverflow.com/q/28387511
type: Question
type: AnsweredQuestion
has title: Javascript OOP variables from class
tagged with: javascript
has answer: http://stackoverflow.com/a/28387517
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/28387517
upvote count: 2
score: 1
has body: Ey everyone, I am trying to make a javascript class and get its data off the class. Here's a snippet of the code: var App = { data: { string = "String" } login: function() { return alert(data.string); } } var me = App.login(); Well, what I am trying to accomplish is getting the string value off data and alert it. What am I doing wrong?
downvote count: 1

http://stackoverflow.com/comment/45237711
comment on: http://stackoverflow.com/a/28383819
type: AnswerComment
score: 0
type: Comment
has text: @web-tiki , thnks for this info !! i'll keep this slink in my fvorites :), see you there once in a while.

http://stackoverflow.com/q/28406809
tagged with: zurb-foundation
tagged with: ajax
has title: Foundation - Interchange - other than html
type: UnansweredQuestion
has body: I'm using Foundation Interchange to dynamically load content into my page. It work's great with html files. BUT: How to use it to load other file-formats, concretely .tpl in my case. This works fine: This does not work (tpl instead of html): Just nothing happens. The tpl-files are not getting loaded. An idea anybody?
tagged with: foundation-interchange
type: Question
has answer: http://stackoverflow.com/a/28410366
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28415897
answer count: 2

http://stackoverflow.com/a/28416768
type: AcceptedAnswer
has body: Hi i have edit your form a bit to try to reach your expectation Request a Quote Please complete the form at the right to contact a representative regarding your request. Sensor Type Select One J K Voltage Select One 120V 240V Amps Select One 10 15 Channels Select One 1 Sensor Connector Select One NEMA ML2 Mini Twist Lock (Standard) Thermocouple Select One JType KType i had set the main inputs to hidden and than create a main input where the js will add the text of the hidden input so the user can easily copy it. I wrote the javascript in an easy way there will be probably other way to reach the same result without force listing each input in an if condition
type: Answer
answers question: http://stackoverflow.com/q/28415355
accepted answer of: http://stackoverflow.com/q/28415355
has comment: http://stackoverflow.com/comment/45170282
score: 0

http://stackoverflow.com/comment/45093438
score: 0
type: AnswerComment
type: Comment
has text: All his php code is doing is rendering markup.. Lots of themes do this.. I feel kind of dirty every time I see it and use it but eh...
comment on: http://stackoverflow.com/a/28376608

http://stackoverflow.com/comment/45085040
type: Comment
type: QuestionComment
has text: @j08691 oh you know me
comment on: http://stackoverflow.com/q/28372267
score: 2

http://stackoverflow.com/q/28334648
score: 0
has body: I'm trying to prank one of my close friends so i'm working on a imacros script but I'm having a hard time trying to get it to write on a text field. I'm guessing its because its a div is there any way around this? Imarcros script VERSION BUILD=8881205 RECORDER=FX TAG POS=2 TYPE=DIV ATTR=TXT:Add<SP>a<SP>comment... TAG POS=1 TYPE=DIV ATTR=CLASS:Pf&&TXT: TAG POS=1 TYPE=DIV ATTR=ID:z13pzjwrelzadpbrv04cehphklu1tjxzemc0k.editor The html
type: UnansweredQuestion
has title: Imacros script won't write on text field
has comment: http://stackoverflow.com/comment/45015964
has comment: http://stackoverflow.com/comment/45016063
answer count: 0
type: Question
tagged with: imacros
tagged with: javascript

http://stackoverflow.com/comment/44981021
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28315879
has text: betwwen chrome-chrome or firefox -chrome?
type: Comment

http://stackoverflow.com/q/28381790
answer count: 1
linked to: http://stackoverflow.com/q/4214731
type: UnansweredQuestion
tagged with: coffeescript
has title: coffee scripts doesn't work in my ruby app
has answer: http://stackoverflow.com/a/28383843
tagged with: javascript
has comment: http://stackoverflow.com/comment/45104194
type: Question
has comment: http://stackoverflow.com/comment/45103522
tagged with: ruby
has body: I try to add js actions in my ruby app. I read The asset pipeline & Working with JavaScript in Rails guides but I can't reproduce what is described in the second one. I'm a beginner in rails so perhaps I made too much "manipulations" with files, there extensions... I have a controller "mycontroller" app/controllers/mycontroller_controller.rb class mycontrollerController < ApplicationController def new end end application.js app/assets/javascripts //= require jquery //= require jquery_ujs //= require turbolinks //= require bootstrap-sprockets //= require_tree . mycontroller.coffee app/assets/javascripts When I load the app in a browser, assets seem to be correctly included Question: do I have to rename .coffee files in .js.coffee? I tried but nothing change. I followed "Working with JavaScript in Rails" and modified my files like that: new.html.erb app/views/mycontroller Paint it red mycontroller.coffee app/assets/javascripts paintIt = (element, backgroundColor, textColor) -> element.style.backgroundColor = backgroundColor if textColor? element.style.color = textColor I think coffee script is correctly compiled : (function() { var paintIt; paintIt = function(element, backgroundColor, textColor) { element.style.backgroundColor = backgroundColor; if (textColor != null) { return element.style.color = textColor; } }; }).call(this); But nothing happens by clicking... any idea ? Thanks in advance for our help.
score: 0
tagged with: ruby-on-rails

http://stackoverflow.com/comment/45130906
has text: @dshockey I've added more to my answer to try to clarify
comment on: http://stackoverflow.com/a/28392342
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45151033
has text: is jQuery also an option ?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28408520
score: 0

http://stackoverflow.com/q/28366997
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/45081530
tagged with: javascript
score: 0
has body: i am not very familiar with Knockoutjs. so i was reading article on Knockoutjs. this is the url http://www.c-sharpcorner.com/UploadFile/raj1979/display-data-using-knockout-in-mvc-4/ from where i was reading. i do not understand Knockoutjs related code. &lt;script type="text/javascript"&gt; function EmployeeViewModel() { var self = this; //Declare observable self.EmployeeID = ko.observable(""); self.FirstName = ko.observable(""); self.LastName = ko.observable(""); self.City = ko.observable(""); self.Region = ko.observable(""); self.PostalCode = ko.observable(""); self.Country = ko.observable(""); var Employee = { EmployeeID: self.EmployeeID, FirstName: self.FirstName, LastName: self.LastName, City: self.City, Region: self.Region, PostalCode: self.PostalCode, Country: self.Country }; self.Employee = ko.observable(); self.Employees = ko.observableArray(); // Initialize the view-model $.ajax({ url: '@Url.Action("GetAllEmployees", "Employee")', cache: false, type: 'GET', contentType: 'application/json; charset=utf-8', data: {}, success: function (data) { self.Employees(data); } }); $(document).ready(function () { var viewModel = new EmployeeViewModel(); ko.applyBindings(viewModel); }); } &lt;/script&gt; i understand that first EmployeeViewModel() function is called. i understand this way declared observable property. problem area 1 var self = this; self.EmployeeID = ko.observable(""); self.FirstName = ko.observable(""); self.LastName = ko.observable(""); self.City = ko.observable(""); self.Region = ko.observable(""); self.PostalCode = ko.observable(""); self.Country = ko.observable(""); but i do not understand the below code.....just see and tell me what it is doing problem area 2 var Employee = { EmployeeID: self.EmployeeID, FirstName: self.FirstName, LastName: self.LastName, City: self.City, Region: self.Region, PostalCode: self.PostalCode, Country: self.Country }; self.Employee = ko.observable(); self.Employees = ko.observableArray(); just do not understand how each E…
answer count: 1
has answer: http://stackoverflow.com/a/28367187
has comment: http://stackoverflow.com/comment/45086481
accepted answer: http://stackoverflow.com/a/28367187
tagged with: mvvm
has comment: http://stackoverflow.com/comment/45076764
type: AnsweredQuestion
has title: Need to understand Display data using Knockout in MVC 4
tagged with: knockout.js
type: Question

http://stackoverflow.com/a/28401933
has comment: http://stackoverflow.com/comment/45142193
has comment: http://stackoverflow.com/comment/45142132
upvote count: 1
has comment: http://stackoverflow.com/comment/45142320
answers question: http://stackoverflow.com/q/28401679
type: AcceptedAnswer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28401679
has body: Since your code looks a little like pseudo-code (unanswered questions in it for me), the best I can offer is a framework of an idea. The general idea is that you return two things from your search function, a promise that is resolved only when both ajax calls are resolved and an abort function that can be called to abort the process. function search(options) { var activeAjax = $.ajax(args for first ajax call).then(function(data) { // second ajax call changes activeAjax so abort will work // on the active ajax call activeAjax = $.ajax(args for second ajax call).then(function(data) { activeAjax = null; // collect your final data here and return it // this will be the resolved value of the final promise return finalData; }); return activeAjax; }); return { promise: activeAjax, abort: function() { if (activeAjax) { activeAjax.abort(); } } }; } // usage: var searchInProgress = search(...); searchInProgress.promise.then(function(data) { // search finished successfully, answer is in data }, function(err) { // either one of the promises failed }); // and, at any time, you can call searchInProgress.abort();
has comment: http://stackoverflow.com/comment/45142595
type: Answer

http://stackoverflow.com/q/28361171
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28361203
upvote count: 2
answer count: 2
has body: Does anyone know how I would use jQuery to subtract 1 from a current css value of several divs with the same class on a click? I have 5 divs with the same class, each have their own z-index setting. I want to subtract 1 from their current value when I click on one div. My goal is to bring one div forward on click setting z-index to 100. I then want to subtract 1 from the others' current value (whatever that is) on that same click to send them back. $('.classname').mousedown(function() { $(this).css("z-index", "100"); $(this).siblings().css("z-index", - 1); }); }); This code just sets all the siblings z-index to -1. Thanks for any help. I'm also open to suggestions on a better way to do this.
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: 2
has title: Using jQuery to subtract 1 from a current css value on several divs
has comment: http://stackoverflow.com/comment/45085417
type: Question
has answer: http://stackoverflow.com/a/28363686
has comment: http://stackoverflow.com/comment/45064884

http://stackoverflow.com/a/28334387
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45026080
has body: This code works for both positive and negative numbers - nothing simple, but self explanatory. Good luck with the job.. var tests = ['9007199254740992','999999999999999999','-999999999','-0','-80','800','99'] function addOne(num){ if (Math.abs(parseInt(num,10)) == 0){return '1'}; var numArray = num.split(''), answer = []; var sign = 1; if (numArray[0] == '+' || numArray[0] == '-'){ if (numArray[0] == '-'){sign = -1}; numArray.splice(0,1); } var idx = numArray.length; var next_int = 0; var carry = 1; /* first add 1 */ while(idx-- &amp;&amp; carry != 0){ next_int = parseInt(numArray[idx],10) + (sign * carry); if (sign &gt; 0){ answer[idx] = (next_int &gt;= 10 ? next_int - 10 : next_int) carry = (next_int &gt;= 10 ? 1 : 0) } else { answer[idx] = (next_int == -1 ? 9 : Math.abs(next_int)); carry = (next_int == -1 ? 1 : 0) } if (carry == 0){ while(idx--){ answer[idx] = numArray[idx] } } } if (sign &gt; 0){ return (carry == 0 ? answer.join('') : carry + answer.join('')); } else { return ('-' + answer.join('')); } } for (var i = 0;i&lt;tests.length;i++){ console.log (' Num In: ' + tests[i] + ' Num Out: ' + addOne(tests[i])); } Num In: 9007199254740992 Num Out: 9007199254740993 Num In: 999999999999999999 Num Out: 1000000000000000000 /* bigger than big */ Num In: -999999999 Num Out: -999999998 Num In: -0 Num Out: 1 Num In: -80 Num Out: -79 Num In: 800 Num Out: 801 Num In: 99 Num Out: 100
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28332937

http://stackoverflow.com/q/28407034
has comment: http://stackoverflow.com/comment/45189861
has comment: http://stackoverflow.com/comment/45149470
favorite count: 0
answer count: 0
type: UnansweredQuestion
has title: How do I remove connecting lines for non sequential dates in a time series plot using Highcharts
has body: I am plotting several sets of sensor data on a time series plot using the Highcharts javascript library. Each point is a tuple of day (timestamp) and a sensor reading value. On some occasions there are holes in the data due to sensor failure. I want to interconnect data points with a line only when the data points are sequential days.
upvote count: 1
has comment: http://stackoverflow.com/comment/45203332
score: 1
type: Question
tagged with: highcharts
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45163489

http://stackoverflow.com/comment/44960746
type: QuestionComment
comment on: http://stackoverflow.com/q/28304747
score: 0
has text: @sergiureznicencu [How so?](http://jsfiddle.net/w5uemy1s/2/) Only if the browser window is too narrow to fit the text...
type: Comment

http://stackoverflow.com/comment/45129160
has text: In the code you've copied you're missing a final closing }
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28396511
score: 0

http://stackoverflow.com/comment/45160513
comment on: http://stackoverflow.com/q/28413514
has text: use ngSrc for the src='' and loose the {{}} i the saveToAlbum function.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45182953
comment on: http://stackoverflow.com/a/28424825
has text: @AbhilashCherukat I know there are logical errors. I just wanted to point out the errors in the user's code and leave the logic to the user.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28342272
tagged with: properties
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45029307
type: Question
tagged with: object
tagged with: race-condition
has answer: http://stackoverflow.com/a/28342443
tagged with: javascript
score: 0
answer count: 1
tagged with: asynchronous
accepted answer: http://stackoverflow.com/a/28342443
has body: Whilst JavaScript might not be multi-threaded, it does support asynchronous execution and whilst executions for 2 or more asynchronous bits of code might be on the same thread, the fact that an asynchronous order of events cannot be predicted, makes it possible for a race condition between asynchronous executions to occur. I am doing an asynchronous check for the existence of an object property. Said property will be assigned a large multi-dimensional child object - including child objects arrays, own properties etc. In the example below, I already know the parent object exists, i.e. I know that myObject exists. I want my check to return true as soon as all the content of myObject['myObjectChildren'] is in place. To check for the existence of the object property, I do the following: if(myObject.hasOwnProperty('myObjectChildren')) return true; The only way that myObject['myObjectChildren'] gets assigned is in the format, but this assignment is done asynchronously: myObject['myObjectChildren'] = { largeChildObject:{ grandchildren:[ {grandchild1:{ grandchild1GreatGrandChildren:[ grandchild1GreatGrandChild1:{}, grandchild1GreatGrandChild2:{}.... ] }, {grandchild2:{}, {grandchild3:{}.... ] } }; MY QUESTION: My question is, can I safely assume that as soon as myObject.hasOwnProperty('myObjectChildren') === true, myObject['myObjectChildren'] has all the content assigned to it, bearing in mind it is assigned in one go. Is there any circumstance where the check might fail? e.g. on assignment, does the property get instantiated to 'undefined' first? Currently, my code is only returning true when all content for it is in place. However, my concern is that I've inadvertently entered into a race condition.
has title: Javascript - avoiding asynchronous race condition when checking object property existence

http://stackoverflow.com/q/28383124
tagged with: twitter-bootstrap
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/32041024
score: 1
tagged with: magento-1.9
upvote count: 1
type: Question
tagged with: magento
has body: Im trying to set up bootstrap-select.js for my website that Im working on (Magento ver. 1.9.1.0), and Im having some problems I cant solve. Everything gets loaded perfect, but when I select an option in the dropdown select list, the entire select disappears by getting an element.style onto it like this: style="display:none;" And in FireBug it says: element.style { display: none; } See visual image here: http://i.imgur.com/cg1jkOp.jpg?1 The problem is I dont know where this styling is coming from, so I decided to check 'Break on attribute change' in FireBug and see what it said. The code came from Jquery (jquery-2.1.3.min.js) as you can see in this image: http://i.imgur.com/Jbu8TCx.jpg?1 This is what I have in my section: Where do I go from here? How do I solve this problem? Seems like such a small thing, but it's really getting on my nerves now. Been trying to figure it out for a long time now. Hope there are someone willing to try to help. Thanks.
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/38488368
accepted answer: http://stackoverflow.com/a/32041024
answer count: 3
has title: Bootstrap-select.js - After selecting an option, entire select disappears
downvote count: 0
possible better answer: http://stackoverflow.com/a/38457752
has answer: http://stackoverflow.com/a/38457752
favorite count: 0

http://stackoverflow.com/a/28391946
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28391814
has comment: http://stackoverflow.com/comment/45121540
answers question: http://stackoverflow.com/q/28391814
type: Answer
has comment: http://stackoverflow.com/comment/45120996
has comment: http://stackoverflow.com/comment/45121040
has comment: http://stackoverflow.com/comment/45121510
has body: You have variable name conflicts. Rename your local request variable to something else. Ex: request = require('request'); Request = function (options) { this.uri = 'http://sampleapi.com/' + options.path, this.method = options.method, this.json = options.json }; Request.prototype.call = function (callback) { request(this, function (error, response, body) { if (body) { callback(error, body) } else { console.log(error || "There was a problem placing your request"); callback(error); } }); }; exports.startApiCall = function (callback) { options = { path: 'available', method: 'GET' }; var myRequest = new Request(options); myRequest.call(function(error, body) { //check the error and body here; //do the logic //you can also pass it through to the caller callback &amp;&amp; callback(error, body); }); }; When you consume your module (lets name it mymodule) you can do: var my = require('mymodule'); my.startApiCall(function(error, body){ //do something with body }); If you don't want the consumer to play with errors and/or body directly you can remove the callback parameter: exports.startApiCall = function () { options = { path: 'available', method: 'GET' }; var myRequest = new Request(options); myRequest.call(function(error, body) { //check the error and body here; //do the logic //you can also pass it through to the caller }); };
has comment: http://stackoverflow.com/comment/45121674
has comment: http://stackoverflow.com/comment/45121323
has comment: http://stackoverflow.com/comment/45121629
score: 0
has comment: http://stackoverflow.com/comment/45121279

http://stackoverflow.com/q/28311410
score: 2
has title: How to retrieve result for Google QPX with Javascript/jQuery (Ajax)?
tagged with: restful-url
downvote count: 0
has body: I have already signed up for Google API Console and set up the account and API key, but my question is how do I retrieve the results from Google QPX. What causes the error below? Setting up the json Query for Google Request var FlightRequest = { "request": { "slice": [ { "origin": "DCA", "destination": "LAX", "date": "2015-02-11" } ], "passengers": { "adultCount": 1, "infantInLapCount": 0, "infantInSeatCount": 0, "childCount": 0, "seniorCount": 0 }, "solutions": 20, "refundable": false } } Requesting the Data and Returning it. $.ajax({ url: "https://www.googleapis.com/qpxExpress/v1/trips/search?key=XXXXXXXXXXXXXXXX", type: 'POST', dataType: 'json', contentType: 'application/json', data: FlightRequest, success: function (data) { alert(JSON.stringify(data)); }, error: function(){ alert("Cannot get data"); } }); Error: I have already checked my API Key and is Correct. What can cause this issue? status of 400 (Bad Request)
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45014527
tagged with: ajax
has answer: http://stackoverflow.com/a/28335598
linked to: http://stackoverflow.com/q/29334997
type: Question
favorite count: 0
upvote count: 2
tagged with: google-api
answer count: 2
has answer: http://stackoverflow.com/a/45233756
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45014585

http://stackoverflow.com/comment/44918979
comment on: http://stackoverflow.com/q/28281949
has text: That's it! Adding `e.preventDefault()` fixed it. Feel free to type out the full answer and I'll give you the green check mark. Can't believe I missed this! Thank you so much.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45130612
type: Comment
type: QuestionComment
has text: I suppose that results written to file are the state of progress bar, am I right? If so, why don't you return directly them from AjaX call instead of output them to file?
comment on: http://stackoverflow.com/q/28397347
score: 0

http://stackoverflow.com/q/28426499
tagged with: node.js
accepted answer: http://stackoverflow.com/a/28426813
type: AnsweredQuestion
upvote count: 1
has body: Iam trying to execute a terminal command using node.js spawn tshark -i 3 -Y "ipp contains 02:00:00:00" -T pdml > ggggg.xml for that am using the code var args = ['-i', '3', '-Y', "ipp contains 02:00:00:00" ,'-T','pdml','>','ggggg.xml']; console.log(args) var child = spawn("tshark", args, {cwd: workDir}); child.stdout.on('data', function(data) { console.log(data.toString()) }); child.stderr.on('data', function(data) { console.log('stdout: ' + data); }); child.on('close', function(code) { console.log('closing code: ' + code); }); But it treated greater than >as string">" and getting output as tshark: Invalid capture filter "> gggggg.xml" That string isn't a valid capture filter (syntax error). See the User's Guide for a description of the capture filter syntax. How can i use > without string
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/137693694
tagged with: javascript
has comment: http://stackoverflow.com/comment/45184984
score: 0
has answer: http://stackoverflow.com/a/28426813
answer count: 1
linked to: http://stackoverflow.com/q/9777215
favorite count: 0
has title: execute a terminal command using node.js

http://stackoverflow.com/comment/44919984
score: 0
type: Comment
has text: the OP was talking about breakpoint; even if you can find a precompiled Bootstrap CSS , breakpoint value is compiled in the _variable mixin so for me it's important to know where that value comes from..
comment on: http://stackoverflow.com/a/28282668
type: AnswerComment

http://stackoverflow.com/comment/44971663
type: QuestionComment
has text: Your code works for me on jsfiddle. I had to remove `JSON.parse()`, because the server sends `Content-type: application/json`, so jQuery parses it automatically. http://jsfiddle.net/barmar/Lyffo28n/6/ Maybe your controller is doing that as well. If you use `dataType: "json"`, jQuery will parse it automatically with or without the header.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28307735

http://stackoverflow.com/comment/45167846
score: 1
type: Comment
type: QuestionComment
has text: It's async. You can only handle it using promise callbacks.
comment on: http://stackoverflow.com/q/28417359

http://stackoverflow.com/comment/44965540
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28304138
type: Comment
has text: @Jamiec - I've changed my code a bit so would take as argument the question first and then will compare if the answer is corect :) check the edited code snipped. You helped me a lot in this, thanks dude!

http://stackoverflow.com/comment/45056412
type: AnswerComment
has text: It does check that you're in Firefox - the InstallTrigger object is nonstandard and only exists in Firefox, as explained in the cited answer. Glad you found a better solution though. And as a side note - there's a long history of using unrelated features to detect specific browser versions, I'll find related links later.
type: Comment
comment on: http://stackoverflow.com/a/28353845
score: 1

http://stackoverflow.com/q/28373030
answer count: 2
has comment: http://stackoverflow.com/comment/45086790
has body: Is there a way to add a item to a combo box from a text box on the same page? Also how would you add that item to multiple combo boxes on the same page? This is an acrobat pdf form. Any examples would be greatly appreciated.
has title: Populate combo box using user input
accepted answer: http://stackoverflow.com/a/28374218
score: 0
possible better answer: http://stackoverflow.com/a/28373176
has answer: http://stackoverflow.com/a/28373176
tagged with: javascript
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28374218
tagged with: acrobat
type: Question

http://stackoverflow.com/q/28336080
has title: json nested arrays error
has comment: http://stackoverflow.com/comment/45018478
has comment: http://stackoverflow.com/comment/45018428
has body: hey before i start with the main question i should state that the .json file is an external file in the same folder with .html files.I do not know if it helps but i am new to json. My questions are 1) why jsfiddle throws throws errors at "papadopoulos_antonis": [{ "papadopoulos_stauros":=[{ "maria_anagnostou":= [{ 2) is it right to do to read json file? Thanks //this is in a json external file.the file is in the same folder with other html files users = [ "papadopoulos_antonis": [{ fname: 'Παπαδόπουλος Αντώνης', field1: 'Συντήρηση Αυτοκινήτου', field2: 'Ορειβατικός εξοπλισμός', field3: 'Μάθημα Καράτε', field4: '' }], "papadopoulos_stauros":[{ fname: 'Παπαδόπουλος Σταύρος', field1: 'Αναψυκτικά', field2: 'Αλκοολούχα ποτά', field3: 'Εξοδα καυσίμων', field4: '' }], "maria_anagnostou": [{ fname: 'Αναγνώστου Μαρία', field1: 'Διαφήμιση επιχείρησης', field2: 'Τεχνικός επιχείρησης', field3: 'Μηχανικός επιχείρησης', feild4: '' }] ] function jsonObjs(select) { var = JSONobject = JSON.parse(users); alert(users.papadopoulos_antonis[fname]); if (select == 1) { alert(users.papadopoulos_antonis[fname]); } else if (select == 2) { alert(users.papadopoulos_stauros[fname]); } else if (select == 3) { } } Επιλογή... Παπαδόπουλος Αντώνης Παπαδόπουλος Σταύρος Αναγνώστου Μαρία
linked to: http://stackoverflow.com/q/9922101
has comment: http://stackoverflow.com/comment/45018250
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/json
type: Question
has answer: http://stackoverflow.com/a/28336145
has comment: http://stackoverflow.com/comment/45018260
tagged with: javascript
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45018420

http://stackoverflow.com/q/28394341
score: 0
answer count: 1
tagged with: javascript
has title: Picking up JSON data
has comment: http://stackoverflow.com/comment/45128537
has body: I've got a calendar. Each of its cells (= days) contains &lt;span class="spanEvent"&gt;&lt;/span&gt; &lt;span class="spanDate"&gt;&lt;/span&gt; &lt;span class="spanParticipants"&gt;&lt;/span&gt; &lt;span class="spanDescription"&gt;&lt;/span&gt; So, I need my earlier stored data (localStorage.setItem) to appear within those &lt; spans >. My code (see below) seems not to work. So, how do I do it? I created a JSON object and made it an array. Each value of the array contains data for a certain day in the calendar. "thisCell" is my target cell which I am clicking to retrieve the stored data. var organizer = [ //February 9, 2015 {thisCell.getElementsByClassName("spanEvent")[0].value: JSON.parse('localStorage.getItem("event")'), thisCell.getElementsByClassName("spanDate")[0].value: JSON.parse('localStorage.getItem("date")'), thisCell.getElementsByClassName("spanParticipants")[0].value: JSON.parse('localStorage.getItem("participants")'), thisCell.getElementsByClassName("spanDescription")[0].value: JSON.parse('localStorage.getItem("description")') }, //July 22, 2016 {thisCell.getElementsByClassName("spanEvent")[0].value: JSON.parse('localStorage.getItem("event")'), thisCell.getElementsByClassName("spanDate")[0].value: JSON.parse('localStorage.getItem("date")'), thisCell.getElementsByClassName("spanParticipants")[0].value: JSON.parse('localStorage.getItem("participants")'), thisCell.getElementsByClassName("spanDescription")[0].value: JSON.parse('localStorage.getItem("description")') } ];
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45125341
has answer: http://stackoverflow.com/a/28394508
tagged with: http://stackoverflow.com/tag/json
type: Question

http://stackoverflow.com/comment/45162928
type: Comment
score: 0
has text: I am using an old version of Chrome on a MacBook Pro from 2006. maybe that's why it wasn't working properly...
comment on: http://stackoverflow.com/q/28375880
type: QuestionComment

http://stackoverflow.com/comment/44968609
type: QuestionComment
has text: In that case, I'm not sure why your original code isn't working. Are you sure the returned JSON is what you're expecting?
score: 0
comment on: http://stackoverflow.com/q/28307735
type: Comment

http://stackoverflow.com/comment/64036963
score: 21
type: AnswerComment
type: Comment
has text: Is there any equivalent option in browsers?
comment on: http://stackoverflow.com/a/28397970

http://stackoverflow.com/a/28414738
has body: This isn't really related to Spring directly. It's more of a HTML/JS (front-end) issue. If you like the way that the select box works on the link you provided, and it fits the scope of your project, then there's a few steps you'd want to take: Render the select box as normal with whichever HTML templating framework you are using with Spring (whether Themeleaf, JSP, Handlebars, or something else). Make sure there is a multiple attribute in the select tag. Download and add the jQuery JavaScript library to this page (required for the "plugin" in the link). Download and add the Chosen file from your link to your page after jQuery. Activate the plugin as described. Here's a brief skeleton of how I would do it (as rendered HTML, not the template; which depends on implementation): Option 1 Value 2 I would definitely recommend reading into jQuery and JavaScript in general on top of all of this. I hope this helps get you rolling!
answers question: http://stackoverflow.com/q/28414109
score: 1
has comment: http://stackoverflow.com/comment/45185016
has comment: http://stackoverflow.com/comment/45209855
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28414109
type: Answer
has comment: http://stackoverflow.com/comment/61954839
upvote count: 1

http://stackoverflow.com/comment/45174617
has text: Ohh, well you could insert it at the end of your HTML file, just after the ` `
score: 0
comment on: http://stackoverflow.com/q/28420080
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45107956
has text: thanks for the link, but i am looking only for pace.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28385063

http://stackoverflow.com/q/28413452
tagged with: jison
has title: Parse error with simple jison grammar
accepted answer: http://stackoverflow.com/a/28414018
tagged with: parsing
type: AnsweredQuestion
has body: I am trying to create a simple script language. For the beginning i just wanted stuff like i = 5; i += 3; out(i); So i created the following grammar for jison: %lex %% \s+ { /* ignore */ } "=" { return '='; } "+=" { return '+='; } "-=" { return '-='; } "*=" { return '*='; } "/=" { return '/='; } "." { return '.'; } "(" { return '('; } ")" { return ')'; } "{" { return '{'; } "}" { return '}'; } [0-9]+ { return 'NUMBER'; } [A-Z]* { return 'CHAR_SEQUENCE'; } &lt;&lt;EOF&gt;&gt; { return 'EOF'; } /lex %% Program : StatementList EOF { return function() { for(var i = 0; i &lt; $1.length; i++) { $1[i](); } }; } ; StatementList : StatementList Statement { $$ = $1.concat($2); } | { $$ = []; } ; Statement : AssignStatement | VariableOutput ; Operator : "=" { $$ = function(left, right) { left.set(right); }; } | "+=" { $$ = function(left, right) { left.add(right); }; } | "-=" { $$ = function(left, right) { left.remove(right); }; } | "*=" { $$ = function(left, right) { left.multiplicate(right); }; } | "/=" { $$ = function(left, right) { left.divide(right); }; } ; VariableOutput : 'out(' CHAR_SEQUENCE ')' ';' { $$ = function() { var t = new Tellraw("Output: "); t.extra.push(vars[$1].toTellrawExtra()); t.tell(new Entities.Player("@a")); }; } ; AssignStatement : CHAR_SEQUENCE Operator CHAR_SEQUENCE ';' { $$ = function() { Util.assert(typeof vars[$3] != 'undefined', "Unknown identifier '"+$3+"'"); if(typeof vars[$1] == 'undefined') vars[$1] = vars[$3].constructor.call(); $2(vars[$1], vars[$3]); }; } | CHAR_SEQUENCE Operator '"' CHAR_SEQUENCE '"' ';' { $$ = function() { if(typeof vars[$1] == 'undefined') vars[$1] = new Runtime.String($3); $2(vars[$1], $3); }; } | CHAR_SEQUENCE Operator NUMBER ';' { $$ = function() { if(typeof vars[$1] == 'undefined') vars[$1] = new Runtime.Integer($3); $2(vars[$1], $3); }; } ; It generates the parser without complaining about the grammar. My problem is that when I do parser.parse('i=5;out(i);')(); I get this error Parse error on line 1: i = 5;out(i);…
has answer: http://stackoverflow.com/a/28413621
has answer: http://stackoverflow.com/a/28414018
type: Question
answer count: 2
tagged with: grammar
possible better answer: http://stackoverflow.com/a/28413621
tagged with: javascript
score: 0

http://stackoverflow.com/q/28293236
tagged with: functional-testing
has body: I can't find FirefoxDriver's option, which equivalents --always-authorize-plugins in ChromeDriver. Does FirefoxDriver contain an equivalent option? P.S. --always-authorize-plugins enables all plugin in ChromeDriver.
has comment: http://stackoverflow.com/comment/44940521
has answer: http://stackoverflow.com/a/28318628
has answer: http://stackoverflow.com/a/28295434
answer count: 2
tagged with: selenium-firefoxdriver
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/44985555
tagged with: selenium-webdriver
tagged with: selenium-chromedriver
has title: FirefoxDriver: enable plugins
type: UnansweredQuestion
upvote count: 1
type: Question

http://stackoverflow.com/a/28314963
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28314942
upvote count: 1
has body: use stopPropagation(); : to stop bubbling event $("#image_click").click(function(e) { e.stopPropagation(); alert("for image"); });
type: Answer

http://stackoverflow.com/q/28302751
tagged with: javascript
tagged with: variables
has answer: http://stackoverflow.com/a/28302905
answer count: 1
tagged with: asp.net
type: UnansweredQuestion
tagged with: data-conversion
score: 0
has body: The following variables defined in .net are: &lt;asp:Label ID="lblGrandTotal" runat="server" CssClass="TextTitle"&gt;&lt;/asp:Label&gt; &lt;asp:Label ID="lblOrderNumber" runat="server" CssClass="TextTitle"&gt;&lt;/asp:Label&gt; &lt;asp:Label ID="lblEmail" runat="server" CssClass="TextTitle"&gt;&lt;/asp:Label&gt; ...which need to be passed to JavaScript to track conversions on a checkout "success page": *The : "revenue" is where the asp declared variable's value needs to be called in (revenue, orderId and email) with the labels of the same: &lt;script type="text/javascript"&gt; _code.push(["setdata", { "revenue": "revenue"}]); _code.push(["setdata", { "orderId": "orderId" }]); _code.push(["setdata", { "email": "email" }]); _code.push(["convert", "sale" ]); &lt;/script&gt; We've attempted one unsuccessful iteration of the variable recall: &lt;script type="text/javascript"&gt; var lblGrandTotal = $('#&lt;%= lblGrandTotal %&gt;'); var lblOrderNumber = $('#&lt;%= lblOrderNumber %&gt;'); var lblEmail = $('#&lt;%= lblEmail %&gt;'); _code.push(["setdata", { "revenue": "lblGrandTotal"}]); _code.push(["setdata", { "orderId": "lblOrderNumber" }]); _code.push(["setdata", { "email": "lblEmail" }]); _code.push(["convert", "sale" ]); &lt;/script&gt; and other thoughts would be (but I'm not sure): As the variable is already declared elsewhere on the "checkout" page, I didn't know if it could just be recalled inside the JS block: &lt;script type="text/javascript"&gt; _code.push(["setdata", { "revenue": "&lt;%=lblGrandTotal%&gt;"}]); _code.push(["setdata", { "orderId": "&lt;%= lblOrderNumber %&gt;" }]); _code.push(["setdata", { "email": "&lt;%= lblEmail %&gt;" }]); _code.push(["convert", "sale" ]); &lt;/script&gt; ...and if that doesn't work, the next thought would have been: &lt;script type="text/javascript"&gt; var revenue = "&lt;%= lblGrandTotal %&gt;"; var orderId = "&lt;%= lblOrderNumber %&gt;"; var email = "&lt;%= lblEmail %&gt;"; _code.push(["setdata", { "revenue": "revenue"}]…
has title: Need assistance calling variables declared in .net for execution inside JavaScript
type: Question

http://stackoverflow.com/a/28371332
has body: The controller should do it. Pick up the data from the model, set a variable and set it into the view. Or just use Ajax to fetch the data, while you render the view.
score: 0
answers question: http://stackoverflow.com/q/28371001
type: Answer

http://stackoverflow.com/q/28334618
has title: Send data through a script tag using nodejs vash template
tagged with: vash
tagged with: javascript
upvote count: 3
has answer: http://stackoverflow.com/a/30646754
answer count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: node.js
score: 3
downvote count: 0
type: Question
has body: I am new to nodejs. Trying to send some bootstrapped data (logged on user) from a nodejs server using the vash template back to the client with the index page. Need the bootstrapped data on the client to enable/disable certain options based on whether the user is logged in. The server.js looks like this: app.get("*", function(req, res) { res.render("index", { title: "Page title", bootstrappedUser: req.user }); }); index.vash @html.extend('layout', function(model) { @html.block("scripts", function(model){ @if(model.bootstrappedUser) { @{ var a = model.bootstrappedUser; } &lt;script type="text/javascript"&gt; window.bootstrappedUser = JSON.stringify(@a); &lt;/script&gt; } }) }) But this results in an "UncaughtSyntaxError: Unexpected identifier " in the client html on the stringify function below: &lt;script type="text/javascript"&gt; window.bootstrappedUser = JSON.stringify([object Object]); &lt;/script&gt; I tried to look up the Vash page on Github but there is virtually no documentation on script blocks using vash. Am I using the correct syntax inside 'index.vash' or is there some vash string interpolation that I am missing? Any help would be much appreciated.

http://stackoverflow.com/q/28324274
tagged with: jquery
has comment: http://stackoverflow.com/comment/49095501
has body: I want to run a JNLP file on page load using javascript. Internet explorer runs JNLP without any problem, but Chrome downloads JNLP. But if I click on link manually chrome runs JNLP, also. Is there a solution to run a JNLP on page load without any manual click, on chrome? Here is my example code: go
has comment: http://stackoverflow.com/comment/49096177
answer count: 3
tagged with: jnlp
has title: Running JNLP on Page Load
has comment: http://stackoverflow.com/comment/49096105
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28359486
has comment: http://stackoverflow.com/comment/49095691
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/49094706
has answer: http://stackoverflow.com/a/41013829
score: 3
upvote count: 3
tagged with: java
has comment: http://stackoverflow.com/comment/45015413
has comment: http://stackoverflow.com/comment/49094819
has answer: http://stackoverflow.com/a/66576023
type: Question
tagged with: javascript

http://stackoverflow.com/comment/44999280
type: Comment
has text: Can you please clarify?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28325834

http://stackoverflow.com/comment/45119291
type: AnswerComment
score: 0
type: Comment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/70503/discussion-between-joseph-casey-and-3gwebtrain).
comment on: http://stackoverflow.com/a/28390904

http://stackoverflow.com/a/28394735
has body: If you simply did window.location and checked the args in there, if there are no pages/paths appended, url matches origin, etc., would that not be good enough to detect -- Idk, I've never had a need to do this? This might also work for .NET and 'other' types of HTML naming conventions (i.e. index.html vs index.htm). Additionally, if someone changes the doc root, or a home page pointer, you'd more or less know (aka not care) because window.location you can check the following: window.location Location {replace: function, assign: function, ancestorOrigins: DOMStringList, origin: "http://stackoverflow.com", hash: ""…}ancestorOrigins: DOMStringListassign: function () { [native code] }hash: ""host: "stackoverflow.com"hostname: "stackoverflow.com"href: "http://stackoverflow.com/"origin: "http://stackoverflow.com"pathname: "/"port: ""protocol: "http:"reload: function reload() { [native code] }replace: function () { [native code] }search: ""toString: function toString() { [native code] }valueOf: function valueOf() { [native code] }__proto__: Location which has path = '/'. That's pretty indicative of homepage'ish'ness.
answers question: http://stackoverflow.com/q/28394649
downvote count: 0
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/a/28351423
answers question: http://stackoverflow.com/q/28316603
has body: Because we had a list of known bad passwords and were later informed there would only be once instance of 1's in the password here is the answer I went with. For the check of all letters except L, I used @PeterHerdenborg's answer. var LettersEnglish1 = ['o', 'e', 'a', 's', 't', 'i'], LettersLeet = ['0', '3', '4', '5', '7', '1']; function changeLetters() { var text = document.getElementById("password").value; for (var i = 0; i &lt; LettersLeet.length; i++) { text = text.replace(new RegExp(LettersLeet[i], 'g'), LettersEnglish1[i]); //console.log(text); englishPasswords(text); } } function englishPasswords(text) { var myarr = ["password", "letmein", "dragon", "shadow", "joker"]; var string = (myarr.indexOf(text) &gt; -1); if (string === true){ document.getElementById("output").innerHTML = text + " is a bad password"; }else{ checkForLs(text); } } function checkForLs(text){ text = text.replace('i','l') if(text == 'letmein'){ document.getElementById("output").innerHTML = text + " is a bad password"; }else{ document.getElementById("output").innerHTML = text + "thats an acceptable password"; } }
type: Answer
score: 0

http://stackoverflow.com/q/28367354
has comment: http://stackoverflow.com/comment/45075775
favorite count: 0
has answer: http://stackoverflow.com/a/28367429
upvote count: 1
has answer: http://stackoverflow.com/a/28367451
has answer: http://stackoverflow.com/a/28367465
tagged with: css
has answer: http://stackoverflow.com/a/28367448
possible better answer: http://stackoverflow.com/a/28367429
has title: Jquery replaceWith deletes the content
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28367445
has body: On mobile and tablet, I need to replace the content with a select/option tag. I'm not sure why this is not working, as the options deletes the content inside. Any idea on how to make this select option tag wrap around my spans? var $window = $(window); var windowsize = $window.width(); function wrapContent(){ if (windowsize < 800) { $('.pick-country > span').each(function () { $(this).replaceWith(' '); }); $('.pick-country > option').wrapAll(' '); } } wrapContent(); $(window).resize(wrapContent); PICK A COUNTRY London Cape Town Beijing Tokyo Hong Kong Kuala Lumpur Singapore Mumbai Shanghai Sydney St. Petersburg São Paulo San Francisco Dallas New York Dubai
has comment: http://stackoverflow.com/comment/45075836
type: Question
accepted answer: http://stackoverflow.com/a/28367451
tagged with: javascript
answer count: 6
tagged with: jquery
has answer: http://stackoverflow.com/a/28367453
tagged with: http://stackoverflow.com/tag/html
downvote count: 0

http://stackoverflow.com/a/28387013
downvote count: 0
score: 5
upvote count: 5
type: Answer
answers question: http://stackoverflow.com/q/28386051
has body: Its not working because this changes context accordingly within a callback. You can do something like this: var self = this; ... someListener: function(){ self.game.doSomeOtherFunction(); } ... Or simply you could also do this: someListener: (function () { var callback = function(){ this.game.doSomeOtherFunction(); } return callback.bind(this); }()) I hope it helps.

http://stackoverflow.com/comment/45192992
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28430587
has text: @RobG Thank you i've include this :-)
score: 0

http://stackoverflow.com/a/28434204
downvote count: 0
has body: Actually, you are not executing the function, you are just evaluating an expression (that makes no sense at all) The console.log|('Hello world!'), will be evaluated as: [native function] | 'Hello world!' Which makes no sense, since "|" is a bitwise operator. Same as the other example that you gave. So, you are not placing the operator between the function call. You are separating the values, and no longer performing the expected action (funcion call).
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/45200541
answers question: http://stackoverflow.com/q/28433989
score: 1
has comment: http://stackoverflow.com/comment/45200496

http://stackoverflow.com/a/28410646
upvote count: 1
score: 1
downvote count: 0
has body: Try this code $(".form-group&gt;.form-control").appendTo( $("&lt;div class='test'/&gt;").appendTo(".jpaper") ) jsfiddle demo
answers question: http://stackoverflow.com/q/28410250
type: Answer

http://stackoverflow.com/comment/45114759
comment on: http://stackoverflow.com/q/28388114
type: Comment
has text: you need to respond to the http instead of just internally logging it. since it comes from a different domain, make sure you are adding the correct CORS headers.
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45058160
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28334988
has text: As your return data is not json,you will see the error on console,`parsererror:SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data` . And the "success" function of course will not be executed. You can have a "console.log" to check if the function is executed.
score: 0

http://stackoverflow.com/a/28341603
downvote count: 0
has body: classList returns a DOMTokenList which can be used to add/remove classes to the element. But as you can see here, its supported only in latest browsers. I suggest you use jQuery to do this var $parent = $(rows.parentNode); if( $parent.hasClass('checked') ){ $parent.removeClass('checked'); } If you know that checked class is always there, you can skip that if condition as well. If you want to use only javascript, i suggest you do something like this var parent = rows.parentNode, classNames = parent.className; var newList = classNames.replace('checked',''); parent.className = newList; Hope this helps :)
type: Answer
answers question: http://stackoverflow.com/q/28340731
score: 1
upvote count: 1

http://stackoverflow.com/comment/45117154
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28389837
has text: if you want the syntax to match exactly you would need to return `return { x: x };` then the call looks like `document.write(myvar.FirstL().x);`

http://stackoverflow.com/comment/45201102
score: 0
type: Comment
has text: Viewing the edit in the question with the appearance of the `submit` button at the end of the input list, only your alternative method with the `querySelectorAll('input[type="text"]')` will work.
type: AnswerComment
comment on: http://stackoverflow.com/a/28435109

http://stackoverflow.com/comment/44947956
type: Comment
has text: Thanks! Worked great :D
type: AnswerComment
comment on: http://stackoverflow.com/a/28286849
score: 0

http://stackoverflow.com/a/28407375
accepted answer of: http://stackoverflow.com/q/28407258
type: Answer
upvote count: 2
has comment: http://stackoverflow.com/comment/45157747
score: 2
type: AcceptedAnswer
has body: You have to implement a servlet that returns the data from mysql. A good way to do so is to implemente a servlet that returns a JSON object containing the mysql data. Once this is done use AJAX to ask the servlet for the data. There is a lot of information about implementing this. After all this is a minimal REST implementation for a GET request. Just ask Stackoverflow or Google.
downvote count: 0
answers question: http://stackoverflow.com/q/28407258

http://stackoverflow.com/a/28295144
has comment: http://stackoverflow.com/comment/44943214
accepted answer of: http://stackoverflow.com/q/28294937
has comment: http://stackoverflow.com/comment/44955402
has body: The simplest way would be to split the className on spaces and then loop the result, looking for elements where you get more than one entry in the array starting with your string. // Start out with a set of elements that have "userNote" anywhere // in the class, then filter based on the more detailed criteria var matches = $('[class*=userNote]').filter(function () { return this.className.split(' ').reduce(function(p, c) { return c.substring(0, 8) === "userNote" ? p + 1 : p; }, 0) > 1; }); Now, matches contains a set of elements that have more than one class starting with userNote. (That uses the ES5 feature Array#reduce, but it can be polyfilled for older browsers, or you can just use a simple for loop instead.) Example: // Start out with a set of elements that have "userNote" anywhere // in the class, then filter based on the more detailed criteria var matches = $('[class*=userNote]').filter(function () { return this.className.split(' ').reduce(function(p, c) { return c.substring(0, 8) === "userNote" ? p + 1 : p; }, 0) > 1; }); // Show results $(" Text of matching elements: " + matches.map(function() { return $(this).text(); }).get().join(" ") + " ").appendTo(document.body); one two three none four and other classes
answers question: http://stackoverflow.com/q/28294937
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/44949775

http://stackoverflow.com/comment/49164890
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28334382
type: Comment
has text: Not seeing it here... Looks more like a graphics glitch then a chrome issue... lets be help deskie and say try clearing your cache, restart your computer is your computer plugged in sir ? sorry that was a joke but yes try clearing cache.

http://stackoverflow.com/comment/45328561
score: 0
comment on: http://stackoverflow.com/a/28351299
type: Comment
type: AnswerComment
has text: Any progress? If you are still where you were on Feb 9, I would look into how `offsetLeft` is calculated, and how it's affected by the CSS `position` property.

http://stackoverflow.com/q/28326028
type: Question
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/28326440
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28326440
linked to: http://stackoverflow.com/q/16588327
accepted answer: http://stackoverflow.com/a/28327737
has title: Call function from JSF backing bean with javascript var or other tag value
answer count: 2
downvote count: 0
favorite count: 0
linked to: http://stackoverflow.com/q/15668132
has body: I' have seen many answers here but none worked for what I want, I need to do this in a way that the form is not submited, and by using the hidden button approach (with an ajax call) and calling the click() event from javascript, the method is called, but I need to pass an int in the method, how can I do that? I can get the int from a javascript var or from a hidden input text field, just don't know how to do that, can anyone help with that? JSF code: &lt;script type="text/javascript" language="javascript"&gt; var position; &lt;/script&gt; &lt;h:inputHidden id="hiddenHolder" value="#{backingBean.beanPosition}" /&gt; &lt;h:commandButton id="hiddenButton" style="display: none;"&gt; &lt;f:ajax listener="#{backingBean.testMethod(need to send here javascript var or inputHidden value)}"/&gt; &lt;/h:commandButton&gt; Bean function; public void testMethod(int i){ //do stuff } When I change the hiddenHolder value from javascript that is not reflected in the backingBean, I guess it needs a submit for that to work. That is why I need to pass the value in the method call.
tagged with: jsf
linked to: http://stackoverflow.com/q/15550165
upvote count: 3
has answer: http://stackoverflow.com/a/28327737

combobox
tags question: http://stackoverflow.com/q/28384624
type: Tag
tags question: http://stackoverflow.com/q/28282906
tag name: combobox

http://stackoverflow.com/comment/44966996
comment on: http://stackoverflow.com/q/28307986
has text: it is unclear to me what you mean by dependencies? Also it can be helpful if you show the logic of your getContent function.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45084654
has text: Actually, the linked question is not exactly the same. Bellow answer is exactly what I wanted.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28355787

http://stackoverflow.com/comment/45605626
comment on: http://stackoverflow.com/a/28527846
score: 1
type: AnswerComment
has text: Yes, it appears that is possible (see updated snippet). Don't be afraid to experiment to find the answers to your questions - it's the best way to learn.
type: Comment

http://stackoverflow.com/a/28404653
downvote count: 0
has body: you are assigning $wo = $("#table1").config.widgetOptions; and then using wo for further methods. You should use either wo or $wo. I added these js files in my code and its working now: Remove any other tablesorter js and add the above ones.
score: 1
answers question: http://stackoverflow.com/q/28404442
has comment: http://stackoverflow.com/comment/45146887
has comment: http://stackoverflow.com/comment/45146727
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45143698
has comment: http://stackoverflow.com/comment/45146301
has comment: http://stackoverflow.com/comment/45146843
has comment: http://stackoverflow.com/comment/45147412
has comment: http://stackoverflow.com/comment/45146548
has comment: http://stackoverflow.com/comment/45147356
has comment: http://stackoverflow.com/comment/45144639
type: Answer
has comment: http://stackoverflow.com/comment/45146274
accepted answer of: http://stackoverflow.com/q/28404442
has comment: http://stackoverflow.com/comment/45146345

http://stackoverflow.com/q/28433997
answer count: 1
has title: D3: how to create input elements followed by label text?
favorite count: 0
score: 2
downvote count: 0
tagged with: d3.js
has comment: http://stackoverflow.com/comment/45198242
type: Question
has body: I have an array var brands = ['Option1', 'Option2']. I want to use D3 to output labelled radio buttons as follows: &lt;label&gt; &lt;input type="radio" name="brand" value="Option1" checked="true"/&gt; Option1 &lt;/label&gt; &lt;label&gt; &lt;input type="radio" name="brand" value="Option2" /&gt; Option2 &lt;/label&gt; This is my D3, but it's not quite working: var radios = d3.select('.panel.left').selectAll('input[name="brand"]').data(brands); var labels = radios.enter() .append("label") .attr("for", function(d) { return d; }) .text(function(d) { return d; }) .append("input") .attr("type", "radio") .attr("name", "brand") .attr("value", function(d) { return d; }) .attr('checked', function(d) { if (d === brands[0]) { return 'checked' }; }); d3.selectAll('input[name="brand"]').on('change', function() { renderValues(this.value); }); It's very close to working, but it outputs this: &lt;label&gt; Option1 &lt;input type="radio" name="brand" value="Option1" checked="true" /&gt; &lt;/label&gt; &lt;label&gt; Option2 &lt;input type="radio" name="brand" value="Option2" /&gt; &lt;/label&gt; No matter what I do, I can't figure out how to put the text after the &lt;input&gt; element. What should I be doing differently? It would also be nice if I didn't have to re-select the input elements to add a listener, at the end.
type: AnsweredQuestion
tagged with: javascript
has answer: http://stackoverflow.com/a/28434622
accepted answer: http://stackoverflow.com/a/28434622
upvote count: 2
has comment: http://stackoverflow.com/comment/45198737

http://stackoverflow.com/q/28319689
tagged with: overflow
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/44988238
has comment: http://stackoverflow.com/comment/44989607
has title: Div Overflow event in jquery
has body: I am trying to trigger an event on div overflow and display the continued contents on to a new div, Is there any way this can be achieved, basically what I am trying to do is to display a document, page wise and every page is represented as a div and the div will have a particular height and width, so all I want to do is to display the hidden contents from the first div in a new div once that div has triggered a overflow event, any help would be appreciated.
type: Question
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
tagged with: events
has answer: http://stackoverflow.com/a/28319880

http://stackoverflow.com/a/28363037
score: 1
answers question: http://stackoverflow.com/q/28362570
downvote count: 0
has body: Since you are not trying to detect wether the onscroll is supported or not but you try to check its implementation I would say that agent sniffing is the best way (although agent sniffing is generally bad thing).
type: Answer
upvote count: 1

http://stackoverflow.com/q/28327247
has comment: http://stackoverflow.com/comment/45002664
favorite count: 0
has comment: http://stackoverflow.com/comment/45002889
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45002540
has comment: http://stackoverflow.com/comment/45002701
tagged with: xmlhttprequest
tagged with: php
has comment: http://stackoverflow.com/comment/45002709
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/28327469
type: Question
has title: Add a record to the database with XMLHttpRequest
has comment: http://stackoverflow.com/comment/45002856
has body: I have the following form: Grade Тест Attendance Homework Add record When I click the submit button I want to add the points and the grade_type to the database. Therefore I am using JavaScript and PHP: // Validating Empty Field function check_empty() { if (document.getElementById('grade').value == "") { alert("Fill the fields!"); } else { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari alert("xmlhttpreq"); xmlhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } var grade = String(document.getElementById('grade').value); var grade_type = document.getElementById('grade_type'); var grade_type_value = String(grade_type.options[grade_type.selectedIndex].value); var fn = String(document.getElementById('fn').value); xmlhttp.open("GET","getuser.php?grade="+grade+"grade_type="+grade_type_value+"fn="+fn,true); xmlhttp.send(); document.getElementById('form').submit(); } } The contents of the getuser.php file are: <?php require "config.php"; $fn = $_GET["fn"]; $grade = $_GET["grade"]; $type = $_GET["grade_type"]; echo " "; try { $conn = new PDO("mysql:host=" . DB_SERVER . ";dbname=" . DB_NAME, DB_USERNAME, DB_PASSWORD); } catch(PDOException $e) { die("Database connection could not be established."); } $sql = $conn->prepare("SELECT * FROM students WHERE fn = ?"); $sql->execute(array($fn)); if($sql->rowCount() > 0) { $statement = $conn->prepare("INSERT INTO points (student_fn, type, grade, datetime) VALUES (?, ?, ?, CURRENT_TIMESTAMP)"); $statement->execute(array($fn, $type, $grade)); } else { echo " "; } $conn = null; ?> However I think it never gets executed because I never see the result of the alert. I have never worked with XMLHttpRequest before so I don't even know whether my code is valid. I would greatly appreciate any help.
tagged with: javascript
has comment: http://stackoverflow.com/comment/45002714
tagged with: jquery
has comment: http://stackoverflow.com/comment/45002580
tagged with: ajax
upvote count: 1
answer count: 1

http://stackoverflow.com/a/28355096
has comment: http://stackoverflow.com/comment/45416417
has comment: http://stackoverflow.com/comment/45628088
answers question: http://stackoverflow.com/q/28354252
type: Answer
accepted answer of: http://stackoverflow.com/q/28354252
has comment: http://stackoverflow.com/comment/45415969
has comment: http://stackoverflow.com/comment/45622524
has comment: http://stackoverflow.com/comment/45622931
has comment: http://stackoverflow.com/comment/45622308
has comment: http://stackoverflow.com/comment/45417656
has comment: http://stackoverflow.com/comment/45657921
has body: If I've understood it correctly the following demo should do what you want. You can find the code below and here at jsFiddle. (old version of the jsfiddle, new version see edit below.) It's basically doing what andi suggested. For "calculation" I have used UnderscoreJS to find the matching key/value pair for the currently clicked selection with the where method. Then it's easy to get the total of the selection with the length. In the demo I have done it for male, female and ethnic. It should work exactly like that for the other options. Edit 07.02.2015 I have improved the code. Now you can activate multiple filters at your list. Also the subtraction is removed because the filtered list holds always the number of items with the length property. The code is working but there are still some points to improve: removeFilter needs to be changed to easily remove the filter with-out specifing the filter parameter setFilter improvment: if ( index == -1 ) { is not really required because the filters are always removed before adding a new filter. add reset buttons for each radio group. At the moment, there is only a "reset all" button. Using AngularJS for updating the DOM would be better because the script is always recreating the DOM at every filter change. Maybe with AngularJS you could check if there are filters for ng-repeat to do a similar behavior. It's also likely that I haven't tested if any combination of the filter is working correctly, because I have only three list items. So you have to do more tests with the code. I updated the code here to the latest version and here is the jsFiddle. More code explanations 16.02.2015 The functions refreshList and setTotal are used to update the DOM. The filter functions gender, ethnicity and age are returning the new array after the filter is apply. The array activeFilters is storing the currently selected filters. It stores the filter functions so they can be called by iterating through this array. More details to this later. Th…
upvote count: 1
has comment: http://stackoverflow.com/comment/45643933
has comment: http://stackoverflow.com/comment/45657896
score: 1
has comment: http://stackoverflow.com/comment/45622460
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45622112

http://stackoverflow.com/comment/45081196
type: Comment
has text: I would advise to just not get the individual followers. maybe just return the total count. I can see how you could quickly thrash soundcloud to death with your use case.
type: QuestionComment
comment on: http://stackoverflow.com/q/28369476
score: 0

http://stackoverflow.com/comment/45124112
comment on: http://stackoverflow.com/q/28393165
type: Comment
type: QuestionComment
score: 0
has text: No, it looks clear to me, but isn't that something you can see as well? http://here-is.com/kentishtowner/wp-content/uploads/sites/13/2015/02/Screen-Shot-2015-02-08-at-12.10.18.png

http://stackoverflow.com/q/28316031
has answer: http://stackoverflow.com/a/28316277
has comment: http://stackoverflow.com/comment/44981266
upvote count: 4
answer count: 2
has comment: http://stackoverflow.com/comment/44982821
has answer: http://stackoverflow.com/a/28316203
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I am trying to create an element with a dynamic id and adding it with another div.Here tableHTML contains the code of a table. But when I see my console i see undefined for first one and see an empty div like &lt; div id="data0"&gt; &lt; /div &gt; why it is not appending please help var div = document.createElement('div'); div.setAttribute('id',"data"+div_count); console.log($("#"+"data"+div_count).html()); $("#"+"data"+div_count).html(tableHTML); console.log(div); $('#data').append($('#'+"data"+div_count).html()); $('#data').append("&lt;br /&gt; &lt;br /&gt;");
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28316203
has title: Can not append a Div
downvote count: 1
type: Question
score: 3
possible better answer: http://stackoverflow.com/a/28316277

http://stackoverflow.com/comment/45103113
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28382048
type: Comment
has text: It still submits the data, there is no action on the form. I think it isn't necessary.

http://stackoverflow.com/comment/45173493
comment on: http://stackoverflow.com/a/28419890
score: 0
type: AnswerComment
has text: I expected the autopilot ;) Anyway, this looks promising. If I understand it correctly, the idea is to use the first module directly to provide specific functionalities in the other module, like you did here: `myFeature._setPrivateVar('hi');`. I will dig into that. Thanks a lot.
type: Comment

http://stackoverflow.com/comment/45231106
type: Comment
has text: Am getting error like this how to resolve it: Exception in thread "main" org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted with Command duration or timeout: 35 milliseconds
comment on: http://stackoverflow.com/a/28429155
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45050529
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28353323
has text: This is obviously a typo. You should have flagged the question as off-topic instead of answering it.

http://stackoverflow.com/comment/45181435
type: Comment
score: 0
type: AnswerComment
has text: I just want to select any date which are before from today.Validation to be applied only when user select today or ahead of today dates.
comment on: http://stackoverflow.com/a/28424205

http://stackoverflow.com/comment/44930234
has text: if your aim is to reset a series of form elements, there is an angular function for that `$scope.formName.$setPristine()`. https://docs.angularjs.org/api/ng/type/form.FormController#$setPristine.
score: 0
comment on: http://stackoverflow.com/q/28288155
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45042056
has text: @ankur - I'm not sure how much help I can be due to the fact that your use case is a lot more complicated than the question originally conveyed. However I will say this: Having the DOM point to ko observables that do not exist is *fundamentally* flawed and you need a different approach. You view should be a result of your model. If you need dynamic fields to be added you should create an array with a name, value and the HTML template to be used and dynamically add to it. Your view should then render the appropriate HTML for the fields as the respective properties are added.
type: AnswerComment
comment on: http://stackoverflow.com/a/28348216
score: 0
type: Comment

http://stackoverflow.com/comment/45029276
has text: You're saying it works in all other browsers with the regex as a string ?
type: Comment
comment on: http://stackoverflow.com/q/28342156
score: 0
type: QuestionComment

http://stackoverflow.com/a/28350578
has comment: http://stackoverflow.com/comment/45045184
upvote count: 1
has body: Shouldn't $('#sticky').removeClass('#stick'); be $('#sticky').removeClass('stick'); ??
score: 1
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28350421

http://stackoverflow.com/comment/45109248
comment on: http://stackoverflow.com/a/28385699
type: Comment
has text: I would look into something like [bootstrap](http://getbootstrap.com) for a responsive grid system that even has your collapse elements. Otherwise you could dynamically set the height of the div based on the image height with a little Javascript.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45016575
has text: @JoshTaylor That's a good call, I just threw any old element in the to demonstrate the issue & solution.
comment on: http://stackoverflow.com/a/28335042
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28335080
has title: How to get a loop through objects to return an object instead of string?
type: Question
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28335115
score: 0
has body: I have an object, cards, which is made up of other objects. When I loop through cards, I expect other objects to get returned. Instead, only a string is returned. I've included what gets returned inline in the code below. console.log(typeof cards); //returns object console.log(cards); //returns the 3 objects: [Object, Object, Object] console.log(cards.length); //returns 3 for (var card in cards){ console.log(typeof card); //returns 0,1,2 as a string, but it should return another object };
linked to: http://stackoverflow.com/q/500504
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28335115

http://stackoverflow.com/q/28431669
has body: I'm using spring mvc and AngularJs to have a rest web service the problem that angularJs doesn't work the home.html page Villes Tunisie List des villes {{ville.nom}} {{ville.gouvernorat }} Plus de détail the details.html page les villes en details {{ville.nom}} Gouvernorat {{ville.gouvernorat}} caracteristique {{ville.caracteristique}} the controller: package com.formation.villes.controller; import java.util.ArrayList; import java.util.List; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import com.formation.villes.model.Villes; @Controller @RequestMapping("/villes") public class VillesController { public Villes ville; @RequestMapping(value = "/home", method = RequestMethod.GET) public @ResponseBody List<Villes> list() { List list= new ArrayList<Villes>(); Villes ville1 = new Villes(); ville1.setNom("sfax"); ville1.setCaracteristique("industriel"); ville1.setGouvernorat("sfax"); Villes ville2 = new Villes(); ville2.setNom("Djerba"); ville2.setCaracteristique("touristique"); ville2.setGouvernorat("mednine"); Villes ville3 = new Villes(); ville3.setNom("chebba"); ville3.setCaracteristique("touristique"); ville3.setGouvernorat("mahdia"); Villes ville4 = new Villes(); ville4.setNom("ain draham"); ville4.setCaracteristique("touristique"); ville4.setGouvernorat("Jendouba"); list.add(ville1); list.add(ville2); list.add(ville3); list.add(ville4); return list; } @RequestMapping(value = "/villes/{nom}", method = RequestMethod.GET) public @ResponseBody Villes getByName(@PathVariable String nom) { return ville; } } and for the angularJS code the module: angular.module('villeApp', ['villeService']). config(['$routeProvider', function ($routeProvider) { $routeProvider. when('villes/home', {templateUrl:'html/home.html', controller:Vill…
type: UnansweredQuestion
tagged with: web-services
tagged with: spring-mvc
score: 0
type: Question
tagged with: javascript
has title: spring mvc, rest, angularJs
answer count: 1
has comment: http://stackoverflow.com/comment/45193625
tagged with: angularjs
has answer: http://stackoverflow.com/a/28435116

http://stackoverflow.com/comment/45109827
comment on: http://stackoverflow.com/q/28385821
score: 0
type: QuestionComment
has text: @DominicP how can i declare `$post` as global variable
type: Comment

http://stackoverflow.com/q/28280414
has answer: http://stackoverflow.com/a/28280827
tagged with: javascript
tagged with: forms
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/44915351
tagged with: jquery
has body: How could I copy the selected radio (from a radio group) to another one? Here's my jsfiddle: http://jsfiddle.net/fu3oyscq/1/ This is my jquery $("#copy input[name='copyOne']:checked").val( $("#original input[name='selectOne']:checked").val() )
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/44914919
has title: Copy selected radio to another radio
has answer: http://stackoverflow.com/a/28280985

http://stackoverflow.com/a/28357455
has comment: http://stackoverflow.com/comment/45058419
has comment: http://stackoverflow.com/comment/45058536
downvote count: 1
has comment: http://stackoverflow.com/comment/45058770
has comment: http://stackoverflow.com/comment/45058790
score: 5
accepted answer of: http://stackoverflow.com/q/28357405
answers question: http://stackoverflow.com/q/28357405
type: AcceptedAnswer
has body: Try this workaround: For your 'Dar Mode' css, add the dark-mode class before each selectors. i.e., .dark-mode input { } .dark-mode input.switch:empty ~ label { } etc... Then in your JS, just toggle the class 'dark-mode' for the body. I think it might be more effecient that way. Try this similar demo: http://jsfiddle.net/7Lfv0jqL/
type: Answer
has comment: http://stackoverflow.com/comment/45058305
upvote count: 6

http://stackoverflow.com/comment/44976096
has text: @SarveshKumarSingh Thanks for your answer, but if I add the content_type, the req.body is empty.
comment on: http://stackoverflow.com/q/28297702
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28303882
score: 0
answer count: 3
accepted answer: http://stackoverflow.com/a/28303958
has title: ng-model in input based on another variable
tagged with: javascript
has body: I han an input filed in my angular app &lt;input type="text" ng-model="variableA"&gt;. I want to use variableA or variableB basing on some condition. I've tried something like this ng-model="condition ? variableA : variableB" but it throws Error: [ngModel:nonassign]. Any ideas how to make it work?
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28303998
has answer: http://stackoverflow.com/a/28303958
has answer: http://stackoverflow.com/a/28303998
tagged with: angularjs
type: Question
has comment: http://stackoverflow.com/comment/44959140
has answer: http://stackoverflow.com/a/28303959

http://stackoverflow.com/comment/45053847
type: Comment
comment on: http://stackoverflow.com/q/28354902
has text: @KevinB I see, I was able to get it to work with plain `for` loop and treating the `var` as an `int` and that worked. thanks again!
score: 0
type: QuestionComment

http://stackoverflow.com/q/28408707
favorite count: 0
score: 6
has title: Local scope object
has answer: http://stackoverflow.com/a/28443467
accepted answer: http://stackoverflow.com/a/28443467
has body: I am just curious if there is such a thing as a 'local scope object' in JavaScript. If you invoke a function, it has a context (this), which is the object it has been called on (function f() {return this;}; obj.f = f; obj.f(); //returns obj;), and a scope, which is created on every function call. The scope is used to define local variables as in the following example: var globalScopeVar = 1; (function() { var localScopeVar = 2; })(); In both scopes this refers to the global context (typically, window), since the function has not been called on any object. What I am interested in, though, is the 'scope object', i.e, the object where variables within a scope are defined on. For the global scope this is typically window, just like the global context: window.globalScopeVar; // 1 However, what is the 'scope object' in the local scope of a function call? Does it even exist or is it accessible? Is there any way to access an object where localScopeVar is defined on? (function() { var localScopeVar = 2; localScope.localScopeVar; // 2 })(); What is localScope in this example?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45151783
type: Question
upvote count: 6
tagged with: javascript
has comment: http://stackoverflow.com/comment/45151311
has comment: http://stackoverflow.com/comment/45151275
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/45097870
comment on: http://stackoverflow.com/q/28379010
type: Comment
type: QuestionComment
score: 0
has text: Again one more PHP coder using Grandpa Style coding which is heavily neglecting Security !!!! DONT ever use `mysql_query` , use PDO or mysqli .

http://stackoverflow.com/comment/45110718
has text: You listen when the user presses ctrl+c, then you write your own text to the clipboard. It tackles the same problem.
comment on: http://stackoverflow.com/q/28386309
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/a/28413295
type: Answer
has body: first of all, about html structure: an &lt;ul&gt; accepts only &lt;li&gt; elements as children, you can't add a &lt;div&gt; element to it, because its an error and every browser will try to calculate distances and fix it in its way. So you have to put it outside, after the list. then, about .box animation: you can't use a css static percentual measure to calculate its position, you can calculate .box position using the relative &lt;a&gt; element offsetLeft javascript property
score: 0
answers question: http://stackoverflow.com/q/28389811

http://stackoverflow.com/a/28365471
answers question: http://stackoverflow.com/q/28365194
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28365194
upvote count: 2
type: AcceptedAnswer
has body: There is no d property in your JSON, so you can simply access data[0].itemData. Try this: $.each(data[0].itemData, function (index, element) { console.log(element.Key); }) Example fiddle
type: Answer
score: 2

http://stackoverflow.com/q/28296535
accepted answer: http://stackoverflow.com/a/28297611
answer count: 3
upvote count: 9
has title: How to update C3.js graph line width and tick color?
possible better answer: http://stackoverflow.com/a/36629791
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/36629791
tagged with: javascript
has answer: http://stackoverflow.com/a/28297611
favorite count: 0
score: 9
type: Question
tagged with: http://stackoverflow.com/tag/html
has body: How to update the default line width in a C3.js graph? How to update the tick (the circles) color?
tagged with: http://stackoverflow.com/tag/svg
has answer: http://stackoverflow.com/a/54710088
tagged with: c3.js

http://stackoverflow.com/q/28390384
tagged with: each
has title: Replace JavaScript for loop with _.each() function
type: Question
has answer: http://stackoverflow.com/a/28390638
tagged with: javascript
has comment: http://stackoverflow.com/comment/45118177
score: 0
tagged with: for-loop
answer count: 1
has body: I am trying to replace a JavaScript For Loop with the underscore.js each() function. for (var x = 0; x &lt; count; x++) { slider[x].setAttribute('id', arguments[x]); sliderPagination[x].setAttribute('id', arguments[x]+'Pagination'); // Initialise swiper var slider = new Slider('#'+arguments[x], { pagination: '#'+arguments[x]+'Pagination', loop:true, grabCursor: true, paginationClickable: true }) } I am new to using underscore so not quite sure the best way to do this. Do I need the index iteration when using the _.each() function for this? UPDATE: // Function to initialize multiple instances of slider plugin function loadSliders(values) { var sliders = document.getElementsByClassName("swiper-container"), slidersPaginations = document.getElementsByClassName("swiper-pagination"), count = Math.min(sliders.length, arguments.length), i = 0; _.each(sliders, function(sliders, index) { var argumentsVariable = values[index]; sliders.setAttribute('id', argumentsVariable); slidersPaginations[index].setAttribute('id', argumentsVariable+'Pagination'); // Initialise swiper var slider = new Swiper('#'+argumentsVariable, { pagination: '#'+argumentsVariable+'Pagination', loop:true, grabCursor: true, paginationClickable: true }) }); }
accepted answer: http://stackoverflow.com/a/28390638
type: AnsweredQuestion
tagged with: underscore.js

http://stackoverflow.com/comment/44976209
type: QuestionComment
has text: append() is actionscript isn't it?
comment on: http://stackoverflow.com/q/28312986
score: 0
type: Comment

http://stackoverflow.com/comment/44935877
has text: Sorry, Meant javascript I guess! I will try and do this with a web server and see if the problem is solved.
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28291202

http://stackoverflow.com/comment/45175238
type: Comment
type: QuestionComment
has text: http://jsfiddle.net/wabf2t09/ this is a basic example illustrating how to implement a model into multiple controllers. Obviously you need to refine your search function to search on whatever data you have. There are other ways to do this. Probably better than this, but the main idea is you want to retrieve your data from your model.
comment on: http://stackoverflow.com/q/28419042
score: 0

selector
tags question: http://stackoverflow.com/q/28390844
type: Tag
tag name: selector
tags question: http://stackoverflow.com/q/28287929
tags question: http://stackoverflow.com/q/28297344

http://stackoverflow.com/q/28294515
upvote count: 1
has comment: http://stackoverflow.com/comment/44946919
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28298392
score: 1
has body: Can anyone help me figure out how to rewrite the following working code in promise? I want to execute an insert query and then send the data back to clients via socket.js var func = require("functions") var mongoose = require('mongoose'); var mongo_models = require('./database/mongo_model')(mongoose); var Promise = require("bluebird"); socket.on("submit",function(d){ if(d[0].src !== undefined) { var data = func.clear(sanitizer,d), tab = new mongo_models.Tab({avg:0,post:data}); tab.save(function(err,tw){ io.sockets.in('index').emit("update",tw) }) } }); I have tried the following code but I'm getting undefined from console.log(b). Apparently the save() isn't returning any result. Promise: socket.on("submit",function(d){ if(d[0].src !== undefined) { Promise.props({ one: func.clear(sanitizer,d) }).then(function(a){ return new mongo_models.Tab({avg:0,post:a.one}).save(); }).then(function(b){ console.log(b); // undefined io.sockets.in('index').emit("update",b) }).catch(function (error) { console.log(error); }) } });
type: Question
tagged with: mongodb
answer count: 1
downvote count: 0
tagged with: mongoose
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28298392
has title: Unable to get bluebird promise and mongoose's save() to work in node.js
tagged with: node.js
tagged with: promise

http://stackoverflow.com/q/28416551
has comment: http://stackoverflow.com/comment/45170704
has comment: http://stackoverflow.com/comment/45170126
possible better answer: http://stackoverflow.com/a/28454272
favorite count: 0
tagged with: angularjs
score: 6
has comment: http://stackoverflow.com/comment/45190271
has body: I have a basic directive in a MVC 5 Layout Page with a directive for searching. My problem is that the templateUrl cannot be loaded (400 error). If I enter the URL directly into the browser, I can load the html page without difficulty or error. I cannot find out why the AJAX call to load the page is failing. Chrome Debugger This is the HTML page loading in Chrome app.js (function() { var app = angular.module("mainApp"); app.directive("basicSearch", function() { return { templateUrl: 'app/directives/basic-search.html', controller: function($scope, search) { $scope.keyword = ''; $scope.exact = false; $scope.submitSearch = function () { search.searchByKeyword($scope.keyword, 0, $scope.exact); } } } }); }()); basic-search.html Exact Match? _Layout.cshtml @RenderBody() EDIT Here is the successful request (via browser): and here is the one that fails (via Angular directive):
has comment: http://stackoverflow.com/comment/45166264
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45166566
downvote count: 0
has comment: http://stackoverflow.com/comment/45166464
has comment: http://stackoverflow.com/comment/45191136
has answer: http://stackoverflow.com/a/28454272
has answer: http://stackoverflow.com/a/30014936
type: Question
tagged with: angularjs-directive
accepted answer: http://stackoverflow.com/a/30014936
answer count: 2
tagged with: asp.net-mvc
has title: AngularJS Directive templateUrl returns 400 though file URL loads
upvote count: 6
tagged with: javascript
has comment: http://stackoverflow.com/comment/45234226

http://stackoverflow.com/comment/45065345
comment on: http://stackoverflow.com/q/28361496
type: Comment
type: QuestionComment
has text: can use a `setTimeout(myfunction, 0);` to defer the call of a function, but don't know if that could solve your problem.
score: 0

http://stackoverflow.com/a/28296956
accepted answer of: http://stackoverflow.com/q/28294681
score: 1
type: AcceptedAnswer
upvote count: 1
type: Answer
downvote count: 0
has body: I think the problem is that javascript monthhs start at zero not one. Try this: post.push(Date.UTC(postDateTime[1],postDateTime[2]-1, postDateTime[3],postDateTime[4])); // add post on correct date/time spot Note the -1 in the month parameter. http://jsfiddle.net/6s4bhro1/
answers question: http://stackoverflow.com/q/28294681

http://stackoverflow.com/q/28366718
type: Question
tagged with: swig
has answer: http://stackoverflow.com/a/28367191
tagged with: eclipse-cdt
answer count: 1
tagged with: javascript
score: 0
has body: I have a C++ library which I want to call in node.js. For that I opted for SWIG. But it requires to use visual studio c++. My preference is eclipse CDT. Is there any way SWIG be used with eclipse? Also is there any other tool or Addon that could help interfacing between node.js and c++.
has title: can eclipse CDT be used in place of vc++ inorder to call C++ library in node.js by using SWIG?
accepted answer: http://stackoverflow.com/a/28367191
tagged with: node.js
tagged with: c++
type: AnsweredQuestion

http://stackoverflow.com/a/28299920
score: -1
answers question: http://stackoverflow.com/q/28299792
has comment: http://stackoverflow.com/comment/44952031
upvote count: 0
has comment: http://stackoverflow.com/comment/44951979
has comment: http://stackoverflow.com/comment/44951728
has comment: http://stackoverflow.com/comment/44951746
type: Answer
has body: May I suggest that you use $.ajax() instead of $.post() as it's much more customizable. var array = []; $.ajax({ type: 'POST', url: path, data: { id: i }, async:false, //here you can set synchronous behaviour dataType : "json" success: function(data) { console.log(data); array.push(data); } }); jQuery Ajax Documentation
has comment: http://stackoverflow.com/comment/44951903
has comment: http://stackoverflow.com/comment/44984007
has comment: http://stackoverflow.com/comment/44952153
downvote count: 1

http://stackoverflow.com/q/28433519
favorite count: 0
has answer: http://stackoverflow.com/a/28433612
has title: Print javascript error in custom console
upvote count: 1
possible better answer: http://stackoverflow.com/a/28433707
has answer: http://stackoverflow.com/a/28433707
accepted answer: http://stackoverflow.com/a/28433612
type: AnsweredQuestion
score: 1
has body: I have a browser that doesn't have any console. I need to redirect the output to my home made console. Is there a way to achieve that ?
type: Question
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45198854
tagged with: javascript
has comment: http://stackoverflow.com/comment/45197106
tagged with: console

http://stackoverflow.com/comment/45194553
has text: 2 and more countups in one static page with one js.
score: 0
comment on: http://stackoverflow.com/q/28432078
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28320349
has comment: http://stackoverflow.com/comment/112595570
possible better answer: http://stackoverflow.com/a/74494158
has body: I have 2 inputs with type number: &lt;input type="number"&gt; http://jsfiddle.net/dkadr55g/1/ I want to hide arrows from the right for first input, I found solution using this code: input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; } but if using this, all inputs doesn't create arrows http://jsfiddle.net/dkadr55g/2/ how to set for first withoud arrows and for second with arrows?
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 6
has answer: http://stackoverflow.com/a/74494158
has answer: http://stackoverflow.com/a/28320446
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has answer: http://stackoverflow.com/a/28320430
accepted answer: http://stackoverflow.com/a/28320430
has answer: http://stackoverflow.com/a/28320462
score: 11
tagged with: css
upvote count: 11
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28320479
has title: input type number hide arrows from right part of input
has answer: http://stackoverflow.com/a/28320531
type: Question

http://stackoverflow.com/a/28318657
has body: Just use scope.$on('$destroy', destroyCallback)
type: Answer
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/28313443
answers question: http://stackoverflow.com/q/28313443
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28342002
score: 4
accepted answer: http://stackoverflow.com/a/28361558
linked to: http://stackoverflow.com/q/19625581
upvote count: 5
downvote count: 1
has comment: http://stackoverflow.com/comment/45030962
has title: Can I combine RequireJs modules AND require.js itself into one js-bundle
tagged with: javascript
type: Question
has answer: http://stackoverflow.com/a/28342074
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28361558
has body: I'm using RequireJs Optimizer to combine all modules into one file - app.js On production I have two js files: app.js and require.js Production HTML has following script tag: &lt;script data-main="app.js" src="require.js"&gt;&lt;/script&gt; This will result in two requests for js files when running. The question: is it possible to combine everything including all modules and require.js itself into one file, so I have only one request when running?
favorite count: 0
possible better answer: http://stackoverflow.com/a/28342074
answer count: 2
tagged with: requirejs
tagged with: requirejs-optimizer

http://stackoverflow.com/comment/45066399
score: 1
has text: I'm not exactly sure I understand how this works. I've read in numerous areas that the bracket and dot notation were completely interchangeable. Could you please link me somewhere that this is explained in detail?
type: AnswerComment
comment on: http://stackoverflow.com/a/28362141
type: Comment

package.json
tag name: package.json
tags question: http://stackoverflow.com/q/28355724
type: Tag

http://stackoverflow.com/a/28367772
answers question: http://stackoverflow.com/q/28367734
has comment: http://stackoverflow.com/comment/45076663
has body: You can check if its null and make it empty so .length is still valid: "success": function (data) { data = data || []; } Update: function drawRadnici() { $('#tableradnici').dataTable({ "ajax": { "url": 'track_radnici.php', "type": 'POST', "dataSrc": function (json) { if(!json.data){ $('#tabeleradnici').html('No result'); json.data = []; } return json.data; }, "data": { ajdi: ajdi } }, paging: false, //"dom":' &lt;"search"f&gt;&lt;"top"l&gt;rt&lt;"bottom"ip&gt;&lt;"clear"&gt;', // end , "columns": [{ "data": "datum" }, { "data": "radnik" }, { "data": "radnih_sati" }, { "data": "cena" }, { "data": "ukupno" }, { "data": "ID" }], "columnDefs": [ { "targets": 5, "data": "ID", "render": function(data, type, full, meta) { // return data; return '&lt;i value="' + data + '" class="fa fa-times"&gt;&lt;/i&gt;'; } } ] }); };
has comment: http://stackoverflow.com/comment/45076951
accepted answer of: http://stackoverflow.com/q/28367734
has comment: http://stackoverflow.com/comment/45077149
has comment: http://stackoverflow.com/comment/45077430
has comment: http://stackoverflow.com/comment/45077240
has comment: http://stackoverflow.com/comment/45076995
has comment: http://stackoverflow.com/comment/45077170
has comment: http://stackoverflow.com/comment/45077357
has comment: http://stackoverflow.com/comment/45076709
has comment: http://stackoverflow.com/comment/45076758
has comment: http://stackoverflow.com/comment/45101701
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45077550
has comment: http://stackoverflow.com/comment/45077029
has comment: http://stackoverflow.com/comment/45077845
has comment: http://stackoverflow.com/comment/45077215
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/45076705
score: 2

http://stackoverflow.com/q/28386572
has answer: http://stackoverflow.com/a/28386997
possible better answer: http://stackoverflow.com/a/28386676
type: Question
has comment: http://stackoverflow.com/comment/45110867
answer count: 2
has answer: http://stackoverflow.com/a/28386676
tagged with: javascript
has body: I am attempting to load a template using Angular's ui-router. index.html &lt;html ng-app="someApp"&gt; &lt;body ng-controller='SomeCtrl'&gt; &lt;div ui-view&gt; &lt;/div&gt; &lt;/body&gt; app.js angular.module('someApp', []) .config(function($stateProvider){ $stateProvider .state('someApp', { url:"/", templateUrl: 'app/things/things.tmpl.html', controller: 'SomeCtrl' }) }) When I attempt to go to the root of the application in localhost (dragging and dropping the html file into the browser) I get a CORS error: XMLHttpRequest cannot load file://localhost/Users/me/theApp/src/app/things/things.tmpl.html. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource. The url in my browser window and the url in the error seem to be one in the same. Is it because Angular uses an HTTP request to fetch the template as indicated in this answer? They don't seem to be analogous problems, as there shouldn't be a different domain besides localhost serving the template.
score: 0
tagged with: cors
accepted answer: http://stackoverflow.com/a/28386997
tagged with: angularjs
type: AnsweredQuestion
has title: AngularJS, Localhost, and CORS errors when loading a template
linked to: http://stackoverflow.com/q/24616126

http://stackoverflow.com/comment/44972454
type: QuestionComment
comment on: http://stackoverflow.com/q/28310796
score: 0
has text: This a *JavaScript array* of *JavaScript objects*. It's not JSON and has nothing to do with JSON.
type: Comment

http://stackoverflow.com/a/28428644
score: 1
has body: I solved by Adding Hover inside click social__click : function(){ $(social__sharing__icon).on('click',function(e){ e.preventDefault(); $(social__sharing__content).show(); $(social__sharing__icon).on('mouseout',function(){ $(social__sharing__content).show(); }); }); },
answers question: http://stackoverflow.com/q/28426564
downvote count: 0
type: Answer
upvote count: 1

http://stackoverflow.com/q/28320839
score: 0
tagged with: backbone.js
has body: Here is what i have as the backbone code: myEventModel = Backbone.Model.extend({}); var view_one = Backbone.View.extend({ initialize : function(){ myEventModel.on('change:someChange',function(){alert('Change observed for view one')}); } render: function(){ $('body').append('view one')} }); var view_two = Backbone.View.extend({ initialize : function(){ myEventModel.on('change:someChange',function(){alert('Change observed for view two')}) } render: function(){ $('body').append('view two')} }); So I have two views listening to a global model events. So when in console, I do myEventModel.set({'someChange':new Date().getTime()}); i should see two alerts. But I don't. jsfiddle
type: UnansweredQuestion
has title: shared model in backbone not acquiring events
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28321186
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28321231

http://stackoverflow.com/comment/45021645
type: Comment
type: QuestionComment
score: 0
has text: i m testing it in ie9 and ie8
comment on: http://stackoverflow.com/q/28337858

http://stackoverflow.com/comment/45152201
has text: Can you narrow down your question? Which specific part of the problem you don't know how to do? Also, I urge you to take a look at [`declarativeContent` API documentation](https://developer.chrome.com/extensions/declarativeContent), it may be a much better approach for showing a page action.
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28409066

http://stackoverflow.com/q/28311691
type: UnansweredQuestion
tagged with: safari
has body: When try to save/load from websqlite using "window.openDatabase(...)" in mac safari, sometimes fails with the following exception: sqlite cannot open database file Then the websql can no-longer use unless reload the page. Does anybody know how it can be solved? THX. p.s. It`s on desktop mac safari, not ios safari or the issue "less or more data stored more than 5MB question".
type: Question
has title: openDatabase error in mac safari
tagged with: javascript
score: 0
tagged with: web-sql
tagged with: sqlite
answer count: 1
has answer: http://stackoverflow.com/a/33180474
tagged with: macos

http://stackoverflow.com/comment/45017383
type: Comment
has text: Did the above way, pretty helpful
comment on: http://stackoverflow.com/a/28295604
type: AnswerComment
score: 0

http://stackoverflow.com/q/28336573
has comment: http://stackoverflow.com/comment/45021347
favorite count: 0
tagged with: cordova
downvote count: 0
tagged with: android
has comment: http://stackoverflow.com/comment/45021605
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/45020779
type: Question
has comment: http://stackoverflow.com/comment/45021467
has comment: http://stackoverflow.com/comment/45022589
has title: Access cordova plugins in downloaded html files
has comment: http://stackoverflow.com/comment/45020861
tagged with: ios
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28409007
accepted answer: http://stackoverflow.com/a/28409007
has body: I have a requirement where I need to download some HTML files from server and open them in the Cordova Webview. I am facing challenge in accessing plugins from these downloaded files. What path I need to put in my &lt;script&gt; tags of downloaded HTML file to access Cordova Plugin JS file packaged with the application under asset/www/ folder ? Can I put file:///android_asset/www/cordova.js in my HTML? Can I use loadDataWithBaseURL in place of loadURL ? If not what will be its equivalent ? Also need answer for iOS environment. Need to answer this urgently. Update : I am loading my downloaded files like loadUrl("file://"+pathToInternalStorage_Index.html"); Inside my HTML I have put &lt;script src="file:///android_asset/www/cordova.js&gt;&lt;/script&gt; Now when I open the downloaded file I get popup with EditText saying "gap_init:2" and after clicking OK, I get error in console as CordovaWebview: TIMEOUT ERROR! Error for Plugin is: "Error : Method not found .... .... (file:///android_asset/www/cordova.js:927:44) .... ....
upvote count: 1

http://stackoverflow.com/comment/45147882
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28406805
score: 0
has text: check this http://stackoverflow.com/questions/9213660/html-javascript-one-click-print-no-dialogs

http://stackoverflow.com/comment/44986586
type: Comment
type: QuestionComment
has text: @JamesDonnelly Some users dont know how to use `Code Snippest` that's why.
comment on: http://stackoverflow.com/q/28318820
score: 0

http://stackoverflow.com/a/28352377
has body: You can consider to use the selenium webdriver. It will load the page after the function work (WebDriver get method), find the specific element (findelement method), you will receive the selenium WebElement object and then you can assert if this element contains the expected result that may be the test parameter. This approach will allow to write one test method that will different just by input parameter. Please see the following link for more info
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28322084

http://stackoverflow.com/q/28404398
has body: at run time when user try to enter anything inside the above text area, it should display password format or special characters e.g.: *********
has answer: http://stackoverflow.com/a/28404643
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28404445
score: -6
has comment: http://stackoverflow.com/comment/45143445
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/106823620
upvote count: 1
has comment: http://stackoverflow.com/comment/45143286
has comment: http://stackoverflow.com/comment/45146446
has title: mask all entered text in textarea in password format e.g. ********
linked to: http://stackoverflow.com/q/12895774
has comment: http://stackoverflow.com/comment/106823502
downvote count: 7
type: Question
answer count: 2
tagged with: asp.net-mvc
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28356768
type: Question
has body: I am mapping 20k records from Google Fusion table using standard circle. I would like to group them using MarkerClusters. Because there is filtering and search occuring, I am not sure where to place the var markerCluster = new MarkerClusterer(map, markers); code. Here is the map. Code snippet where markers are created: //*New Fusion Tables Requirement* API key. found at https://code.google.com/apis/console/ //*Important* this key is for demonstration purposes. please register your own. googleApiKey: "AIzaSyDj8qostHt2L3aetpO_LuipyS6YvfeZOFA", //name of the location column in your Fusion Table. //NOTE: if your location column name has spaces in it, surround it with single quotes //example: locationColumn: "'my location'", locationColumn: "geo_coordinates", map_centroid: new google.maps.LatLng(40.7127,-74.0059), //center that your map defaults to locationScope: "new york city", //geographical area appended to all address searches recordName: "result", //for showing number of results recordNamePlural: "results", searchRadius: 805, //in meters ~ 1/2 mile defaultZoom: 13, //zoom level when map is loaded (bigger is more zoomed in) addrMarkerImage: 'images/blue_pin.png', currentPinpoint: null, initialize: function() { $( "#result_count" ).html(""); geocoder = new google.maps.Geocoder(); var myOptions = { zoom: MapsLib.defaultZoom, center: MapsLib.map_centroid, mapTypeId: google.maps.MapTypeId.TERRAIN, }; map = new google.maps.Map($("#map_canvas")[0],myOptions); map.setTilt(45); map.setOptions({ styles : styles }); // maintains map centerpoint for responsive design google.maps.event.addDomListener(map, 'idle', function() { MapsLib.calculateCenter(); }); google.maps.event.addDomListener(window, 'resize', function() { map.setCenter(MapsLib.map_centroid); }); MapsLib.searchrecords = null;
tagged with: google-maps
has comment: http://stackoverflow.com/comment/45058444
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45058194
has title: MarkerClusters from Fuson Table in Google Map api
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45058292
has comment: http://stackoverflow.com/comment/45058360

http://stackoverflow.com/comment/45081191
score: 0
comment on: http://stackoverflow.com/q/28369522
type: Comment
type: QuestionComment
has text: I take that back.. it's `undefined` because `favfunction` is not an instance method. as for the `$('#calButton`)` portion.. `data-wid` must be 5; therefore, `$res1->user_id` was 5.. but then, I don't think this is the question you're meaning to ask..

http://stackoverflow.com/a/28647277
accepted answer of: http://stackoverflow.com/q/28368689
downvote count: 0
has comment: http://stackoverflow.com/comment/46874890
answers question: http://stackoverflow.com/q/28368689
has body: This seems to happen if jscs doesn't have read access to your .jscsrc or if it doesn't exist. This happened to me after copying and pasting it from an old git repro. To fix this open the file with a text editor and resave it, accepting the prompt to overwrite as well as starting with a '.' (e.g. .jscsrc) Run your task again and it will complete.
has comment: http://stackoverflow.com/comment/46794615
upvote count: 8
has comment: http://stackoverflow.com/comment/45613292
has comment: http://stackoverflow.com/comment/46612078
has comment: http://stackoverflow.com/comment/46665653
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45798743
score: 8
has comment: http://stackoverflow.com/comment/45661308
has comment: http://stackoverflow.com/comment/45707725
type: Answer

http://stackoverflow.com/a/28389463
score: 1
answers question: http://stackoverflow.com/q/28389437
type: AcceptedAnswer
downvote count: 0
has body: The reason is you are updating the property on the same object reference (newItem) every time. So it updates all other items in the array because they all just point to the same object or in other words they are all same. You could instead get the copy of the object using angular.copy and push that item. var item = { itemNum: 0, name: "New" }; $scope.addItem = function () { var newItem = angular.copy(item); //Get the copy newItem.itemNum = $scope.count; Fiddle
upvote count: 1
type: Answer
accepted answer of: http://stackoverflow.com/q/28389437

http://stackoverflow.com/q/28334868
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28335072
tagged with: string
has comment: http://stackoverflow.com/comment/45016264
tagged with: parsing
has comment: http://stackoverflow.com/comment/45016216
favorite count: 0
upvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28335072
has answer: http://stackoverflow.com/a/28344184
has comment: http://stackoverflow.com/comment/45016425
downvote count: 1
type: Question
has title: JavaScript sorting a string of integers
has comment: http://stackoverflow.com/comment/45016518
tagged with: arrays
has comment: http://stackoverflow.com/comment/45016519
tagged with: javascript
has body: So I have this form which takes in a string of numbers that needs to be split at each semi colon and space. Afterwards, it sorts the numbers and returns the sorted list. For some reason, when I click on the button, it does not post the value in the text box. Can anyone help me solve my problem please! Thank you. Edit 1: Added the name to the form and added the fieldset function sort() { var allNumbers = document.mainForm.mainSet.numbers.value.split("; "); allNumbers.parseFloat; for (var i = 0; i < allNumbers.length; i++) { allNumbers[i] = parseInt(allNumbers[i], 10); } allNumbers.sort(); document.mainForm.mainSet.sorted.value = allNumbers.toString(); } Enter Numbers: Select Option: Ascending Descending Sorted Numbers:
possible better answer: http://stackoverflow.com/a/28334921
score: 0
has answer: http://stackoverflow.com/a/28334921
answer count: 3

http://stackoverflow.com/comment/45157477
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28402100
has text: Ha ha, oh, man. The article is basically saying there is no standard or workaround. I would basically have to use a different method to support each browser... It also concludes in the summary that there is sometimes a delay before properties become available even after page load. I assume this refers to my problem with Firefox... Such a bittersweet realization. The article is 4 years old, of course, and I have read it before. Is there really still no standard?
type: Comment

http://stackoverflow.com/comment/45153053
type: Comment
type: QuestionComment
has text: Use Firebug/Chrome developer tools/Fiddler to look at what HTTP request is being generated.
comment on: http://stackoverflow.com/q/28409784
score: 0

http://stackoverflow.com/q/28422993
has comment: http://stackoverflow.com/comment/45179145
tagged with: jquery-plugins
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/29089667
tagged with: jquery
has comment: http://stackoverflow.com/comment/45179409
favorite count: 0
has comment: http://stackoverflow.com/comment/45179101
has title: Two (Separate) jQuery Tab Plugins Kill my Code
has comment: http://stackoverflow.com/comment/45179506
tagged with: http://stackoverflow.com/tag/html
has body: I'm developing a very large page with lots of content and some overlays and all kinds of complicated things. I'll spare you all the code and only include the relevant pieces. Essentially, I have some sidebar buttons that open an overlay depending on the button clicked. The HTML is below: Invoices And here is some of the Javascript: $(sideBtns).click(function(index){ var newId = "#" + (($(this).data("linkto")).toString()); var newOverlay = $(newId); }); (I've left out a LOT of the Javascript, as I said I'm only including the relevant bits. That 'toString' might not be necessary, I'm not entirely sure I had it in there looking back, but I very much doubt that's the problem.) BEFORE adding the jQuery tab plugin, this code works fine. Now, INSIDE one of these overlays, I need some 'tabbed' content - so I downloaded three separate jQuery tab plugins, and ALL THREE of them produced the same error. In this particular case, the one I'm using is Tabslet. First, here's the HTML of the tab area: Tab 1 Tab 2 Tab 3 And here's the Javascript: $('.tabs').tabslet(); For some reason, every single jQuery tab plugin I use produces the same identical error (I've also used jQuery's UI core plugin, and EasyTabs). When I try to open ANY overlay using the sidebar buttons, the overlay doesn't appear, and I get THIS console error: Uncaught TypeError: Cannot read property 'toString' of undefined Perhaps the oddest element of this error is that it only appears ONCE. Any subsequent clicks after that first error function properly. I just don't see how these plugins could be causing this error to appear. jQuery was able to read the custom data field before, how come it can't all of a sudden? If I don't call the plugin, it works again. I realize this is a very long and complicated problem, but if anyone has ideas as to what this problem is and how to fix it, I'd be extremely grateful!
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45179188
has comment: http://stackoverflow.com/comment/45178993
accepted answer: http://stackoverflow.com/a/29089667
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45179376
has comment: http://stackoverflow.com/comment/45179264
tagged with: javascript

http://stackoverflow.com/comment/44925929
type: Comment
type: QuestionComment
has text: @Gwin003 http://jsfiddle.net/#&togetherjs=6B8FkPihMg
comment on: http://stackoverflow.com/q/28285793
score: 0

http://stackoverflow.com/comment/44963553
comment on: http://stackoverflow.com/a/28306210
type: Comment
has text: AHHHHH....i did that twenty times but i wasnt passing $event in the ngClick call....Thank you so much
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45119237
comment on: http://stackoverflow.com/q/28390875
score: 0
type: Comment
type: QuestionComment
has text: Everything works. Just use last versions of bootstrap and angular ui

http://stackoverflow.com/comment/45084212
comment on: http://stackoverflow.com/q/28371867
type: Comment
score: 0
has text: *I will... I want to... & want to...* Have you tried anything?
type: QuestionComment

http://stackoverflow.com/comment/45094466
type: QuestionComment
comment on: http://stackoverflow.com/q/28377096
score: 1
has text: Not sure if I completely understand this, but could you do: `b = function(){ return a() };`?
type: Comment

http://stackoverflow.com/q/28370039
tagged with: ajax
has answer: http://stackoverflow.com/a/28370662
score: 0
has answer: http://stackoverflow.com/a/28370521
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has body: Sorry, My first language is not English. I am not sure that if I explain my question properly. My code is like a main function have two ajax functions (Use ajax function to get foursquare API) main(){ ajax1(); ajax2(); all other codes } the ajax2() function has to get result from ajax1() as input and then return result(actually result was pushed in to global array). all other codes should be processed after two ajax functions are finished. I tried the asyn: false but it is not working. My html file include newest jquery like this &lt;script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js" &gt;&lt;/script&gt; I try the jquery function $.when().done() function and the first ajax works. However, the second ajax() function was in the for loop. The for loop will destroy the mechanism of $.when().done() function: first ajax: in firstjson function Second ajax: in transfer function function firstjson(tmpName,tmpLoc,PhotoJson,foursq){ return $.ajax({ type: 'GET', url: foursq, dataType: 'jsonp', success: function(json) { for (i = 0; i &lt; 3; i++) { var resultname = json['response']['venues'][i].name; var resultlocation = json['response']['venues'][i].location; var resultlat = resultlocation.lat; var resultlng = resultlocation.lng; var tmpmarker = new google.maps.LatLng(resultlat,resultlng) tmpName.push(resultname); tmpLoc.push(tmpmarker); var resultid = json['response']['venues'][i].id; var tmpPhotoJason = 'https://api.foursquare.com/v2/venues/'+ resultid +'/photos?'; PhotoJson.push(tmpPhotoJason); } } }); } function transfer(PhotoJson,PhotoURL){ for (i = 0; i &lt; 3; i++) { return $.ajax({ type: 'GET', url: PhotoJson[i], dataType: 'jsonp', success: function(json) { resultphoto = json['response']['photos']['items']; photoprefix = resultphoto[i].prefix; photopresuffix = resultphoto[i].suffix; photourl = photoprefix+"150x150" + photopresuffix; PhotoURL.push(photourl); } }); } } $.when(firstjson(tmpName,tmpLoc,PhotoJson,foursq)).done(function(){ alert("t…
upvote count: 1
has comment: http://stackoverflow.com/comment/45081058
downvote count: 1
has title: multiple ajax async not in order and need synchronous behavior
has comment: http://stackoverflow.com/comment/45081860
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45081462
tagged with: api
has comment: http://stackoverflow.com/comment/45081470
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/a/28315975
score: 0
has body: Like you said, i/8 has an exact binary representation. Therefore (i/8) * ((2*Math.PI) / (2*Math.PI)) will not suffer from floating point rounding error, but (i/8*2*Math.PI) / (2*Math.PI) will. This is due to the fact that the intermediate result (i/8*2*Math.PI) has no exact floating point representation. Having said that, why do you bother? For every odd value of i (which includes the 12th and 16th element), you are precisely on the boundary between two different approximations, so it is arbitrary whichever is returned.
type: Answer
answers question: http://stackoverflow.com/q/28315483
accepted answer of: http://stackoverflow.com/q/28315483
type: AcceptedAnswer

http://stackoverflow.com/q/28326757
answer count: 1
tagged with: meteor
favorite count: 0
has answer: http://stackoverflow.com/a/28329217
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
tagged with: animation
type: AnsweredQuestion
has title: What does brush.event do when animating brush events?
accepted answer: http://stackoverflow.com/a/28329217
type: Question
upvote count: 4
has body: The Question: While checking out the Brush Snapping feature posted on bl.ocks.org, I became confounded by this block of code: var gBrush = svg.append("g") .attr("class", "brush") .call(brush) .call(brush.event); To be clear, I understand what .call(brush.event) does, but I don't understand why it is in this particular block of code. I.e., I see that this same call is made in the "brushended" event handler, but why do the transitions in the 'brushend' event depend on the call copied above? Prior Research: I checked out the API docs, which said the following, but I must admit I don't really understand this explanation. If selection is a transition, registers the appropriate tweens so that the brush dispatches events over the course of the transition I need some help parsing out the nitty gritty mechanics on that call to brush.event? (Reason I Want to Know): I want to implement this feature into a Meteor.js application. I turns out, if I comment out this one line, the slider snaps into place, but the animation is lost. If I leave the line in though, the brush selection never shows up at all. I'm asking about the mechanics of this animation in order to figure out how to make it work in my meteor project Update: It turns out the package named "d3" on atmosphere is deprecated. If I use the package named d3.js:d3, everything works cherry. Full Code:
downvote count: 0
tagged with: javascript
score: 4

http://stackoverflow.com/a/28337265
answers question: http://stackoverflow.com/q/28337145
type: Answer
has body: Keyboard events is one of wilder parts of frontend development. There are inconsistencies and cross-browser problems. But still there are recipes which help to cope with ordinary situations easily. There are following keyboard events: keydown A key is pressed down. keypress A character key is pressed. keyup A key is released. There is a fundamental difference between keypress and keydown. Keydown triggers on any key press and gives scan-code. Keypress triggers after keydown and gives char-code, but it is guaranteed for character keys only. You need to use keyup, because it triggers after keypress. &lt;input type="text" onkeyup="search()" id="search"&gt;&lt;/input&gt; see KeyEvents
score: 0

http://stackoverflow.com/comment/45100471
has text: Yes, I see it fixed FOUC in FF. Thanks. But actually the main problem is that the screen is white briefly. Any ideas how this can be fixed?
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28380324

http://stackoverflow.com/a/28317718
score: 1
answers question: http://stackoverflow.com/q/28316907
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: The reason was that OP forgot to load library to _ variable.
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28316907

http://stackoverflow.com/comment/45225311
type: AnswerComment
score: 0
type: Comment
has text: That's what I thought - but had hoped that I could get something close - a little edge translucency isn't a bad thing :-/
comment on: http://stackoverflow.com/a/28436971

http://stackoverflow.com/q/28342162
has answer: http://stackoverflow.com/a/28342355
type: Question
accepted answer: http://stackoverflow.com/a/28342356
tagged with: javascript
score: 0
answer count: 2
has body: in a web page i have various forms like this: Choose Show link 1 2 Submit form Link How can i show the submit button or the link based only on option class not on value optoin, i must use only class not ids....:). Thank you!
has answer: http://stackoverflow.com/a/28342356
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28342355
has title: Show different content based on option class, not value
has comment: http://stackoverflow.com/comment/45028864
type: AnsweredQuestion

http://stackoverflow.com/a/28432818
answers question: http://stackoverflow.com/q/28431937
score: 1
has comment: http://stackoverflow.com/comment/45198352
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45199514
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28431937
has body: Just put the div.tab-content under their respective ul tabs. This way, it works, without any additional JavaScript code. The main level tabs show the first tab-content, which is where your second level tabs are, including their tab-content. Here is the HTML that you need. No additional JS needed: All Brands Popular all_popular interests go here all_unique interests go here Popular Unique brands_popular interests go here brands_unique interests go here Here is a fiddle, based on yours: http://jsfiddle.net/36hk5bne/1/

http://stackoverflow.com/comment/44948475
has text: Do you load a jquery ?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28292318

http://stackoverflow.com/comment/44977218
type: Comment
type: QuestionComment
has text: Add your code to your question for us and we can dissect it and suggest fixes :)
comment on: http://stackoverflow.com/q/28313310
score: 0

http://stackoverflow.com/q/28353781
tagged with: coffeescript
answer count: 1
has body: I'm using Jekyll for this project. Is the below directory structure correct for a standard Jekyll project I've created a javascript folder in assets. With a coffeescript file in the folder Do I need to @import / @include this javascript file in the index.html which the js is for ? Directory Structure /project /.sass-cache /_includes /_layouts /_posts /_sass /_site /about /assets /images picture.png nextpicture.jpeg /js welcome.coffee /build /buld /css /serve .gitignore _config.yml feed.xml index.html nextpage.html index.html This is the homepage content with a tabbed ul list as the main content This tabbed ul list is a Bourbon Refills Pattern called accordion-tabs-minimal home page --- layout: welcome --- Title Tab Item Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras tincidunt pellentesque lorem, id suscipit dolor rutrum id. Morbi facilisis porta volutpat. Fusce adipiscing, mauris quis congue tincidunt, sapien purus suscipit odio, quis dictum odio tortor in sem. Ut sit amet libero nec orci mattis fringilla. Praesent eu ipsum in sapien tincidunt molestie sed ut magna. Nam accumsan dui at orci rhoncus pharetra tincidunt elit ullamcorper. Sed ac mauris ipsum. Nullam imperdiet sapien id purus pretium id aliquam mi ullamcorper. Another Tab Ut laoreet augue et neque pretium non sagittis nibh pulvinar. Etiam ornare tincidunt orci quis ultrices. Pellentesque ac sapien ac purus gravida ullamcorper. Duis rhoncus sodales lacus, vitae adipiscing tellus pharetra sed. Praesent bibendum lacus quis metus condimentum ac accumsan orci vulputate. Aenean fringilla massa vitae metus facilisis congue. Morbi placerat eros ac sapien semper pulvinar. Vestibulum facilisis, ligula a molestie venenatis, metus justo ullamcorper ipsum, congue aliquet dolor tortor eu neque. Sed imperdiet, nibh ut vestibulum tempor, nibh dui volutpat lacus, vel gravida magna justo sit amet quam. Quisque tincidunt ligula at nisl imperdiet sagittis. Morbi rutrum tempor arcu, non ultrices sem semper a. …
tagged with: bourbon
has answer: http://stackoverflow.com/a/28354692
has title: Uncaught ReferenceError - Javascript in Jekyll project
tagged with: javascript
type: UnansweredQuestion
tagged with: jekyll
type: Question
tagged with: http://stackoverflow.com/tag/html
score: 0

http://stackoverflow.com/q/28308351
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/44971935
has comment: http://stackoverflow.com/comment/44979365
type: AnsweredQuestion
downvote count: 3
has answer: http://stackoverflow.com/a/28324355
linked to: http://stackoverflow.com/q/15798360
type: Question
has body: I want to scroll down, see #div1 ... see #div2 ... When #div2 is not visible anymore, I want #div1 to slide down to the top of the window and stay fixed. If I reach/hit the footer div, I don't want #div1 to stay sticky anymore. If possible it should work when scrolling page up, too (backwards). There are no fixed heights at all. Is this possible? Maybe using jQuery? Live example the jsFiddle $(document).scroll(function() { var y = $(this).scrollTop(); var div3 = $('#div3').offset().top; if (y > div3) { $('#div1').addClass('sticky'); } else { $('#div1').removeClass('sticky'); } }); #test1 { margin-right: 300px; background: #00ff00; } #test2 { width: 300px; float: right; background: #9FF; } #div1 { margin: 10px 0 0 0; background: #ff00ff; border: 2px solid #000; } #div2 { margin: 10px 0 0 0; background: #FF6; border: 2px solid #000; } #div3 { height: 1px; } .sticky { position: fixed; top: 0; z-index: 999; -webkit-box-shadow: 0 8px 5px -6px #ccc; -moz-box-shadow: 0 8px 5px -6px #ccc; box-shadow: 0 8px 5px -6px #ccc; } Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Cum sociis natoque penatibus et magnis dis pa…
has comment: http://stackoverflow.com/comment/44981290
tagged with: javascript
has title: After passing Div2, slide down Div1 and make it a sticky div
score: -3
has comment: http://stackoverflow.com/comment/44969173
accepted answer: http://stackoverflow.com/a/28324355
has comment: http://stackoverflow.com/comment/44969606
upvote count: 0
has comment: http://stackoverflow.com/comment/44967998
answer count: 1
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/45029736
type: QuestionComment
has text: Added an (imperfect) [jsFiddle](http://jsfiddle.net/collapsar/bj9k5ga8/).
comment on: http://stackoverflow.com/q/28342402
score: 0
type: Comment

http://stackoverflow.com/a/28333372
answers question: http://stackoverflow.com/q/28331540
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28331540
has body: Try to set a special scope param on keydown that will disable submit. Then turn it off when the async callback fires. js: input.on('keydown', function () { $scope.needsValidation = true; }); ngModel.$asyncValidators.modelValue = function () { ... $scope.needsValidation = false; ... } Html: Submit
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45107423
score: 4
has comment: http://stackoverflow.com/comment/45077123
type: Answer
has comment: http://stackoverflow.com/comment/45093994
upvote count: 4

http://stackoverflow.com/comment/45093019
comment on: http://stackoverflow.com/q/28376287
type: Comment
score: 1
has text: Are you aware, that `[^stringToSearch]` means any character, that is not one of that's `stringToSearch` composed of (inside a [negated character class](http://www.regular-expressions.info/charclass.html#negated)). If you just want to match digits at the end use `\d+$` or `[0-9]+$`
type: QuestionComment

http://stackoverflow.com/comment/45006161
type: Comment
type: QuestionComment
has text: Inisde each function, before doing the animation you could use `.stop()` : `$("#portfolio,#resume,#contact").stop();`
score: 0
comment on: http://stackoverflow.com/q/28329349

http://stackoverflow.com/comment/44977048
comment on: http://stackoverflow.com/q/28313310
has text: I had to scroll pretty slow to notice the initial effect. I'm personally not a huge fan of the shrinking header wave. does that help? lol ;)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45030363
comment on: http://stackoverflow.com/a/28342442
type: Comment
score: 0
has text: hey, thanks for pointing me right direction, - However I'm manipulating searchString and in this solution the manipulated form gets propagated into input value, how should I go around that?
type: AnswerComment

http://stackoverflow.com/a/28314017
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28313759
type: Answer
accepted answer of: http://stackoverflow.com/q/28313759
has body: Chrome's console is showing a live log of the element. This is why you see oranges instead of apples. Use console.dir instead and you will see the id(the value at time of logging) printed next to the element name. But if you open up the object properties you will see the live value of id. console.dir(document.getElementById("apples")); document.getElementById("apples").id = "oranges"; console.dir(document.getElementById("oranges")); &lt;img id="apples" /&gt; Or put the last two statements in a setTimeout console.log(document.getElementById("apples")); //gives chrome the time to log the element setTimeout(function(){ document.getElementById("apples").id = "oranges"; console.log(document.getElementById("oranges")); },100); &lt;img id="apples" /&gt; You can also just log the property itself instead of the object console.log(document.getElementById("apples").id); document.getElementById("apples").id = "oranges"; console.log(document.getElementById("oranges").id); &lt;img id="apples" /&gt;

http://stackoverflow.com/comment/45233664
type: QuestionComment
has text: Yeah. I still have no idea what is causing this...
type: Comment
comment on: http://stackoverflow.com/q/28428383
score: 0

http://stackoverflow.com/q/28349513
downvote count: 3
has comment: http://stackoverflow.com/comment/45042874
type: Question
score: -2
answer count: 1
tagged with: url
tagged with: javascript
favorite count: 0
tagged with: generator
tagged with: slug
has body: I am trying to make friendly url from title. I find out many solutions but it has still problem with unicode character. eg: 'xin chào' in vietnamese I saw https://sluggenerator.com/ was OK. Could anyone helps me to do like this by javascript. Thanks in advance!
has answer: http://stackoverflow.com/a/28350848
accepted answer: http://stackoverflow.com/a/28350848
upvote count: 1
tagged with: php
type: AnsweredQuestion
has title: Generate a friendly urls using UTF-8 encoding in javascript
linked to: http://stackoverflow.com/q/286921

http://stackoverflow.com/q/28288359
has body: I want to change color of already selected text you can see http://jsfiddle.net/o533v4m6/ here when you select some text at that time it's selection color depends on the class "a" or "b" even though i change the class but the color of already selected text does not change it only changes if i select the text again. Here is the code &lt;p class="a"&gt; Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eum repellat dolores iste ut animi magnam veritatis dignissimos porro magni quam. Facere ratione nulla vel placeat saepe molestias non porro illo. &lt;/p&gt; Css p.a::selection { background-color: #C5979D !important; color: #fff; } p.b::selection { background-color: #77B28C !important; color: #fff; } javascript setInterval(function() { $('p').toggleClass('a') $('p').toggleClass('b') }, 1000); Edit :- Solution - After changing class clear the selection and select again http://jsfiddle.net/o533v4m6/1/
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28288878
score: 0
has comment: http://stackoverflow.com/comment/44931483
has comment: http://stackoverflow.com/comment/44931531
accepted answer: http://stackoverflow.com/a/28288878
type: Question
type: AnsweredQuestion
has title: JavaScript change color of already selected text
has answer: http://stackoverflow.com/a/28288543
has comment: http://stackoverflow.com/comment/44930969
answer count: 2
possible better answer: http://stackoverflow.com/a/28288543

http://stackoverflow.com/a/28301556
accepted answer of: http://stackoverflow.com/q/28300876
type: AcceptedAnswer
score: 0
has body: Instead of lines var start = $.fullCalendar.formatDate(start, "yyyy-MM-dd HH:mm:ss"); var end = $.fullCalendar.formatDate(end, "yyyy-MM-dd HH:mm:ss"); use (take care not to redefine local varialbes start, end, which are params of the function, also use Moment's format function according to: http://momentjs.com/docs/#/displaying/format/ as recommended by the fullCalendar v2 code migration): var sfmated = start.format("yyyy-MM-dd HH:mm:ss"); var efmated = end.format("yyyy-MM-dd HH:mm:ss"); a working jsfiddle is here: http://jsfiddle.net/xv5n1wod/12/
type: Answer
answers question: http://stackoverflow.com/q/28300876

http://stackoverflow.com/comment/44973241
type: QuestionComment
has text: How about just using a mathematics font that includes superscripts, sqRoot symbol, etc?
comment on: http://stackoverflow.com/q/28309478
score: 0
type: Comment

http://stackoverflow.com/comment/44980068
type: Comment
type: QuestionComment
score: 0
has text: This will help http://www.the-art-of-web.com/javascript/escape/
comment on: http://stackoverflow.com/q/28315308

http://stackoverflow.com/q/28335096
type: UnansweredQuestion
tagged with: scroll
type: Question
linked to: http://stackoverflow.com/q/8579643
answer count: 2
has title: Making an scrolling to a Div
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28335159
has answer: http://stackoverflow.com/a/28335331
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I study in web-making, and I need to do a parallax kind of website. I achieved to make the background scrolls slower where it was needed, but I'd like to improve it with buttons in the header that would make the page scroll to a choosen Div, and not just "teleport" you there. So this is my HTML for the header: Stalwarts Go to section 1 Go to section 2 Go to section 3 Go to section 4 And there's my CSS: header{ position: fixed; padding-top: 0.4%; padding-bottom: 0.4%; top: 0; width: 100%; height: auto; z-index: 55; } I would like to know how i can make either JS or JQuery to make this works and please how to integrate it. If plugins are needed, could you help me with how to instal them? I just begin with JQuery and JS! :-) Thank you, Christophe
duplicate of: http://stackoverflow.com/q/8579643

http://stackoverflow.com/comment/45132541
comment on: http://stackoverflow.com/q/28394340
score: 0
has text: You say you get the error `'express is not defined`. Do you have `var express = require('express')` in your code?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45130137
type: Comment
score: 0
type: QuestionComment
has text: Okay how about changing for the loop to: for(var i = 0, j = arguments.length; i<j; i++) {
comment on: http://stackoverflow.com/q/28397027

http://stackoverflow.com/q/28306803
has comment: http://stackoverflow.com/comment/44971135
tagged with: ajax
has comment: http://stackoverflow.com/comment/44964606
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44964591
tagged with: php
has comment: http://stackoverflow.com/comment/44964756
has comment: http://stackoverflow.com/comment/44965087
answer count: 0
has comment: http://stackoverflow.com/comment/44965037
has comment: http://stackoverflow.com/comment/44965555
has comment: http://stackoverflow.com/comment/44965779
has comment: http://stackoverflow.com/comment/44964906
type: Question
has comment: http://stackoverflow.com/comment/44964511
has title: AJAX will post to originating page but not another
has body: I have a script that submits multiple forms using AJAX. It will post the data successfully if the url used is the originating page, but it will not post the data to another page (the page I use for processing). Can anyone tell me why this is happening? /* AJAX for edit */ var submitForms = [ document.forms["editRow"], document.forms["editRow2"], document.forms["editRow3"], document.forms["editRow4"], document.forms["editRow5"], document.forms["editRow6"], document.forms["editRow7"], document.forms["editRow8"] ] $('.submitEdit').on('click', function() { var editRow = $(submitForms).serializeArray(); $.ajax({ type: 'POST', url: "IRCprocessinventory.php", data: editRow, cache: false, success: function(result){ $('body').html(result); } //end result }); // end ajax }); // end click
has comment: http://stackoverflow.com/comment/44964939
has comment: http://stackoverflow.com/comment/44964804
tagged with: javascript
has comment: http://stackoverflow.com/comment/44964789
score: 0
has comment: http://stackoverflow.com/comment/44965184
has comment: http://stackoverflow.com/comment/44969990
has comment: http://stackoverflow.com/comment/44968598
tagged with: jquery

http://stackoverflow.com/q/28313865
has comment: http://stackoverflow.com/comment/44977714
type: AnsweredQuestion
tagged with: angularjs-ng-change
downvote count: 0
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/19007281
score: 43
has body: When should I use angular $watch functions and when use ng-change angularjs directive? To me, they both can do the same. Are there any differences or usage patterns between them?
has title: When to use $watch or ng-change in Angularjs
has answer: http://stackoverflow.com/a/28313902
accepted answer: http://stackoverflow.com/a/28313902
has comment: http://stackoverflow.com/comment/44977931
answer count: 1
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/46063689
upvote count: 43

http://stackoverflow.com/comment/45075309
has text: Duplicate: http://stackoverflow.com/questions/933553/system-net-httpwebrequest-in-classic-asp
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28367098

http://stackoverflow.com/comment/44986602
has text: you should not be doing "appendTo" in val()'s return, since it will return a "primitive" type, and not a jquery object
comment on: http://stackoverflow.com/q/28318820
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28291656
score: 4
answer count: 2
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/31714886
tagged with: d3.js
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28702747
has body: I am developing from the c3.js using reusable charts in d3.js,but unable to get the data from the array of objects,i tried for the given format of the code. var chart=c3.generate({ data:{ json:[ {"key":[2000],"value":100},{"key":[2001],"value":200},{"key":[2003],"value":300},{"key":[2004],"value":400},{"key":[2005],"value":500},{"key":[2006],"value":600},{"key":[2007],"value":700} ], keys:{x:'key[0]', value:'value', } }, axis: { x: { type: "category" } } })
type: Question
upvote count: 4
has title: How to get the data from the c3.js
tagged with: javascript
tagged with: c3

http://stackoverflow.com/comment/45197323
comment on: http://stackoverflow.com/a/28430095
has text: Generally speaking it should work. If in your case it does not work, you should try to link a complete example.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28357662
accepted answer: http://stackoverflow.com/a/28357722
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45058620
has title: SyntaxError: missing ; before statement in javascript prototype
has body: (function(){ var Person = function(name){ this.name = name; }; Person.prototype.getName(){ return this.name; }; var arif = new Person("Arif"); console.log(arif.getName()); })(); I am receiving the error below for this code. Where is my mistake?
has answer: http://stackoverflow.com/a/28357722
upvote count: 1
downvote count: 1
type: AnsweredQuestion
tagged with: prototype
type: Question
score: 0

http://stackoverflow.com/q/28320979
upvote count: 2
has answer: http://stackoverflow.com/a/28321221
tagged with: php
score: 2
type: AnsweredQuestion
has title: Unable to get values from JSON Array and Object
accepted answer: http://stackoverflow.com/a/28321221
tagged with: http://stackoverflow.com/tag/json
has body: In my Javascript and PHP, I've manage to do an .ajax call to get an array. However when I want to display the display the values of each object I'm unable to do so. PHP: $request = '{"request_id":' .$requestId. ', "reqName":"' .$requestName. '", "reqSubject":' .json_encode($requestSubjects). '}'; array_push($requestArray, $request); echo json_encode($requestArray); Javascript: $.ajax({ type: "POST", url: serverURL + "getTutorRequestsProcess.php", data: sendTutId, dataType: "json", success: function(data){ localStorage.setItem('pending', JSON.stringify(data)); pending = JSON.parse(localStorage.getItem('pending')); console.log(pending); }, error: function(jqXHR, textStatus, errorThrown){ alert('Unable to retrieve requests.', null, 'Error','Done'); } }); So when I console.log(pending) it looks like this: ["{"request_id":13, "reqName":"Rin", "reqSubject":["English","A Math"]}", "{"request_id":14, "reqName":"Rin", "reqSubject":["English","E Math"]}"] When I console.log(pending[0]), I'm able to get the first object: {"request_id":13, "reqName":"Rin", "reqSubject":["English","A Math"]} However when I want to get the values of the object like so, console.log(pending[0].request_id), it returns an undefined. Would highly appreciate if someone could tell me what's wrong with my codes. Thank you. EDIT: I'm trying to add the data into my localStorage. Updated codes to reflect what I'm doing. Updated Javascript: $.ajax({ type: "POST", url: serverURL + "getTutorRequestsProcess.php", data: sendTutId, dataType: "json", success: function(data){ localStorage.setItem('pending', JSON.stringify(data)); pending = JSON.parse(localStorage.getItem('pending')); console.log(pending[0]); var response = jQuery.parseJSON(pending[i]); console.log(response.request_id); }, error: function(jqXHR, textStatus, errorThrown){ alert('Unable to retrieve requests.', null, 'Error','Done'); } }) Both answers by OVM and Codeseeker works and solved my question. It's sad that I can't mark both as correct since b…
type: Question
tagged with: arrays
possible better answer: http://stackoverflow.com/a/28321260
tagged with: javascript
has answer: http://stackoverflow.com/a/28321260
answer count: 2
downvote count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/44990489
favorite count: 0

http://stackoverflow.com/comment/44989907
type: AnswerComment
score: 1
type: Comment
has text: I forgot to mention adding gem 'coffee-script-source', '1.9.0' to my gemfile, but I'm not sure and doing a gem update on coffee-script-source, that could also have an effect on the outcome. I really tried everything I could find.
comment on: http://stackoverflow.com/a/28317677

http://stackoverflow.com/comment/44949482
comment on: http://stackoverflow.com/a/28298636
type: AnswerComment
score: 0
type: Comment
has text: the webform module is for adding filed dependency while creating content. im trying to show or hide exposed filter fields in a view. i added an image for better understanding. as for removing ajax - its not a very user friendlly option and i prefer to use that as a last resort.

http://stackoverflow.com/a/28420393
has body: Just to play around :) var app = angular.module('myApp', []); app.controller('MainController',function() { }); app.directive('one', function() { return angular.extend({}, app.directive, {myfunct:function(){ alert('hello'); }}); }); app.directive('two', function(oneDirective) { return { link:function($scope,$element){ console.log(oneDirective[0].myfunct) $element.on('click',oneDirective[0].myfunct); } }; });
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28419792

yui-datatable
type: Tag
tags question: http://stackoverflow.com/q/28341056
tag name: yui-datatable

http://stackoverflow.com/q/28372500
has title: Iterating over an array and joining with Bluebird
has answer: http://stackoverflow.com/a/28372754
type: AnsweredQuestion
tagged with: bluebird
has body: Is there a better way to write this? For the most part, the code below works, but I would like to clean it up if possible. For reference, outputs in the initial callback is an array of objects, containing the file path and some metadata. I would like to have access to this metadata when calling this.track.attach(), but I'm unsure how to access it later in the promise chain. var query = Track.findById('54d5059b7403dda6395bb08b').exec(); var encode = encoder.encode('/* file path */'); Promise.join(query, encode, function (track, outputs) { this.track = track; return Promise.map(outputs, function (output) { return upload.create(output.path, '/jr' + path.extname(output.path)); }); }).each(function (output) { this.track.attach(output.name, 'media'); }).then(function () { return this.track.saveAsync(); }).catch(function (err) { console.log(err); }).finally(function () { encoder.cleanup(); }).bind({});
upvote count: 1
type: Question
score: 1
accepted answer: http://stackoverflow.com/a/28372754
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/comment/44966792
has text: What language is that code in?
comment on: http://stackoverflow.com/q/28297702
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28343146
accepted answer: http://stackoverflow.com/a/28343356
tagged with: jbox
upvote count: 1
type: AnsweredQuestion
has body: I'm usng jBox url : http://stephanwagner.me/jBox . and creating a modal every time on click of a link. when the modal is created for the first time, listeners for buttons on that created modal are getting added on the "onCreated" attribute. These listeners are getting attached for 1st time properly and working when those buttons are clicked. From the second time, the listeners are not working. its like dummy button with no listeners. please find the code sample here. http://jsfiddle.net/sedhuait/4zdavzap/2/ $('#btn').click(function () { var title = "Create Group"; var createGroup = ' ' + title + ' Cancel '; var myModal = new jBox('Modal', { title: title, content: createGroup, width: 400, onCreated: function () { alert("in on created "); $('#btn-create-group-cancel').click(function () { alert("in on cancel "); myModal.close(); }); $('#btn-create-group').click(function () { myModal.close(); alert("in on create "); }); } }); myModal.open(); });
score: 1
has title: jBox Modal dialog onCreated listener function is not working from second time onward
type: Question
has answer: http://stackoverflow.com/a/28343356
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 1
favorite count: 0

http://stackoverflow.com/comment/45118443
type: Comment
has text: Makes perfect sense. Lack of sleep really does things to ya. I'll give that a shot @andrusieczko. Thank you!
comment on: http://stackoverflow.com/a/28390536
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45176642
comment on: http://stackoverflow.com/q/28421761
type: Comment
type: QuestionComment
has text: last time I tried that it worked. what are you getting with `updateTable(table)`? You could use `$index` as `updateTable($index)` and inside your function `tables[$index] ` but as I said your first attempt seems fine from my end
score: 0

http://stackoverflow.com/a/28343176
downvote count: 0
has comment: http://stackoverflow.com/comment/45031879
accepted answer of: http://stackoverflow.com/q/28342974
upvote count: 2
answers question: http://stackoverflow.com/q/28342974
type: AcceptedAnswer
type: Answer
has body: You can change any of the options of the smoothScroll plugin after instantiation: Setting options after initial call If you need to change any of the options after you've already called .smoothScroll(), you can do so by passing the "options" string as the first argument and an options object as the second. $el.smoothScroll('options', { offset: newValue });
score: 2
has comment: http://stackoverflow.com/comment/45040730

http://stackoverflow.com/comment/45198854
has text: @Halcyon it's a fixed div into the webview
comment on: http://stackoverflow.com/q/28433519
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45003721
type: Comment
type: AnswerComment
has text: I want some more functionality (like minimizing/maximizing of chatboxes). Also, I have updated my question.
comment on: http://stackoverflow.com/a/28307424
score: 0

http://stackoverflow.com/q/28402959
tagged with: google-chrome
type: Question
has title: Chrome.storage: how long does it last?
tagged with: javascript
score: 2
tagged with: google-chrome-extension
downvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/28409477
favorite count: 0
upvote count: 2
has body: How long does data in chrome.storage last and when is it deleted? could data in there last past the end of a browsing session, past updates? If not, I need a way to perform long-term storage with my chrome extension. P.S. I'm setting this in a client script, if that makes a difference
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28409477

http://stackoverflow.com/a/28344842
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45034140
has comment: http://stackoverflow.com/comment/45034272
upvote count: 1
has comment: http://stackoverflow.com/comment/45034315
has body: You can't scroll up because your code is wrapped in the scroll() function so it basically locks its position every time you try and scroll with either the mouses scroll wheel or arrow keys. If you amend to the following then it will position itself accordingly when the page first loads. jQuery(document).ready(function () { $('html, body').animate({ scrollTop: $('#content').offset().top }, 1000); });
type: Answer
answers question: http://stackoverflow.com/q/28344695

http://stackoverflow.com/a/28354878
score: 21
downvote count: 2
has body: With pure JS: var userIds = users.map( function(obj) { return obj.id; } );
answers question: http://stackoverflow.com/q/28354725
has comment: http://stackoverflow.com/comment/104141026
type: Answer
has comment: http://stackoverflow.com/comment/107793855
upvote count: 23

http://stackoverflow.com/q/28294128
has title: Content loaded into a div using javascript appears in a small square
tagged with: javascript
has body: Ive been coding a site for a project a friend and I are working on. After spending more time than I should have researching how to use javascript to make site links load into a "content" div ive gotten it to work, que second problem: The content loads but sits within a small square inside the "content" div I was wondering how to resize the content being displayed within the div below is my page code Breezies Blog Home Cast Of Characters History of Ego Meet the Creators
score: 0
answer count: 1
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44974425
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28294540
type: Question
has comment: http://stackoverflow.com/comment/44941312
has comment: http://stackoverflow.com/comment/44953685

http://stackoverflow.com/a/28297350
has comment: http://stackoverflow.com/comment/44949223
downvote count: 0
has comment: http://stackoverflow.com/comment/44949643
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44947971
answers question: http://stackoverflow.com/q/28296813
has body: i have created a jsfiddle -- http://jsfiddle.net/mga6f/390/ code:- $("#grid tr").click(function() { var entityGrid = $("#grid").data("kendoGrid"); var selectedItem = entityGrid.dataItem(entityGrid.select()); alert(selectedItem.id); }); with above code it is working fine.. i have tried above given code with http://demos.telerik.com/aspnet-mvc/grid/selection (grid in this demo) and put below given code in console and then selected row then it is showing the alert.. $("#rowSelection tr").click(function() { var entityGrid = $("#rowSelection").data("kendoGrid"); var selectedItem = entityGrid.dataItem(entityGrid.select()); alert(selectedItem.ShipCountry); });

http://stackoverflow.com/comment/52000797
type: Comment
score: 10
type: AnswerComment
has text: @BenGale In most of the cases in which a developer thinks they need to create a Subject, the developer is reinventing an existing RxJs method that already exists, whether it is an observable factory that wraps an asynchronous operation, or some sort of async stream manipulation. Not always. Sometimes a Subject is exactly what you need. But developers that are new to the library tend to see the Subject and reach for it first since it looks familiar and end up having a hard time because they don't realize that what they are trying to do has likely already been implemented.
comment on: http://stackoverflow.com/a/28313097

http://stackoverflow.com/comment/45148398
type: Comment
type: QuestionComment
score: 1
has text: Keep it simple. Just split the string based on the decimal.
comment on: http://stackoverflow.com/q/28407046

http://stackoverflow.com/a/28296753
type: Answer
score: 0
has body: appendChild expects a node not a string. You probably mean to use var x = document.getElementById("logoAndNavigation"); var newP = document.createElement("p"); // small p var textnode = window.location.protocol + "//" + window.location.host + "/" + window.location.pathname; newP.innerHTML = textnode; // this x.insertBefore(newP, x.childNodes[0]); You can also use the example of printheaderfooter.js to add the URL directly to the header or footer.
accepted answer of: http://stackoverflow.com/q/28296211
answers question: http://stackoverflow.com/q/28296211
type: AcceptedAnswer

http://stackoverflow.com/comment/45098400
type: QuestionComment
comment on: http://stackoverflow.com/q/28370335
score: 0
type: Comment
has text: What do you want to achieve? You are correct that phantomjs doesn't have flash support. The easiest way to get the same result is of course to get the non-flashversion in both browsers.

http://stackoverflow.com/q/28391482
tagged with: node.js
score: 1
type: Question
tagged with: mongodb
has body: I have a MongoDB with this structure: &gt; db.daisy.find().pretty() { "_id" : ObjectId("54d6fc2bca33d05a19448a39"), "name" : "Test Song", "genre" : "Rock", "count" : "1", "lyrics" : [ { "line" : "1", "lyric" : "first lyric" } ] } I want to add more lyrics to the song. I have been struggling through the APIs but I just can't seem to get it. I am trying to update it like this router.post('/updatelyric/:id', function(req, res) { var db = req.db; var songID = req.params.id; console.log(req.params.id) db.collection('daisy').update({ _id: songID }, { $push: { lyrics: req.body } }, function(err, result) { res.send((err === null) ? {msg: ''} : {msg: err}); }); }); I am getting 200 codes for my posts, but nothing happens in my Mongo. Any guidance would be appreciated!
downvote count: 0
tagged with: javascript
has title: Update a nested array in MongoDB with Node.JS Express
upvote count: 1
favorite count: 0
answer count: 0
has comment: http://stackoverflow.com/comment/45120444
has comment: http://stackoverflow.com/comment/45120857
type: UnansweredQuestion

http://stackoverflow.com/q/28329766
type: Question
answer count: 2
downvote count: 1
has answer: http://stackoverflow.com/a/28330049
favorite count: 0
upvote count: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/57559577
score: 2
type: UnansweredQuestion
has body: I would like to check the similarity of two strings by word. I tried using php.js similar_text: http://phpjs.org/functions/similar_text/ But it checks similarity letter by letter so for example if I checked the similarity of "ddda" against "addd" it would return 100% I would like a function that checks word by word so that "Hello World" checked against "Hello" would return 50%
has comment: http://stackoverflow.com/comment/45006903
has title: Check similarity of two texts by word?
has answer: http://stackoverflow.com/a/34911925
tagged with: javascript

http://stackoverflow.com/a/28303125
score: 3
upvote count: 3
has body: In my opinion, you really want to keep this out of the UI and hide it away in the controller. You already have an action called toggleSelect in your controller by the looks of things, inside that you can set a new scope property to be only the side nav items of the currently selected tab, something like; $scope.toggleSelect = function(index) { // existing code here $scope.currentTabSideNavItems = SideNavItems[index]; } And your markup can be simplified to: &lt;div id="field"&gt; &lt;div ng-repeat="item in currentTabSideNavItems"&gt; &lt;a ng-click="level=2"&gt;{{item}}&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; That way the logic for extracting out the items to be displayed is hidden nicely in your controller, and can be tested.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44964502
type: Answer
accepted answer of: http://stackoverflow.com/q/28302995
downvote count: 0
has comment: http://stackoverflow.com/comment/44957809
answers question: http://stackoverflow.com/q/28302995

http://stackoverflow.com/comment/45062580
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28339443
has text: Hi, Can you remove `Response.End()` and try? Why I asked "Response.BufferOutput=true" is because you don't need to call `Response.End()` after `Response.Flush()`. Otherwise, use `Response.Clear(); exportPrjtResponseMemStream.WriteTo(Response.OutputStream); Response.End(); `

http://stackoverflow.com/q/28338746
answer count: 0
has comment: http://stackoverflow.com/comment/45022891
has comment: http://stackoverflow.com/comment/45023108
type: Question
has title: How to get cookie value for different session in same browser?
tagged with: javascript
has body: Am storing session time out value in cookie named "sesionTimeOut" I am opening different web page (two tabs in same browser)that has different time out values .Session will be destroyed based on the cookie time out value.In this case how do I get two different kind of cookie values for these two session. Am getting the cookie value which is currently updated for both the session.I want time out cookie for each session
score: 0
type: UnansweredQuestion

http://stackoverflow.com/q/28321473
has answer: http://stackoverflow.com/a/28321644
type: AnsweredQuestion
has title: Clean URL by removing one paramater and its value
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/6644654
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/44990893
has body: Let's say I have the following URL addresses: www.mydomain.com/default.aspx?param1=value1&amp;param2=value2&amp;param3=value3 OR www.mydomain.com/default.aspx?param2=value2&amp;param1=value1 OR www.mydomain.com/default.aspx?param3=value3&amp;param1=value1&amp;param2=value2 How can I remove only the part "param1=value1" from those URL addresses with jQuery or Javascript?
linked to: http://stackoverflow.com/q/901115
has answer: http://stackoverflow.com/a/28321599
accepted answer: http://stackoverflow.com/a/28321599
tagged with: jquery
has comment: http://stackoverflow.com/comment/44991317
possible better answer: http://stackoverflow.com/a/28321644

http://stackoverflow.com/comment/45111877
type: QuestionComment
has text: Thanks David I kept fiddling with it and got it to work. I think my chrome js console bugged out when i made some errors
type: Comment
comment on: http://stackoverflow.com/q/28384837
score: 0

http://stackoverflow.com/q/28320801
has comment: http://stackoverflow.com/comment/44991121
score: 0
answer count: 2
tagged with: javascript
tagged with: scope
has title: Appcelerator scope issue when clicking a view
has answer: http://stackoverflow.com/a/28325656
has answer: http://stackoverflow.com/a/28324643
accepted answer: http://stackoverflow.com/a/28324643
tagged with: appcelerator
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28325656
type: Question
has body: I'm going crazy here trying o work out why the scoping of my variable won't pick up the right value from a loop of 60 items from a DB in my Appcelerator project. My map marker displays the correct label, but when I click it, no matter what combo of scoping I try, I cannot get the correct value in the alert. It just returns the 60th entry every time. Likely a schoolboy error, but this is driving me nuts. This is my function function loadAnimals() { var db = Ti.Database.open('myDB'); var getSpecies = db.execute('select * from species'); while (getSpecies.isValidRow()) { var speciesID = getSpecies.fieldByName('speciesnid'); var speciesName = getSpecies.fieldByName('speciesname'); var speciesDesc = getSpecies.fieldByName('speciesdescription'); var speciesLatitude = getSpecies.fieldByName('specieslatitude'); var speciesLongitude = getSpecies.fieldByName('specieslongitude'); var speciesConStatus = getSpecies.fieldByName('speciesconservationstatus'); var speciesMarkerFilename = getSpecies.fieldByName('speciesiconfilename'); var speciesMarkerIcon = getSpecies.fieldByName('speciesmapicon'); var speciesMarkerURI = getSpecies.fieldByName('speciesmapiconurl'); var speciesImageFullPath = speciesMarkerURI.replace("public://", "http://myurl.com/"); var speciesImageFullPath = speciesImageFullPath.replace(" ", "%20"); var imageFile = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, speciesMarkerIcon); var iconFile = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, speciesMarkerFilename); var annotationView = Ti.UI.createView({ backgroundColor: '#222222', width: 150, height: 75, layout:'vertical' }); var addtoTourView = Ti.UI.createView({ height:20, backgroundColor:'#6ea108' }); var addtoTourTitle = Ti.UI.createLabel({ color: '#FFF', text: 'ADD TO TOUR', width: 150, height: 15, top:3, textAlign: 'center', font: { fontSize: 14, fontWeight: 'bold' } }); var annotationTitle = Ti.UI.createLabel({ color: '#FFF', text: 'test', width: 150, height:15, top:0, textAli…

http://stackoverflow.com/comment/76096297
score: 0
type: QuestionComment
type: Comment
has text: Possible duplicate of [Different color for each bar in a bar chart; ChartJS](https://stackoverflow.com/questions/25594478/different-color-for-each-bar-in-a-bar-chart-chartjs)
comment on: http://stackoverflow.com/q/28386386

http://stackoverflow.com/q/28335790
has comment: http://stackoverflow.com/comment/48340490
type: Question
linked to: http://stackoverflow.com/q/18455453
score: 1
has body: I am creating an effect in my page. I have a news page and what I want is if the user scroll the page there will be a floating div with a button at the bottom of the screen. It should stick at the bottom of the screen. But it will stick until it hasn't reached the footer content. I don't know how to do this. Can you help me with this? Here's a bit of my codes: HTML: Header Goes Here Very long content here... Next Page Footer Here CSS: header { height: 50px; background: #ccc; color: #fff; text-transform: uppercase; padding: 5px; font-family: verdana; text-align: center; } .news { padding: 10px } .floating_content { display: none; position: fixed; bottom: 0; width: 100%; padding: 5px; text-align: center; background: #ccc; } footer { background: #000; color: #fff; text-align: center; height: 50px } JQuery: $(window).scroll(function() { if($(window).scrollTop() + $(window).height() == $(document).height()) { $(".floating_content").removeAttr('style'); //$(".fix_content").css('margin-bottom':'174px'); } else { $(".floating_content").css({'position':'fixed','bottom':'0','width':'100%','z-index':'99'}); } }); Here's my fiddle:JSFiddle
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
has title: How to unstick a floating div at the bottom when footer tag is detected?
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28335854
tagged with: css
downvote count: 0

http://stackoverflow.com/comment/44963091
comment on: http://stackoverflow.com/q/28305814
has text: The problem is that when you click in the inside div, the two ng-click get called.
score: 0
type: Comment
type: QuestionComment

sidebar
type: Tag
tag name: sidebar
tags question: http://stackoverflow.com/q/28374024

http://stackoverflow.com/comment/45132555
comment on: http://stackoverflow.com/q/28394340
score: 0
has text: Also try `app.use('/public', express.static('/public'));`
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45184171
comment on: http://stackoverflow.com/q/28426028
score: 0
has text: You have to send it to the web server, via a form, or AJAX.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45162366
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28411799
score: 0
has text: Is there a reason you're trying to write the images as UInt8 array buffer? Why not just create a file upload form with Django and use Angular for the HTTP request to upload the entire file?

http://stackoverflow.com/q/28431036
has comment: http://stackoverflow.com/comment/45192718
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/45194445
downvote count: 0
has comment: http://stackoverflow.com/comment/45193947
has comment: http://stackoverflow.com/comment/45194791
has comment: http://stackoverflow.com/comment/45193345
has title: how remove next append on mouseleave?
type: Question
has comment: http://stackoverflow.com/comment/45192719
has answer: http://stackoverflow.com/a/28431334
answer count: 1
accepted answer: http://stackoverflow.com/a/28431334
has body: I have a problem with my code; when I mouseenter an element, a toolbar is appended to this element, but when I mouseleave from the toolbar to the element, the toolbar is appended again. How can I prevent this re-appending? $('.el').on('mouseenter', function(e){ var toolbar = $(' leave toolbar to element '); setTimeout(function(){ toolbar.addClass('widget-over'); },100); $('body').prepend(toolbar); toolbar.css({ left:$('.el').offset().left, top:$('.el').offset().top - toolbar.height() - 20 }); $('.el').on('mouseleave',function(e){ if ($(e.relatedTarget).closest(toolbar).length) return; toolbar.removeClass('widget-over'); toolbar.remove(); }); toolbar.on('mouseleave',function(e){ toolbar.remove(); }); }); Big thanks to community for answers! exactly Jeremy Thille, Arun P Johny and Jivings Problem fiddle -> Fiddle Solution fiddle -> Fiddle
tagged with: javascript
tagged with: jquery
upvote count: 3
has comment: http://stackoverflow.com/comment/45194403
has comment: http://stackoverflow.com/comment/45193535
tagged with: append
favorite count: 0
has comment: http://stackoverflow.com/comment/45193685
has comment: http://stackoverflow.com/comment/45194251
has comment: http://stackoverflow.com/comment/45195203
has comment: http://stackoverflow.com/comment/45194539
has comment: http://stackoverflow.com/comment/45192617
has comment: http://stackoverflow.com/comment/45194654
has comment: http://stackoverflow.com/comment/45193647

http://stackoverflow.com/comment/45071418
score: 1
comment on: http://stackoverflow.com/q/28365078
type: QuestionComment
type: Comment
has text: What is the value of `document.getElementById("count").value`? Your question doesn't have the HTML for that element.

http://stackoverflow.com/a/31658971
upvote count: 1
has comment: http://stackoverflow.com/comment/51266950
has body: You don't need to use the layoutComplete event on masonry. As you can just add your animation code under the masonry initialization . When all images are loaded, the imageLoaded function will execute. You can then create the masonry object and animate right away like so: var $grid = $('.grid').imagesLoaded( function() { // init Masonry after all images have loaded $grid.masonry({ columnWidth: 200, itemSelector: '.item', gutter: 10 }); console.log('got here'); $('.grid').animate({'opacity':1}); }); Here is a jsfiddle that demonstrate that
has comment: http://stackoverflow.com/comment/51507360
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28371548
has comment: http://stackoverflow.com/comment/51298569
accepted answer of: http://stackoverflow.com/q/28371548
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/51263078

http://stackoverflow.com/comment/44939733
type: Comment
comment on: http://stackoverflow.com/a/28283638
score: 0
has text: Oh and In my company we always put picture in its own schema, because they hold the information independat from eventSchema. And if population fails, you can always do another find in pictureSchema and then req.send({eventDoc: {}, pictureDoc: {})
type: AnswerComment

http://stackoverflow.com/comment/44942120
comment on: http://stackoverflow.com/a/28294101
has text: How you endend solving this?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44948484
has text: Updated the answer. Use onDrop for removing class that was added on hover. [Check this](http://plnkr.co/edit/w6l5kNs9NfAOxLHEASd1?p=preview)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28297814
type: Comment

http://stackoverflow.com/q/28325191
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28331738
type: AnsweredQuestion
type: Question
answer count: 1
tagged with: dojo
tagged with: dijit.tree
has answer: http://stackoverflow.com/a/28331738
score: 0
has title: How to set a css class for a selected node in a tree?
has body: I am using a Dijit Tree, and I need to change the CSS style for a node when selected (focus). Lets imagine a node is black when "deselected", and it becames red when "selected" and viceversa. What should I change in my code? var tree = new Tree({ model: this._model, showRoot: true, autoExpand: true, persist: false, getLabel: function (item) { return item.name; }, onClick: function (item, node, event) { businessLogic.goToView(item.id); }
has comment: http://stackoverflow.com/comment/44999343

http://stackoverflow.com/q/28356959
has comment: http://stackoverflow.com/comment/45058073
linked to: http://stackoverflow.com/q/18690444
has comment: http://stackoverflow.com/comment/45084038
type: Question
has comment: http://stackoverflow.com/comment/45057420
tagged with: javascript
has title: calling Google Maps API for auto completing multiple location fields
tagged with: google-maps-api-3
score: 0
has comment: http://stackoverflow.com/comment/45057514
favorite count: 0
has body: I am trying to call Google map api where it will auto complete address in location field. Now, I have 2 location field where I want to auto field it. I have wrote following JavaScript code. var options = { componentRestrictions: { country: 'usa' } }; google.maps.event.addDomListener(window, 'load', function () { if (document.getElementById("address")) { var places = new google.maps.places.Autocomplete(document.getElementById('address'), options); google.maps.event.addListener(places, 'place_changed', function () { var place = places.getPlace(); var address = place.formatted_address; var latitude = place.geometry.location.lat(); var longitude = place.geometry.location.lng(); document.getElementById("Latitude").value = latitude; document.getElementById("Longitude").value = longitude; }); } if (document.getElementById("addressModal")) { var placesModal = new google.maps.places.Autocomplete(document.getElementById('addressModal'), options); google.maps.event.addListener(placesModal, 'place_changed', function () { var placeModal = placesModal.getPlace(); var latitudeModal = placeModal.geometry.location.lat(); var longitudeModal = placeModal.geometry.location.lng(); document.getElementById("Latitude").value = latitudeModal; document.getElementById("Longitude").value = longitudeModal; }); }}); It is auto completing for 1st location field (id = address) but it is not working for 2nd location field (id = addressModal) Please help. Thanks in advance.
answer count: 0
type: UnansweredQuestion
upvote count: 1
linked to: http://stackoverflow.com/q/24252188
has comment: http://stackoverflow.com/comment/45086812
downvote count: 1

http://stackoverflow.com/q/28370137
has comment: http://stackoverflow.com/comment/45081682
accepted answer: http://stackoverflow.com/a/28370610
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28370610
has comment: http://stackoverflow.com/comment/45081296
has title: Is it possible to get a @font-face html entity into an input via javascript?
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
upvote count: 2
score: 2
type: AnsweredQuestion
has body: I have a text input: &lt;input type="text"&gt; and I have a Icomoon @font-face font setup that has some symbols that I'd ideally like to get into the input via some buttons that a user clicks. My font-face font has options to use an HTML entity, for example: &amp;#xe601; My javascript makes an array of data-attributes values which i then map to hex values, such as this heart symbol (note I think im correct in calling it a hex value): \u2665 So is there a way I can get this working. Or will I need to re-think my approach. Placing the HTML entity directly into my HTML shows the icon works, I'm guessing how it's being placed in via settings the .val(); in the input it causing issues. $('.char__item-indv').click(function(event) { var word = $(this).attr('data-value'), input_word = $('#wordSelector').val(), input_start_word = $('#wordSelector')[0].defaultValue, char_array = new Array(); char_array['and'] = '&amp;'; char_array['apo'] = '\x27'; char_array['at'] = '@'; char_array['bee'] = '&amp;#xe601;'; char_array['dot'] = '.'; char_array['heart'] = '\u2665'; char_array['the'] = '&amp;#58881;'; if(input_word == input_start_word) { input_word = ''; } if(input_word.length &lt; 12) { var new_word = input_word+char_array[word]; $('#wordSelector').val(new_word); $(this).prop("selectedIndex",0); $('#wordSelector').focus(); } }); .word-selector__input { margin-bottom: 24px; } .word-selector__char { margin-bottom: 24px; } .word-selector .char__item { display: inline-block; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div class="word-selector"&gt; &lt;div class="word-selector__input"&gt; &lt;input name="input-word" type="text" maxlength="12" id="wordSelector" /&gt; &lt;/div&gt; &lt;div class="word-selector__char"&gt; &lt;div class="char__item"&gt; &lt;img class="char__item-indv" alt="AND" src="http://placehold.it/50x50" data-value="and" /&gt; &lt;/div&gt; &lt;div class="char__item"&gt; &lt;img class="char__item-indv" al…

http://stackoverflow.com/a/34837201
answers question: http://stackoverflow.com/q/28386125
has comment: http://stackoverflow.com/comment/67096248
type: Answer
has comment: http://stackoverflow.com/comment/95454663
has comment: http://stackoverflow.com/comment/80048592
has body: Just update stylesheet's path that you want to be dynamically loaded by using react's state. import * as React from 'react'; export default class MainPage extends React.Component{ constructor(props){ super(props); this.state = {stylePath: 'style1.css'}; } handleButtonClick(){ this.setState({stylePath: 'style2.css'}); } render(){ return ( Click to update stylesheet ) } }; Also, I have implemented it as react component. You can install via npm install react-dynamic-style-loader. Check my github repository to examine: https://github.com/burakhanalkan/react-dynamic-style-loader
has comment: http://stackoverflow.com/comment/89580082
has comment: http://stackoverflow.com/comment/104361804
downvote count: 1
upvote count: 44
has comment: http://stackoverflow.com/comment/75298976
has comment: http://stackoverflow.com/comment/96394135
has comment: http://stackoverflow.com/comment/77846752
score: 43
has comment: http://stackoverflow.com/comment/107965176
has comment: http://stackoverflow.com/comment/104312906
has comment: http://stackoverflow.com/comment/104371246

http://stackoverflow.com/comment/45058269
comment on: http://stackoverflow.com/q/28357474
type: QuestionComment
type: Comment
score: 0
has text: canvas, or use semi-transparent .gifs

http://stackoverflow.com/a/28361089
has body: When you think about memory issues(and also when not) it's better to re-use the Map-instance(see: Bug: Destroying Google Map Instance Never Frees Memory) function plotMap(loc) { var map_container = document.getElementById('map'); if (!map_container.map) { map_container.map = new google.maps.Map(map_container, { stylers: [{ saturation: -100 } ] }); map_container.marker = new google.maps.Marker(); map_container.infowindow = new google.maps.InfoWindow(); google.maps.event.addListener(map_container.marker, 'click', function () { map_container.infowindow.close(); map_container.infowindow.open(this.getMap(), this); }); map_container.infowindow.bindTo('content', map_container.marker, 'content'); } map_container.infowindow.close(); map_container.map.setOptions({ zoom: 17, center: new google.maps.LatLng((locations[loc][1]), (locations[loc][2])) }); //icon: 'marketICO.png', map_container.marker.setOptions({ position: map_container.map.getCenter(), map: map_container.map, content: locations[loc][0], title: locations[loc][0] }); }
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28345745
downvote count: 0
type: Answer

http://stackoverflow.com/q/28331973
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28331993
possible better answer: http://stackoverflow.com/a/28332135
type: Question
score: 0
answer count: 2
has title: About click or hover functions
has answer: http://stackoverflow.com/a/28331993
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45011046
has body: We have a code, when you click the icon, a div appears. We want to make it appear when hover on icon, not click. How can we do it? This code is in my Wordpress theme's footer section. It needs a change to work like i want. Code is this: &lt;script type="text/javascript"&gt; $(document).ready(function(){ var searchi = 0; $("#social-medias").click(function(){ $("#medias-icons").slideToggle("fast"); if ( searchi == 0 ){ $(this).addClass("searchAct1"); searchi = 1; }else{ $(this).removeClass("searchAct1"); searchi = 0; } }); }); &lt;/script&gt;
has answer: http://stackoverflow.com/a/28332135
type: AnsweredQuestion

http://stackoverflow.com/q/28297519
answer count: 0
tagged with: cgi
type: Question
tagged with: javascript
tagged with: http://stackoverflow.com/tag/c
has comment: http://stackoverflow.com/comment/44947061
has title: How to be consistent on filtering a refresh rate using CGI to load a html page written in C?
score: 0
tagged with: linux
has body: I have a function that creates a drop down box with a set of refresh rates: 3 seconds, 10 seconds and 60 seconds. When I click on the 3 seconds the page refreshes every 3 seconds. However when I click on the 10 seconds the form will load and the page will refresh for 10 seconds, and then it will go back to re-fresh every 3 seconds. That is because on my if statement the first option is the 3 seconds one. I need to be consistent in reloading the form and I've tried to but it doesn't work. This is the function for the drop-down menu: void pgMkOptionNum (const char *tag, int value, int selected){ httpPrintf (" %-8s ", value, ((selected) ? " selected=\"selected\"" : ""), tag);} The function call is this one: pgMkOptionNum("3 Seconds", FILTER_3, (filterRefresh == FILTER_3 ? 1 : 0)); pgMkOptionNum("10 Seconds", FILTER_10, (filterRefresh == FILTER_10 ? 1 : 0)); pgMkOptionNum("60 Seconds", FILTER_60, (filterRefresh == FILTER_60 ? 1 : 0)); Where filterRefresh is equal to 0 at the top and FILTER_X are defined at the top as 1, 2, and 3 respectively.
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44950027

http://stackoverflow.com/a/28294697
has comment: http://stackoverflow.com/comment/44942380
answers question: http://stackoverflow.com/q/28294537
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28294537
has body: make instance a new instanse of unslider and than run the function init with the parameters (o,me). You're correct. It could be also rewritten like the following code: new Unslider().init(me, o); Parenthesis are operators to group expression results. For example, you can also do something like this: var result = (1 + 2).toString(); alert(result); That is, the value obtained of adding 1 and 2 is returned as a number and you can call toString() since this function is part of any object in JavaScript. (new Unslider) is the same case: the value of the parenthesis is the object created from the Unslider prototype, so you can call instance members (i.e. functions, properties...) of the whole object. Why they decided to use this syntax and not just new Unslider().init(me, o), who knows. IMHO, I would use my option, because instantiating an object and just that doesn't require the parenthesis syntax... Additional note... You should know that you won't be able to do so: // This would be using the result of .init(me, o) as the // constructor function, and I'm very sure .init(me, o) won't // return a function, so this would end in a run-time error new Unslider.init(me, o); In summary, new keyword should be used with functions, and when a function is used in a new expressions, the so-called function turns into a constructor function. You might learn more about constructors and prototypes here.
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/44968004
score: 1

http://stackoverflow.com/q/28287927
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/44930246
has comment: http://stackoverflow.com/comment/44929808
has comment: http://stackoverflow.com/comment/44930128
score: 0
possible better answer: http://stackoverflow.com/a/28288391
has comment: http://stackoverflow.com/comment/44930014
has comment: http://stackoverflow.com/comment/44929773
tagged with: http://stackoverflow.com/tag/html
tagged with: getelementbyid
has body: I am trying to update the content of a dynamically generated div with .innerHTML and getElementById, but when I test it, I get an error: "Uncaught TypeError: Cannot set property 'innerHTML' of null" I also tried using alert() and checking the value of quizDiv at breakpoints. Well, here's my JS file called main.js: function makeDiv() { document.body.innerHTML = "&lt;div id='quizDiv'&gt;&lt;/div&gt;" } function createInputBox(boxId) { var quizDiv = document.getElementById("quizDiv"); quizDiv.innerHTML = "&lt;input type='text' id='" + boxId + "'&gt;"; } makeDiv(); createInputBox(1); Here's my html: &lt;!-- doctype, head, etc --&gt; &lt;body&gt; &lt;!-- content --&gt; &lt;script src="/main.js"&gt;&lt;/script&gt; &lt;/body&gt; Any help is appreciated. Thanks!
has comment: http://stackoverflow.com/comment/44929796
has title: document.getelementById doesn't work on dynamically generated divs
has comment: http://stackoverflow.com/comment/44929949
has answer: http://stackoverflow.com/a/28288065
accepted answer: http://stackoverflow.com/a/28288065
tagged with: dynamically-generated
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28288391
has comment: http://stackoverflow.com/comment/44929759
type: Question
has comment: http://stackoverflow.com/comment/44929915

http://stackoverflow.com/comment/45083508
score: 1
has text: The [.selector](http://api.jquery.com/selector/) property of the jQuery collection object was deprecated in 1.7 and removed in 1.9 and was considered an 'internal', meaning that it was not part of the public API shouldn't be relied on it in any of your code, as it was subject to change.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28371216

http://stackoverflow.com/comment/45596393
has text: not yet, for the time my solution with prefix bytes works so I have to solve other problems first. But I read the doc and primus is a very cool framework wich i will implement when i got the rest of my app working. I also have to find a way to tell the client which data frame is coming from which client so maybe i have to do this by prefixs bytes anyway. but that all really doesnt matter at the end... Your solution should work (according to doc) so you get the points :)
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28620814
type: AnswerComment

http://stackoverflow.com/q/28328247
answer count: 2
upvote count: 0
possible better answer: http://stackoverflow.com/a/28328279
favorite count: 0
has answer: http://stackoverflow.com/a/28328279
has comment: http://stackoverflow.com/comment/45004153
downvote count: 2
has answer: http://stackoverflow.com/a/28328275
has title: Add Variable to ID with Javascript
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28328275
has body: I have a function that is hiding a div with a certain ID, when it is called. $('#starrating').hide(); This works fine but when I try adding a variable to it, it does not work. I am trying to do it this way and it is not working: $('#starrating'[imageid]).hide(); I need to know how you would add a variable unto the ID. If I add the number instead of the variable it works fine: $('#starrating234343').hide();
type: Question
score: -2
tagged with: javascript

http://stackoverflow.com/comment/45077340
comment on: http://stackoverflow.com/q/28368231
score: 0
type: Comment
type: QuestionComment
has text: option elements don't generally fire click events, you should be using the change event on the select

http://stackoverflow.com/comment/45194007
type: Comment
type: QuestionComment
has text: Can you make a jsfiddle to show the problem?
score: 0
comment on: http://stackoverflow.com/q/28431860

http://stackoverflow.com/comment/45100483
score: 0
type: Comment
type: QuestionComment
has text: what is your problem? which errors are you getting? what exactly is not working?
comment on: http://stackoverflow.com/q/28380695

http://stackoverflow.com/comment/44982848
type: QuestionComment
has text: write test32.php in single quote because onclick have double quote in refresh button..
score: 0
comment on: http://stackoverflow.com/q/28316808
type: Comment

http://stackoverflow.com/a/28382777
answers question: http://stackoverflow.com/q/28382682
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45117633
has body: View page source, line 923-930: &lt;script type="text/javascript"&gt; jQuery(function($) { $( '.add_to_cart_button:not(.product_type_variable, .product_type_grouped)' ).click( function() { ga('send', 'event', 'Products', 'Add to Cart', ($(this).data('product_sku')) ? ('SKU: ' + $(this).data('product_sku')) : ('#' + $(this).data('product_id'))); }); }); &lt;/script&gt;

http://stackoverflow.com/comment/45014041
comment on: http://stackoverflow.com/q/28333491
score: 0
type: Comment
has text: Hacking Issue? Why? Sorry we're a company, we don't do hacking...
type: QuestionComment

http://stackoverflow.com/comment/44925553
type: Comment
has text: Check out my update to my question. I did something similar to this already and it ignores the section and says that $_POST['location_id'] is not an array
comment on: http://stackoverflow.com/a/28285674
type: AnswerComment
score: 0

http://stackoverflow.com/q/28405048
possible better answer: http://stackoverflow.com/a/28412737
has answer: http://stackoverflow.com/a/28412737
favorite count: 0
tagged with: angularjs
has title: Kendo Grid: how to get the selected item from a Combobox cell template when using with Angular
type: AnsweredQuestion
downvote count: 0
linked to: http://stackoverflow.com/q/28535116
score: 1
has body: I have a Kendo grid which I am using within Angular, and have a field with a combo box, that has the editor set to the following function... function comboCellTemplate(container, options) { var input = $('&lt;input name="' + options.field + '" /&gt;') input.appendTo(container) var combobox = input.kendoComboBox({ autoBind: true, filter: "contains", placeholder: "select...", suggest: true, dataTextField: "description", dataValueField: "code", dataSource: data, }); And data is a list of simple json objects... [ {code: 'code1', description: 'desc1'} {code: 'code2', description: 'desc2'} [ Each field in the grid data is bound to the same objects (ie with a code and description field) I a previous post, to get sorting and filtering working I need to bind a field to the display field... { field: "Category.description", title: "Category", editor: comboCellTemplate, template: "#=Category.description#" }, When I do this, the combo box seems to set the field of the grid to the code. How can I get this to set the grid data to the whole data object (ie the {code, description}) I have tried adding a on - change handler to do this input.on('change', function () { var val = input.val(); //var dataItem = input.dataItem(); options.model.set(options.field, val + 'xx'); }); but can't see how to get the "selected Item" from the combo I don't seem to be able to find this in the help (in particular when using Angular) Any help here would be greatly appreciated. regards, Peter
type: Question
tagged with: kendo-grid
tagged with: javascript
has answer: http://stackoverflow.com/a/28419686
accepted answer: http://stackoverflow.com/a/28419686
tagged with: kendo-ui
answer count: 2
upvote count: 1

http://stackoverflow.com/q/28338632
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45023021
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/45022832
has title: Appending a bootstrap has-success class not working ,some javascript error
tagged with: twitter-bootstrap
type: UnansweredQuestion
has body: I have a form field calls 'No of Partners' that depends and appear on the selection of the previous dropdown . else it is hidden . with the class 'hide'.My problem I am not able to append a class has-success after validation of this feild. The Code is as follows: &lt;div class="row" id="divtypeofb"&gt; &lt;div class="col-xs-12"&gt; &lt;div class ="col-md-6"&gt; &lt;div class="form-group"&gt; &lt;label&gt;&lt;li class="hide"&gt;&lt;/li&gt;No of partners&lt;span style="color: red;"&gt;&amp;nbsp;*&lt;/span&gt;&lt;/label&gt; &lt;input type="number" name="no_of_promoters" id="number_of_promoters" min="2" value="&lt;?=$business_info_details['no_of_promoters'];?&gt;" class="form-control" placeholder="No of Partners involved" onkeyup="numberValidation('no_of_promoters')" &gt; &lt;span class="help-block hide"&gt;&lt;li class="hide"&gt;&lt;/li&gt;Select the number of partners involved.&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;script type="text/javascript"&gt; $(function() { $('#company_type_id').change(function(){ if($('#company_type_id').val()!=1){ $("#divtypeofb").show(1000).removeClass("hide"); } else { $("#divtypeofb").hide(1000).addClass("hide"); $("#no_of_promoters").val(''); } }); }); function numberValidation(id){ if($("#" + id).val() == null || $.trim($("#" + id).val()) == "" || !$.isNumeric($("#" + id).val())){ var div = $("#" +id).closest('div'); var label = div.find('label'); var span = div.find('span'); div.removeClass("has-success"); div.addClass("has-error"); label.find('li').removeClass('fa fa-check hide'); label.find('li').addClass('fa fa-times-circle-o'); span.removeClass("hide"); $("#" + id).focus(); //$("#" + id).scrollTo($(this),1000); return false; } else{ var div = $("#" +id).closest('div'); var label = div.find('label'); var span = div.find('span'); div.removeClass("has-error"); div.addClass("has-success"); label.find('li').removeClass('fa fa-times-circle-o hide'); label.find('li').addClass('fa fa-check'); span.addClass("hid…
type: Question
has answer: http://stackoverflow.com/a/28339657
has comment: http://stackoverflow.com/comment/45022934
has comment: http://stackoverflow.com/comment/45024063

http://stackoverflow.com/comment/45166423
type: QuestionComment
has text: @Spektre I think I got it. So first I perform FFT on the original array for every single row, which generates another array with real and imaginary part. I transpose it, and perform FFT on it again, which is equivalent to doing FFT on all columns, then transpose again, while keeping in mind that the array has to be of power 2. Then I multiply by some normalization constant. So from that array I can get the phase and magnitude spectrum to show.
score: 0
comment on: http://stackoverflow.com/q/28400281
type: Comment

http://stackoverflow.com/a/28289444
score: 2
downvote count: 0
has body: Is there any way of doing this reactively? Yes Is this usually handled with some sort of job queue? Yes The pattern I'd most recommend - is checking some sort of job-queue, regularly, for "expired" events. As for reactivity - it doesn't work well in every situation. There are more efficient structures that timer-based dependency invalidations. The following code, you can use to power a reactive-based timer system, or even a collection-backed timer system. If you feel this answer doesn't quite hit the mark, please comment, so I can refine it. // executes it's tasks regularly. // up to the tasks system to implement "enqueue" &amp; "execute" ScheduledExecutor = (function() { function ScheduledExecutor(tasks, checkInterval) { this.tasks = tasks; this.checkInterval = checkInterval; this.running = false; this.timer = null; this.tick = _.bind(this.tick, this); } _.extend(ScheduledExecutor.prototype, { enqueue: function(task){ this.tasks.enqueue(task); }, tick: function(){ this.tasks.execute(); if (this.running) { this.timer = Meteor.setTimeout(this, this.checkInterval); } }, start: function(){ if (!this.running){ this.running = true; this.tick(); } }, stop: function(){ this.running = false; Meteor.clearTimeout(this.timer); this.timer = null; } }); return ScheduledExecutor; })(); // example of "reactive" task list. // finds due dependencies, and invalidates them ReactiveTasks = (function(){ function ReactiveTasks(){ this.taskList = []; } _.extend(ReactiveTasks.prototype, { execute: function(){ var now = Date.now(); _.findWhere(this.taskList, function(task){ return task.due &lt;= now; }).forEach(function(task){ task.dep.changed() }); this.taskList = _.filter(this.taskList, function(task){ return task.due &gt; now; }); }, enqueue: function(due){ var dep = new Tracker.Dependency; dep.depend(); this.taskList.push({ due: due, dep: dep }); } }); return ReactiveTasks; })(); // executes tasks backed by a collection // finds "due" tasks, then calls the "executor" // the executor sho…
upvote count: 2
answers question: http://stackoverflow.com/q/28283963
type: Answer

http://stackoverflow.com/comment/45002872
has text: Where do you set up the "mouseup" event listener?
score: 1
comment on: http://stackoverflow.com/q/28327595
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28416689
upvote count: 1
has body: None, they are equivalent if you wanted you could put the code in one line as well and it would work. Usually people have personal preferences, as well as some companies require you to write the code in a specific way in order to standardize it and make it so anyone taking over your project knows what to expect.
downvote count: 0
answers question: http://stackoverflow.com/q/28416615
type: Answer
score: 1

http://stackoverflow.com/a/28330958
downvote count: 1
has comment: http://stackoverflow.com/comment/45010334
has comment: http://stackoverflow.com/comment/45011486
has comment: http://stackoverflow.com/comment/45010003
has comment: http://stackoverflow.com/comment/45011936
has comment: http://stackoverflow.com/comment/45011787
has comment: http://stackoverflow.com/comment/45040716
has comment: http://stackoverflow.com/comment/45011736
has comment: http://stackoverflow.com/comment/45011297
has body: Did you write the javascript code yourself? If so it should not be a problem finding the answer. StackOverflow is as said not a coding service. I can try to help you, but I will not be wasting time on this question if it's for homework or some programming job ;) If you first try to convert the code, I will be happy to help you (try). the following uses an html structure that is presumably the same as your php echo output. (function() { // Selecting all of the img tags within the document that have to be changed var imageNodes = $(".images img"); // TweenMax syntax stays the same function staggerImage() { TweenMax.staggerFromTo(imageNodes, 0.7, {opacity:0}, {opacity:1}, 0.3); } $(".filterList a").on("click", function(e) { console.log("fire"); // parent() - http://api.jquery.com/parent/ //console.log('This: %o - Parent - %o - ParentId - %o', $(this), $(this).parent(), $(this).parent().attr("id")); var parentId = $(this).parent().attr("id"); // [parentId] will be used as a scoped variable on the nested anonymous function declared in [.each] below. // .each([array],func) | [array].each(func) - http://api.jquery.com/jquery.each/ $(imageNodes).each(function(index, value) { console.log("index: %o | value: %o | parentId: %o", index, value, parentId); // .hasClass([string]) - http://api.jquery.com/hasclass/ if($(value).hasClass(parentId)) { $(value).css("display","inline"); } else { $(value).css("display","none"); } }); staggerImage(); }); staggerImage(); })(); img {width:5em; height:5em;border:0.1em solid black;} Something Menu Right Button with Dropdown Flower Puppy Kitty jsFiddle: http://jsfiddle.net/1m4LmLhx/1/ pastebin: http://pastebin.com/bfDL5NLU Note: when you click on the hyperlinks, that we've attached click event handlers to, the viewport is being directed back to the top of the page.. this is usually undesirable, but it seems to be outside of the scope of this question to address that behavior.
has comment: http://stackoverflow.com/comment/45040607
score: 0
has comment: http://stackoverflow.com/comment/45009183
has comment: http://stackoverflow.com/comment/45012077
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45038079
has comment: http://stackoverflow.com/comment/45012654
has comment: http://stackoverflow.com/comment/45010353
has comment: http://stackoverflow.com/comment/45041430
accepted answer of: http://stackoverflow.com/q/28330674
type: Answer
answers question: http://stackoverflow.com/q/28330674
has comment: http://stackoverflow.com/comment/45038063
has comment: http://stackoverflow.com/comment/45011855
has comment: http://stackoverflow.com/comment/45011770
upvote count: 1

http://stackoverflow.com/comment/44922462
comment on: http://stackoverflow.com/a/28283945
score: 0
type: AnswerComment
type: Comment
has text: So I tried implementing this, but it's not working. How is it retrieving the section classes here? It does not seem to know what section class it is supposed to go to.

http://stackoverflow.com/comment/45099199
score: 0
type: Comment
type: QuestionComment
has text: what is you code executing the http request?
comment on: http://stackoverflow.com/q/28379923

http://stackoverflow.com/comment/45066891
has text: Yes you need to separate it into two phases. You should consider restructuring your schema to avoid making joins.
comment on: http://stackoverflow.com/q/28361427
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45183545
comment on: http://stackoverflow.com/a/28393469
type: AnswerComment
score: 0
type: Comment
has text: Thank so much @jyrkim, you done awesome work. can i use $_POST instant of $_GET ?

http://stackoverflow.com/q/28400370
type: Question
tagged with: javascript
has body: I have wrote following code: To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video $("#btnForm").fancybox(); When I click full screen and switch of it I see intermediate state(bad): and then this(good) I don't like it. Please, advise how to fix it! P.S. Jsfiddle demo
possible better answer: http://stackoverflow.com/a/28555189
accepted answer: http://stackoverflow.com/a/28467852
has answer: http://stackoverflow.com/a/28555189
answer count: 2
favorite count: 0
tagged with: video.js
has title: fancybox shows intermediate state after turn of full screen
tagged with: http://stackoverflow.com/tag/html
tagged with: fancybox
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28467852
tagged with: rendering
score: 0
upvote count: 1
downvote count: 1

http://stackoverflow.com/comment/45070584
has text: Hello, sorry for the late reply. I managed to get the images to show now. It may have been an issue with my htaccess file, and also some rookie html mistakes. thanks so much for your help.
type: Comment
comment on: http://stackoverflow.com/a/28290166
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45061676
type: QuestionComment
comment on: http://stackoverflow.com/q/28359376
score: 0
has text: I am using IE10 but I want the implementation to be compatible with older IEs as well, that's when I thought of trying jquery 1.x but JQuery UI doesn't seem to be compatible here.
type: Comment

http://stackoverflow.com/comment/45132512
has text: Kind of, (IMO) you should think of an Array (months) as a *single entity* (a variable, or in the example above the property of an object) that is a list containing values that are stored & accessed by a numeric index
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28398025
type: AnswerComment

http://stackoverflow.com/q/28422853
type: Question
has comment: http://stackoverflow.com/comment/45205844
tagged with: javascript
has comment: http://stackoverflow.com/comment/45185311
tagged with: notifications
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/45202778
has body: I have been unsuccessfully trying to implement notification click (tap) handlers for my Firefox OS app. API documentation on the Notification object is here: https://developer.mozilla.org/en-US/docs/Web/API/notification In my app, I have an function that will launch the phone's browser when a notification is tapped and navigate to a URL: notification.onclick = function(){ var navURL = new MozActivity( { name: "view", data: { type: "url", url: "https://google.com" } }); console.log("Notification tapped"); }; When the user is viewing the app and taps a notification, my app will launch the browser and navigate to Google's homepage accordingly. However, if my app is running in the background, nothing happens when the notification is tapped. The console will still print the "Notification tapped" message (so apparently the event handler is called), but the browser does not launch. Go back into the app and everything works fine again. Is there a way to get the browser to launch even when my app is in the background? EDIT: ALTERNATIVE SOLUTION Is it possible to bring my app back up into the foreground when the notification is tapped?
accepted answer: http://stackoverflow.com/a/28439341
favorite count: 0
has title: Launch Firefox OS app when notification is tapped
has answer: http://stackoverflow.com/a/28439341
type: AnsweredQuestion
downvote count: 0
linked to: http://stackoverflow.com/q/60809383
score: 1
tagged with: firefox-os

http://stackoverflow.com/q/28359060
downvote count: 0
has answer: http://stackoverflow.com/a/28359297
type: Question
score: 2
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28359297
has answer: http://stackoverflow.com/a/28359497
accepted answer: http://stackoverflow.com/a/28359497
upvote count: 2
has body: I have a content DIV with many paragraphs. This is how its' markup look, &lt;div class=&quot;more&quot;&gt; &lt;p&gt;Based on a study of its skull, scientists say that an extinct one-tonne relative of the guinea pig probably used its 30cm incisors like tusks. Based on a study of its skull, scientists say that an extinct one-tonne relative of the guinea pig probably used its 30cm incisors like tusks. &lt;/p&gt; &lt;p&gt;That an extinct one-tonne relative of the ncisors like tusks. Based on a study of its skull, scientists say that an extinct one-tonne relative of the guinea pig probably used its 30cm incisors like tusks. &lt;/p&gt; &lt;p&gt;Extinct one-tonne relative of the guinea pig probably used its 30cm incisors like tusks. Based on a study of its skull, scientists say that an extinct one-tonne relative of the guinea pig probably used its 30cm incisors like tusks. &lt;/p&gt; &lt;/div&gt; Now I need to add a link to &quot;read more&quot; once the characters reach to 300 of &lt;div class=&quot;more&quot;&gt;. And also I would like to display this link as a toggle. Just I tried it with jquery, but I couldn't figure it out properly. This is my jquery - var showChar = 300; var ellipsestext = &quot;...&quot;; var moretext = &quot;more&quot;; var lesstext = &quot;less&quot;; $('.more').each(function() { var content = $(this).html(); if(content.length &gt; showChar) { var c = content.substr(0, showChar); var h = content.substr(showChar-1, content.length - showChar); var html = c + '&lt;span class=&quot;moreelipses&quot;&gt;'+ellipsestext+'&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;morecontent&quot;&gt;&lt;span&gt;' + h + '&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;&quot; class=&quot;morelink&quot;&gt;'+moretext+'&lt;/a&gt;&lt;/span&gt;'; $(this).html(html); } }); $(&quot;.morelink&quot;).click(function(){ if($(this).hasClass(&quot;less&quot;)) { $(this).removeClass(&quot;less&quot;); $(this).html(moretext); } else { $(this).addClass(&quot;less&quot;); $(this).htm…
has comment: http://stackoverflow.com/comment/45061482
answer count: 3
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28359438
tagged with: http://stackoverflow.com/tag/html
has title: How to add "read more" link with many paragraphs in jquery?

http://stackoverflow.com/a/28300928
has comment: http://stackoverflow.com/comment/44953431
answers question: http://stackoverflow.com/q/28300881
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28300881
has comment: http://stackoverflow.com/comment/44953182
type: Answer
has body: if () {} isn't a valid if statement - the condition body has to be an expression. Source: ECMAScript 5 spec For example, any of these are valid: if (true) {} if (1 &lt; 2) {} if("") {}
score: 5
upvote count: 5
has comment: http://stackoverflow.com/comment/44953354

http://stackoverflow.com/comment/45198916
comment on: http://stackoverflow.com/q/28434155
has text: Just to rephrase the question, you want to replace all `null` elements in an array with the string `'None'`?
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/q/28385273
has body: Is there a way to specify multiple source -> destination mappings when transforming jsx files to js files using browserify in grunt? I have the following in Gruntfile.js that supports a single file transformation, but I was hoping to be able to specify a second mapping for another file. I know I can map based on wild card into a single combined destination file. However, that is not what I want since I don't want an "all or nothing" include of the react components on my various pages. Some of the components only apply to a few pages and should not be included everywhere. browserify: { options: { transform: [ require('grunt-react').browserify ] }, //How do I map a second file here without a wild card? client: { src: ['react_components/src/component1.jsx'], dest: 'react_components/build/component1.js' } } Essentially what I hoped for is a way to provide an array of src-dest mappings in the same task in order to create multiple destination files: client: [{ src: ['react_components/src/component1.jsx'], dest: 'react_components/build/component1.js' }] Something like the above json
accepted answer: http://stackoverflow.com/a/28388183
score: 0
tagged with: reactjs
has comment: http://stackoverflow.com/comment/45109286
tagged with: javascript
tagged with: gruntjs
type: Question
tagged with: browserify
has answer: http://stackoverflow.com/a/28388183
type: AnsweredQuestion
has title: Transforming multiple JSX files
has comment: http://stackoverflow.com/comment/45109488
has comment: http://stackoverflow.com/comment/45109400
answer count: 1

http://stackoverflow.com/comment/45126017
comment on: http://stackoverflow.com/a/28393455
type: Comment
score: 0
type: AnswerComment
has text: i given ajax submission but i didnt get any any serverResponse

http://stackoverflow.com/comment/45055646
type: QuestionComment
has text: That would be the opposite of a clean "object-oriented" code. You should respect the Model-View-Controller approach, where all the View stays in your HTML and is updated according to your model (the $scope).
comment on: http://stackoverflow.com/q/28355992
score: 0
type: Comment

http://stackoverflow.com/comment/45212790
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28375037
has text: @WhiteG you can edit your existing questions rather than creating new questions that are asking practically the same thing, especially if those previous questions don't already have an accepted answer.
score: 0

http://stackoverflow.com/q/28352264
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45048845
has answer: http://stackoverflow.com/a/28352547
tagged with: java
has comment: http://stackoverflow.com/comment/45048538
tagged with: forms
type: Question
has comment: http://stackoverflow.com/comment/45048476
has title: Form validation Javascript is not responding
has answer: http://stackoverflow.com/a/28352392
tagged with: javascript
tagged with: servlets
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28352606
has body: Seconds ago, it was working, and I did not change anything. My web app is a simple web-app. Javascript is responsible for form validation before it redirects it to the servlet. What did I do wrong? Form validation is not validating. I am a novice programmer, so please help. // form-validation (javascript) function validateForm() { var firstname = document.forms["myForm"]["förnamn"].value; var lastname = document.forms["myForm"]["efternamn"].value; var address = document.forms["myForm"]["address"].value; var email = document.forms["myForm"]["email"].value; var news = document.forms["myForm"]["news"].value; if (firstname == null || firstname == "") { alert("Var god och fyll i alla fält!"); return false; } else if (lastname == null || lastname == "") { alert("Var god och fyll i alla fält!"); return false; } else if (address == null || address == "") { alert("Var god och fyll i alla fält!"); return false; } else if (email == null || email == "") { alert("Var god och fyll i alla fält!"); return false; } else if (email.indexOf("@hotmail.com") === -1) { alert("Skriv in en korrekt mail-address. exempel@hotmail.com"); return false } } // Abdi Tem Welcome to my website Hem INFO Ḱontakt Hyr en programmerare: Ditt namn: Ditt efternamn: Din adress: Din email: Är ditt ärende akut? JA NEJ Vad vill du ha hjälp med? Programmering Felsökning/Debugging Hur många timmar kommer ditt ärende att ta? 10-20h 30-40h 50-60h 70h+
has comment: http://stackoverflow.com/comment/45048440

http://stackoverflow.com/a/28402028
has body: The ons-sliding-menu element object inside the javascript is $scope.sidemenu and not sidemenu, try modifying it and see if it works. If it still doesn't work probably is because: the controller is not declared correctly inside the HTML (for example: doesn't cover the portion of code where the sliding menu in declared) the code that creates the ons-sliding-menulistener is never executed, so the listener doesn't exist EDIT This is a example that I have implemented in one of my apps app.controller('SlidingMenuController', function($scope){ $scope.checkSlidingMenuStatus = function(){ $scope.slidingMenu.on('postclose', function(){ $scope.slidingMenu.setSwipeable(false); }); $scope.slidingMenu.on('postopen', function(){ $scope.slidingMenu.setSwipeable(true); }); }; $scope.checkSlidingMenuStatus(); }); Hope it helps
score: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45177168
answers question: http://stackoverflow.com/q/28376642
has comment: http://stackoverflow.com/comment/45139528
upvote count: 2
has comment: http://stackoverflow.com/comment/45139459
type: Answer

winjs
tags question: http://stackoverflow.com/q/28374811
tag name: winjs
tags question: http://stackoverflow.com/q/28415190
type: Tag

http://stackoverflow.com/q/28397930
type: Question
has body: I am trying to create an helper that creates modals using bootbox.js but I am having trouble with it. I would like it to look like : {{ #modal }} Whatever I want {{ &gt; MaybeEvenAnotherTemplate }} {{ /modal }} I have tried this : &lt;!-- html --&gt; &lt;template name="_modalContent"&gt; {{ &gt; UI.contentBlock }} &lt;/template&gt; // js Template.registerHelper('modal', function() { opts = {}; opts.title = "Sometitle"; opts.message = "&lt;div class='bootbox-content'&gt;&lt;/div&gt;"; bootbox.dialog(opts); Blaze.render(Template._modalContent, $('.bootbox-content')[0]); return Template._modalContent; // I get the errors with or without a return }); It is not working. I know the part inside the helper works in standalone (like in the javascript console, it works when rendering other classic templates like forms...), but coupled with the "#modal" helper with block, I just get: Exception in template helper: TypeError: Cannot read property '__isTemplateWith' of null Uncaught Error: Expected template or null, found: undefined with no file indicating where the problem is coming from. I guess I could just remove bootbox.js and be pretty fine, but I would love to make this work, does anybody have an idea why it is failing ? Thanks.
tagged with: javascript
has comment: http://stackoverflow.com/comment/45132813
has comment: http://stackoverflow.com/comment/45163496
score: 0
tagged with: meteor
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45136591
has comment: http://stackoverflow.com/comment/45153985
answer count: 0
tagged with: bootbox
has title: Meteor, register modal helper (bootboxjs)

http://stackoverflow.com/comment/98741551
comment on: http://stackoverflow.com/a/28403873
type: Comment
has text: Thanks for your code because I was doing a quiz with JS and on submit wanted to show results of quiz how many I got correct and thanks to your post solved it :)
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45093447
has text: Sorry I don't quite follow. If I simply add to the element using document.getElementById(id), how does that help me when I haven't received the information back from the server yet?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28375754
type: Comment

http://stackoverflow.com/comment/45007490
comment on: http://stackoverflow.com/q/28329951
has text: @Zack Why recommend Jsfiddle when Stack Overflow has equally capable fiddling capabilities built in?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44936601
type: AnswerComment
has text: So I tried removing the `return` and that does seem to fix that issue, but it creates another one. Once I click in the field, it increments the counter to `1 words` even though I haven't typed anything. In fact, it increments the counters for both title & body fields, once I click in any one of them. FWIW, removing both `if` blocks also gives me this issue.
comment on: http://stackoverflow.com/a/28291589
type: Comment
score: 0

http://stackoverflow.com/comment/45149327
comment on: http://stackoverflow.com/q/28404463
score: 0
type: QuestionComment
type: Comment
has text: In my xmlcreate.php (distant file taht generate xml) I put : header("Access-Control-Allow-Origin: *"); This works locally only with firefox : file:///C:/Apps/Comune/www/visits.html

http://stackoverflow.com/q/28421278
has comment: http://stackoverflow.com/comment/45176619
type: Question
has comment: http://stackoverflow.com/comment/45184544
linked to: http://stackoverflow.com/q/166221
has comment: http://stackoverflow.com/comment/45184528
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/45176523
has title: Ajax uploads not working
type: UnansweredQuestion
tagged with: php
has body: Hi I'm having some trouble figuring out whats wrong with my ajax request. Its a script for uploading pictures. The php file sets up a page with an inline popup for selecting images and displaying their previews the selection is done in a form called #uploads and if the form is submitted it works the way its supposed to, refreshing to a page where the $_FILES info is included the php file: <?php echo (print_r($_FILES)); $html = ' test Lägg till Avbryt Lägg till nu bild '; echo $html; The java script file contains the logic for showing selection popup, creating previews of files and finally uploading them with ajax. This last part however does not work. The page returned displays an empty $_FILES array page.js: $(function(){ $nybild = $("#nybild"); $overlay = $("#overlay"); $overlay2 = $("#overlay2"); $preview = $("#preview"); $("#lagg_till").click(function(){ $overlay.show(); $nybild.show(); }); $("#filer").on("change", function(){ $preview.html(""); var files = this.files; for(var i = 0; i < files.length; i++){ if(files[i].type.match("image.*")){ var reader = new FileReader(); reader.onload = (function(theFile){ return function(e){ $preview.append([" "].join('')); }; })(files[i]); reader.readAsDataURL(files[i]); } } }); $("#cancel").click(close_nybild); $("#add").click(function(){ var formdata = new FormData($("#upload").get()); $.ajax({ type: 'POST', dataType: 'text', beforeSend: function(){ console.log(formdata); }, success: function(data){ var pop = window.open("", "MsgWindow", "width=200, height=100"); pop.document.write(data); }, error: function(){ $overlay2.hide(); alert("Upload Misslyckades B("); }, // Form data data: formdata, //Options to tell jQuery not to process data or worry about content-type. cache: false, contentType: false, processData: false }) }); function close_nybild(){ $overlay.hide(); $nybild.hide(); reset($nybild); } var reset = function(e){ e.wrap(" ").closest('form').get(0).reset(); e.unwrap(); $preview.html(""); } }); The majority of the c…
answer count: 0

http://stackoverflow.com/comment/45033328
type: QuestionComment
type: Comment
has text: It isn't complicated. Just step through each part of the statement in turn paying attention to operator precedence. (And run it without the eval for a clue)
comment on: http://stackoverflow.com/q/28344551
score: 0

http://stackoverflow.com/q/28347413
downvote count: 0
tagged with: jquery
favorite count: 0
has body: I am trying to find a an ID of a select element inside a fieldset, I have tried $('#fieldsetID select #idOfSelect'); And $('#fieldsetID).find('select #idOfSelect'); Both appear as undefined in the JS console. What am I doing wrong? Cheers
has answer: http://stackoverflow.com/a/28347435
has comment: http://stackoverflow.com/comment/45039059
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28347460
has comment: http://stackoverflow.com/comment/45039054
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28347435
linked to: http://stackoverflow.com/q/9615777
possible better answer: http://stackoverflow.com/a/28347460
answer count: 2
has title: jQuery find ID in a fieldset
has comment: http://stackoverflow.com/comment/45039058

http://stackoverflow.com/comment/45178971
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28422988
has text: An important note: `instance.doSomething` --- this function reference is not an `instance` instance when it's invoked by a promise.

http://stackoverflow.com/comment/45063132
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28348305
has text: @Nusrat In that case, you can use Angular JS to pass the data you get in `selectrow()` function and build the contact list. [Check this link](https://docs.angularjs.org/api/ng/directive/ngRepeat)

http://stackoverflow.com/q/28322680
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28326639
has title: Bootstrap Datepicker : Changing start date to tomorrow
favorite count: 0
tagged with: bootstrap-datepicker
tagged with: twitter-bootstrap
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/33513723
tagged with: datepicker
score: 1
upvote count: 1
type: Question
answer count: 2
has body: I am using the Bootstrap datepicker and the following is my jQuery code: $('.form_date').datetimepicker({ language: 'en', /* endDate: '+0d', */ startDate: '+1d', weekStart: 1, autoclose: 1, startView: 2, format: 'dd/mm/yyyy', minView: 2, forceParse: 0, }); The following is what I get: I want have the start date highlighting on tomorrow according to our requirement. I have found one option defaultViewDate on the Bootstrap datepicker documentation. (http://bootstrap-datepicker.readthedocs.org/en/latest/options.html) It states that I have to set the year, month, and day key of defaultViewDate. But I don't know how to set it.
downvote count: 0

http://stackoverflow.com/a/28305902
type: Answer
has body: You need to sent your query as POST rather than GET. When you are sending it as GET , though you are hitting the _search API , the query part is not considered. Hence you will just get the top N documents out of the index.
upvote count: 2
score: 2
has comment: http://stackoverflow.com/comment/44964499
answers question: http://stackoverflow.com/q/28305271
has comment: http://stackoverflow.com/comment/68742979
accepted answer of: http://stackoverflow.com/q/28305271
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45059930
has text: It is giving me with a compiling error as `Parse error. missing ) after argument list`
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28358316

http://stackoverflow.com/comment/45097361
has text: $res1->user_id and $user_id are not equal they both has different values
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28369522

http://stackoverflow.com/comment/45103564
type: Comment
has text: I think you have to add mobile js on your page like - ` `
comment on: http://stackoverflow.com/a/28381946
type: AnswerComment
score: 1

http://stackoverflow.com/q/28315040
favorite count: 0
tagged with: npm
type: UnansweredQuestion
tagged with: dependencies
tagged with: node.js
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/30249901
has title: Unmet dependencies for the last version of npm (and node)
has body: I have the last version of npm and node. And I have this errors/warnings: $ npm --version 2.4.1 $ node --version v0.10.36 $ npm install &gt; my_project@0.0.0 preinstall /Users/alex/Documents/projects/ruby/my_project &gt; script/gem_npm install npm WARN package.json karma-ie-launcher@0.1.5 No README data npm WARN package.json karma-qunit@0.1.4 No README data npm WARN unmet dependency /Users/alex/Documents/projects/ruby/my_project/node_modules/node-sass requires mkdirp@'~0.3.5' but will load npm WARN unmet dependency /Users/alex/Documents/projects/ruby/my_project/node_modules/mkdirp, npm WARN unmet dependency which is version 0.5.0 npm WARN unmet dependency /Users/alex/Documents/projects/ruby/my_project/node_modules/testem requires js-yaml@'~0.3.5' but will load npm WARN unmet dependency /Users/alex/Documents/projects/ruby/my_project/node_modules/js-yaml, npm WARN unmet dependency which is version 3.2.5 npm WARN unmet dependency /Users/alex/Documents/projects/ruby/my_project/node_modules/testem requires glob@'~3.1.21' but will load npm WARN unmet dependency /Users/alex/Documents/projects/ruby/my_project/node_modules/glob, npm WARN unmet dependency which is version 3.2.11 npm WARN unmet dependency /Users/alex/Documents/projects/ruby/my_project/node_modules/karma requires glob@'~3.1.21' but will load npm WARN unmet dependency /Users/alex/Documents/projects/ruby/my_project/node_modules/glob, npm WARN unmet dependency which is version 3.2.11 npm WARN unmet dependency /Users/alex/Documents/projects/ruby/my_project/node_modules/karma requires lodash@'~1.1' but will load npm WARN unmet dependency /Users/alex/Documents/projects/ruby/my_project/node_modules/lodash, npm WARN unmet dependency which is version 2.4.1 npm WARN unmet dependency /Users/alex/Documents/projects/ruby/my_project/node_modules/karma-coffee-preprocessor/node_modules/coffee-script requires mkdirp@'~0.3.5' but will load npm WARN unmet dependency /Users/alex/Documents/projects/ruby/my_project/node_modules/mkdi…
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/28317910
downvote count: 0
tagged with: macos

http://stackoverflow.com/comment/45029873
score: 1
comment on: http://stackoverflow.com/q/28342046
type: Comment
type: QuestionComment
has text: Socket.io is not designed for pages changes. It is designed to keep a permanent contact between server and client, like for chats and all. If you change your page, it breaks the connection. I believe that's not the right usage for socket.io, is it?

http://stackoverflow.com/q/28375030
answer count: 3
has answer: http://stackoverflow.com/a/28375932
tagged with: hash
tagged with: twitter-bootstrap
type: UnansweredQuestion
has body: I am using Bootstrap Data Table to generate a user table and I want to display each users avatar in the table which I have working now. I allow users to use gravatar, but I am also forcing the default to be the retro icon. The problem that I have is that it generates the same hash for each user causing their icons to be the same. Here is my JS code: function usernameFormatter(value, row) { var id = row.id; var email = row.email; var avatarType = row.avatar_type; var avatar = '../users/' + row.avatar; if(avatarType == 'Gravatar'){ var retro = 'retro'; var urlencode = &lt;?php echo urlencode( retro ); ?&gt;; var hash = '&lt;?php echo md5( strtolower( trim( email ) ) ); ?&gt;'; var avatar = 'http://www.gravatar.com/avatar/' + hash + '?d=' + urlencode; } return '&lt;a href="../users/profile.php?userid=' + id + '" target="_blank"&gt;&lt;img src="' + avatar + '" style="width: 32px;margin-right: 5px;"&gt;' + value + '&lt;/a&gt;'; } I am having trouble writing, for each email address use a different hash. Can someone guide me in the right direction? Any code examples you have is much appreciated.
has comment: http://stackoverflow.com/comment/45090478
upvote count: 1
tagged with: php
score: 1
has answer: http://stackoverflow.com/a/28375345
type: Question
has comment: http://stackoverflow.com/comment/45090638
downvote count: 0
tagged with: javascript
has title: Generate new hash for each user email using PHP and Javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28375240
has comment: http://stackoverflow.com/comment/45090959
has comment: http://stackoverflow.com/comment/45090793

http://stackoverflow.com/q/28385790
downvote count: 0
tagged with: php
type: AnsweredQuestion
score: 1
tagged with: mysql
accepted answer: http://stackoverflow.com/a/28386566
type: Question
has title: Add the check box values PHP, MySQL and alertbox using JavaScript
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
has body: Following is my table structure :- Name Marks A 12 B 41 C 13 D 24 E 91 F 89 G 87 table name is "login". My code is as follows :- Untitled Document Select students :- <?php mysql_connect("localhost", "root", "root1") or die (mysql_error ()); mysql_select_db("my_db") or die(mysql_error()); $strSQL = "SELECT Name FROM login ORDER BY Name"; $rs = mysql_query($strSQL); while($row = mysql_fetch_array($rs)) { $man = $row['Name']; echo ' '; echo $man; echo " "; } mysql_close(); ?> Now I want an alert box using JavaScript when user checks the Name list the sum of marks should not exceed 100. i.e if user selects A,B,D and E the sum exceeds 100 , then a alert message should be displayed stating "you cannot exceed summation of marks 100". Please help me with the necessary code.
has answer: http://stackoverflow.com/a/28386566
favorite count: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/28360038
answers question: http://stackoverflow.com/q/28359998
downvote count: 0
score: 1
has body: If there are no APIs (which give you access to the elements), you cannot interact with the Flash UI, because the Flash content has its own context, where JavaScript has no access to it.
upvote count: 1
has comment: http://stackoverflow.com/comment/45062782
has comment: http://stackoverflow.com/comment/45062724
type: Answer
has comment: http://stackoverflow.com/comment/45062762

http://stackoverflow.com/a/28367233
downvote count: 0
has body: The replacer parameter in JSON.stringify() has the following: Parameter key - The name of the property being stringified Parameter value - The value of the property being stringified Bound this - The current object containing the property being stringified You can "debug" each call and print the values like this: var a = new Array(3); a[0] = true; a[2] = undefined; JSON.stringify(a, function(key, value) { var s = '\n-----------' s += '\nkey: ' + JSON.stringify(key); s += '\nvalue: ' + JSON.stringify(value); s += '\nthis: ' + JSON.stringify(this); document.getElementById('result').innerHTML += s; return value; }); &lt;pre id="result"&gt;&lt;/pre&gt; This means you do have access to the original array in this. Therefore you can use a simple hasOwnProperty in combination as you suggested in your question to determine if it is defined or not: var a = new Array(3); a[0] = true; a[2] = undefined; var result = JSON.stringify(a, function(key, value) { // value is undefined, either explicitly or really not set if(typeof value === "undefined") { // property not set at all if(!this.hasOwnProperty(key)) { return "really undefined"; } else { // returning undefined from the callback will set the value to null, // so I give another value here to demonstrate the check return "explicitly undefined"; } } // has an actual value so just return it return value; }, " "); document.getElementById('result').innerHTML = result; &lt;pre id="result"&gt;&lt;/pre&gt; Something worth highlighting as I mentioned in the codes comments, you have to be careful with returning undefined from the callback. As the MDN article I linked to at the top states: Note: You cannot use the replacer function to remove values from an array. If you return undefined or a function then null is used instead. This is why the debug snippet shows nulls for array entries 1 and 2.
type: Answer
answers question: http://stackoverflow.com/q/28366317
score: 1
upvote count: 1

http://stackoverflow.com/a/28417457
answers question: http://stackoverflow.com/q/28417252
score: 0
has body: Here you can find an answer to your question: http://updates.html5rocks.com/2014/11/Support-for-theme-color-in-Chrome-39-for-Android
type: Answer

http://stackoverflow.com/comment/45183529
has text: To clarify, a directive instance can't reference itself. But two directive instances of the same type can.
comment on: http://stackoverflow.com/a/28424986
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45175767
comment on: http://stackoverflow.com/q/28420117
score: 0
type: Comment
type: QuestionComment
has text: What kind of authentication are you using? Cookie authentication or tokens?

http://stackoverflow.com/comment/45195539
comment on: http://stackoverflow.com/q/28432702
has text: Browser detection is usually bad if you really want feature detection. Can you replace your `isIE()` with `!!window.Event` or some similar feature check? Does one of the variants work in IE or does it not work at all?
score: 0
type: Comment
type: QuestionComment

webforms
tags question: http://stackoverflow.com/q/28369313
tags question: http://stackoverflow.com/q/28350165
type: Tag
tag name: webforms

http://stackoverflow.com/comment/45173424
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28412604
score: 0
has text: Yes, use events. It gives you a looser coupling than using globals.

http://stackoverflow.com/comment/45030151
comment on: http://stackoverflow.com/a/28341793
has text: A 500 error means that there was an issue with your server-side code. You need to debug your PHP.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45040320
comment on: http://stackoverflow.com/q/28347728
has text: Is there a reason why you aren't using services? I rarely use, and try to avoid broadcast/emit.
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/44987131
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28317024
has text: GOD like. thanks for answering to my silly questions. Hope you have a nice day~!
type: AnswerComment

http://stackoverflow.com/comment/45028355
has text: Surely that should be `onclick="window.location = 'http://sd.domain.tld?search=value'"`... (or `https`, of course).
score: 0
comment on: http://stackoverflow.com/q/28341729
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28284738
has body: This is a popular modular pattern in javascript, often seen in node. Here's what you gain: You can modularize your code into separate files so you don't end up with big monolith chunks of code. By requiring the module as a function, you can pass some variable constants (such as the application config, or a datatbase entry point). You can choose what to expose, and what to keep private by using module.exports which cleans up the global object for the application. In the code snippet you provided, your passing the app config to the routes file, where you are creating a route that is reliant on the variable. If that route relied on interior logic, that logic could be scoped to the routes.js file rather than be exposed to the rest of the application.
answers question: http://stackoverflow.com/q/28284624
score: 0
type: Answer

http://stackoverflow.com/comment/45052470
score: 2
comment on: http://stackoverflow.com/q/28354378
has text: The slash in bower_components is causing the regex to end before you expect. So it's interpreting `[^.]+).css/g` as the modifiers. Your code is equivalent to doing `new RegExp('/(bower_components/', '[^.]+).css/g')`.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28439337
downvote count: 0
has comment: http://stackoverflow.com/comment/45660480
has comment: http://stackoverflow.com/comment/45213668
has comment: http://stackoverflow.com/comment/45644340
accepted answer of: http://stackoverflow.com/q/28436603
type: Answer
has comment: http://stackoverflow.com/comment/45688419
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28436603
has body: You should put the AJAX call within the pagecreate event so that it runs at the correct time. Also, instead of appending the listitems one at a time, build a string with all the listitems and then append them to the DOM once after the for loop: $(document).on("pagecreate", "#page1", function(){ $.ajax({ url: 'https://api.wmata.com/StationPrediction.svc/json/GetPrediction/B01,F01?api_key=kfgpmgvfgacx98de9q3xazww', dataType: 'jsonp', }).success(function (data){ var html = '' for(var i =0; i < data.Trains.length; i++) { html += " Line: "+data.Trains[i].Line+" Cars:"+data.Trains[i].Car+" Destination:"+data.Trains[i].DestinationName+" Min: "+data.Trains[i].Min+" "; } $("#test1").append(html).listview("refresh"); }); }); This will improve your code and performance, but it could still be that the temporary api key is rate limited, and that is causing your particular problem.
has comment: http://stackoverflow.com/comment/45628726
type: AcceptedAnswer

http://stackoverflow.com/comment/45083851
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28371589
type: Comment
has text: what if you do this `var rep = $('<%=RepeaterTrackingInformation.ClientID%>').val();` do you get the expected results..?

http://stackoverflow.com/a/28290285
answers question: http://stackoverflow.com/q/28290067
has body: Put an ID on your form and change your "Yes" click function to post your form instead of the location. Change this: click: function() { $(this).dialog('close'); window.location.href=url; } To this: click: function() { $('#MyForm').submit(); $(this).dialog('close'); } Here's the jQuery submit() documentation: http://api.jquery.com/submit/
has comment: http://stackoverflow.com/comment/44934301
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28290067

http://stackoverflow.com/q/28313692
upvote count: 4
tagged with: jakarta-ee
downvote count: 0
tagged with: swingx
tagged with: javascript
type: UnansweredQuestion
has title: GATE -Dgate.plugins.home option in your start-up script
has body: i am using GATE.ac.uk. scr code in eclipse LUNA java 1.8. I have problem with execution for start the GATE application.it shows the error like this: "Error during initialisation : gatel:util.GateRuntimeException:Could not infer installed plug-ins home! please set it manually using the -Dgate.plugins.home option in your start-up script. Do you still want to start GATE?" Console: log4j:WARN No appenders could be found for logger (gate.Gate). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. if you know, which version of eclipse use for GATE development let me know. Then if you know the solution for this error &amp; let me know the plugins(-Dgate.plugins.home option in your start-up scrip)configuration steps.
has answer: http://stackoverflow.com/a/28762574
favorite count: 0
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/39951899
score: 4
tagged with: java

http://stackoverflow.com/a/28432329
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28432078
accepted answer of: http://stackoverflow.com/q/28432078
type: AcceptedAnswer
downvote count: 0
has body: Is something like this what you're looking for?: &lt;div class="countup" value="jan,01,2014,00:00:00"&gt;&lt;/div&gt; &lt;div class="countup" value="feb,05,2015,13:00:00"&gt;&lt;/div&gt; function upTime(element) { now = new Date(); countTo = new Date(element.getAttribute("value")); difference = (now-countTo); days=Math.floor(difference/(60*60*1000*24)*1); hours=Math.floor((difference%(60*60*1000*24))/(60*60*1000)*1); mins=Math.floor(((difference%(60*60*1000*24))%(60*60*1000))/(60*1000)*1); secs=Math.floor((((difference%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1); element.innerHTML = "It's been " + days + " days " + hours + " hours " + mins + " minutes " + secs + " seconds"; setTimeout(function(){ upTime(element); },1000); } var elements = document.getElementsByClassName("countup"); for (var i = 0; i &lt; elements.length; i += 1) { upTime(elements[i]); } jsFiddle: http://jsfiddle.net/6f6c8z4a/1/ Output: It's been 405 days 13 hours 58 minutes 43 seconds It's been 5 days 0 hours 58 minutes 43 seconds One thing to note is that setTimeout(.., 1000) is not a reliable way to run code every second because setTimeout makes a best effort. In practice the timer will start to skew pretty quickly. You can consider running this code more often (every 100ms) or you can ignore the skew.
has comment: http://stackoverflow.com/comment/45194869
type: Answer

http://stackoverflow.com/q/28339246
linked to: http://stackoverflow.com/q/16086162
has answer: http://stackoverflow.com/a/28339443
tagged with: http
has comment: http://stackoverflow.com/comment/45027460
tagged with: c#
has body: I need to download a zip file using ajax and ashx. Currently I am using the code https://stackoverflow.com/a/23797348 but the downloaded zip file is invalid. The ashx code i am using is : MemoryStream exportPrjtResponseMemStream = SomeClass.ReturnResponse(ID); Response.ContentType = "application/zip"; Response.AppendHeader("content-disposition", "attachment; filename=\"" + fileName + ".zip\""); Response.CacheControl = "Private"; Response.AppendHeader("Content-Length", exportPrjtResponseMemStream.Length.ToString()); exportPrjtResponseMemStream.WriteTo(Response.OutputStream); Response.Flush(); Response.End(); Please suggest.
type: Question
score: 0
has title: Download a zip file using ajax response
answer count: 1
has comment: http://stackoverflow.com/comment/45033453
tagged with: javascript
has comment: http://stackoverflow.com/comment/45023679
tagged with: ajax
tagged with: ashx
type: UnansweredQuestion

http://stackoverflow.com/comment/45174557
type: QuestionComment
comment on: http://stackoverflow.com/q/28420613
has text: Without knowing anything about your site code it's impossible to say what you need to do. The point is that you're taking user-supplied content and blinding including it somehow as part of the page. All web programming environments provide one or more ways of sanitizing user-supplied content.
score: 0
type: Comment

http://stackoverflow.com/comment/45024823
type: Comment
comment on: http://stackoverflow.com/a/28339401
type: AnswerComment
has text: The first node error is outputted about 50 times before the `1note.js0` is outputted.
score: 0

http://stackoverflow.com/q/28412964
has answer: http://stackoverflow.com/a/28413002
has title: jQuery click event never triggered
score: -2
answer count: 2
has comment: http://stackoverflow.com/comment/45159209
linked to: http://stackoverflow.com/q/203198
upvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/28413002
has answer: http://stackoverflow.com/a/28413038
accepted answer: http://stackoverflow.com/a/28413038
type: AnsweredQuestion
has body: I have the following javascript code: $(function (){ $('a.folder').click(function() { // code goes here ... } }); And the following html code: Etudes de cas Whenever I click on the link, the javascript code is never reached. I must say that this html code is generated dynamically after the page loaded. Is this the reason? Any workaround?
downvote count: 3
duplicate of: http://stackoverflow.com/q/203198
has comment: http://stackoverflow.com/comment/45159314
has comment: http://stackoverflow.com/comment/45159287
type: Question

http://stackoverflow.com/comment/45175295
has text: Great, no compile error. However, the file is not being loaded, even though the path seems to be correct.
comment on: http://stackoverflow.com/q/28414356
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28362456
tagged with: reactjs
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/28362515
type: Question
possible better answer: http://stackoverflow.com/a/28362833
has answer: http://stackoverflow.com/a/28362833
has body: I'm very new to React.js but exploring it I expected something that I'm not able to do. Say that I have a component: var SampleComponent = React.createClass({ render: function() { return ( Hello ); } }); Is this the only way to add it to the DOM? React.render( <SampleComponent />, document.getElementById('content') ); I hoped I would be able to do something like this directly in HTML after having defined the component: <SampleComponent /> Am I missing something? Thanks
has comment: http://stackoverflow.com/comment/58648289
score: 4
answer count: 2
has answer: http://stackoverflow.com/a/28362515
tagged with: dom
has title: React.js write components directly in HTML
upvote count: 4

http://stackoverflow.com/a/28387859
has comment: http://stackoverflow.com/comment/45114092
type: Answer
has comment: http://stackoverflow.com/comment/45114515
has body: Change your javascript method so you send json data to the server: $.ajax({ type: "POST", url: "arra.php", data: {test : JSON.stringify(a)}, success: function(data) { alert("success " + data); // now you will see the echo-ed array elements on the alert message } }); Than on your php file you can read it like this: $arr = json_decode($_POST['test'], true); echo $arr[0]; echo $arr[1]; echo $arr[2];
has comment: http://stackoverflow.com/comment/45114904
has comment: http://stackoverflow.com/comment/45113908
has comment: http://stackoverflow.com/comment/45114106
has comment: http://stackoverflow.com/comment/45114694
has comment: http://stackoverflow.com/comment/45113843
has comment: http://stackoverflow.com/comment/45114854
has comment: http://stackoverflow.com/comment/45114073
has comment: http://stackoverflow.com/comment/45114680
has comment: http://stackoverflow.com/comment/45114290
has comment: http://stackoverflow.com/comment/45115013
score: 0
has comment: http://stackoverflow.com/comment/45113895
has comment: http://stackoverflow.com/comment/45114552
has comment: http://stackoverflow.com/comment/45114259
has comment: http://stackoverflow.com/comment/45115039
answers question: http://stackoverflow.com/q/28387805
has comment: http://stackoverflow.com/comment/45113294

http://stackoverflow.com/comment/44972769
has text: Ouch, I've overlooked you're on ASP. Sorry about that.
type: AnswerComment
score: 1
type: Comment
comment on: http://stackoverflow.com/a/28310826

http://stackoverflow.com/comment/45198339
score: 0
has text: I'm pretty sure there is an Aurelia abstraction of this?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28419242

http://stackoverflow.com/comment/45148286
type: QuestionComment
comment on: http://stackoverflow.com/q/28406987
score: 1
has text: put in a separate js file and make a reference in the head.
type: Comment

http://stackoverflow.com/q/28294401
accepted answer: http://stackoverflow.com/a/28294650
type: AnsweredQuestion
score: -2
tagged with: javascript
has answer: http://stackoverflow.com/a/28294650
type: Question
downvote count: 2
has title: How to use the animate?
answer count: 3
has answer: http://stackoverflow.com/a/28294438
tagged with: jquery
has comment: http://stackoverflow.com/comment/44941444
favorite count: 0
tagged with: css
upvote count: 0
has answer: http://stackoverflow.com/a/28295328
possible better answer: http://stackoverflow.com/a/28294438
has body: I'm just beginner for JavaScript, but I try to do some function and I follow some guy on the internet I'm trying to do Hide and Show the Menu. My purpose is When I move my mouse to the Menu, it will show from bottom to up and when I move my mouse to outside it will be move slowly from up to bottom. I can do with Click Function, but When I try with movemouse and mouseleave, it can not work. I create 2 function function showSelect() { $("#select").animate({"bottom": 0}, 300, 'linear'); } function hideSelect() { $("#select").animate({"bottom": -148}, 300, 'linear'); } And this code move my mouse : $("#select").mousemove(function() { $("#select").showSelect(); }).mouseleave(function() { $("select").hideSelect(); }); I hope some one can give me some advices. Thanks

http://stackoverflow.com/comment/45064234
type: QuestionComment
has text: It is very strange indeed. I looked at the code of [preprocess](https://github.com/jsoverson/preprocess), and found the [regex](https://github.com/jsoverson/preprocess/blob/master/lib/regexrules.js#L30) they used for matching the echo statement. Also, I can see they match .sass files and css files both with the same rules. After some fiddling around with the regex they use, I got it to match both of your cases (it was not valid, according to their rules, I'm not sure if it is different standard). Though if it works one way, just use that. There should be no problems doing this either way.
comment on: http://stackoverflow.com/q/28356003
type: Comment
score: 0

http://stackoverflow.com/comment/44996827
type: Comment
has text: That won't work, the method `map.addControl` doesn't return anything so the the variable stays undefined. If your so adament on using `.addControl` you could do: `var myCustomControl = new MyCustomControl();` and then do: `map.addControl(myCustomControl);` I'de just do it in one line like in my first comment: `var myCustomControl = new MyCustomControl().addTo(map);` which uses the `addTo` method of the control, which is exactly the same as using the `addControl` method of the map.
type: AnswerComment
comment on: http://stackoverflow.com/a/28319456
score: 0

epub
type: Tag
tags question: http://stackoverflow.com/q/28303866
tag name: epub

http://stackoverflow.com/q/28331027
has body: i'm trying to fix the following, simple code: $(document).ready(function() { $("#login").click(function() { var a = 3; var b = 2; var dataString = "a="+a+"&amp;b="+b; console.log(dataString); $.ajax({ url: "ajax.php", type: "post", data: dataString, cache:"false", beforeSend: function(){console.log("Sending...");}, error: function(x,y,z){console.log("err: "+x+" "+y+" "+z);}, success: function(x,y,z){console.log("succ: "+x+" "+y+" "+z);} }); }); }); ajax.php: &lt;?php $a = $_POST['a']; $b = $_POST['b']; echo $a+$b; ?&gt; My problem is that, the site always returns with error and emtpy x,y,z.
has answer: http://stackoverflow.com/a/28333468
has comment: http://stackoverflow.com/comment/45009248
type: Question
has comment: http://stackoverflow.com/comment/45009365
has comment: http://stackoverflow.com/comment/45009775
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45009633
has comment: http://stackoverflow.com/comment/45009970
has comment: http://stackoverflow.com/comment/45009344
tagged with: ajax
has comment: http://stackoverflow.com/comment/45009619
score: 0
has comment: http://stackoverflow.com/comment/45009525
has comment: http://stackoverflow.com/comment/45009909
answer count: 1
has title: Ajax POST with jQuery throwing empty errors
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/45009747

http://stackoverflow.com/q/28335502
has answer: http://stackoverflow.com/a/28860933
tagged with: amd
type: Question
tagged with: aurelia
tagged with: javascript
answer count: 2
has body: I was playing with Aurelia and seems pretty nice, I use Durandal for some projects and this definitively suit my needs. Use the new class definition from EC6 is awesome. But now I'm preparing something in which I need to use a classic AMD modules with requireJs, something like this one: define("testModule", [], function() { "use strict"; console.log('testModule loaded'); var testModule = function() { var that = this; this.variable = 10; that.getVariable = function(){ alert('function executed ' + that.variable); }; } return testModule; }); Following the Aurelia's documentation I found that is possible to use something like the testModule as a ViewModel, in fact that viewModel was used in a Durandal application. But after some attempts I was unable to get this working. Any thoughts or approaches that someone has followed to do that? And most important, it is possible? I think it is but just to confirm that are compatible. Thanks.
has title: Using AMD module as an Aurelia ViewModel
accepted answer: http://stackoverflow.com/a/28860933
downvote count: 0
favorite count: 0
tagged with: requirejs
has answer: http://stackoverflow.com/a/28393028
tagged with: durandal
score: 2
type: AnsweredQuestion
upvote count: 2
possible better answer: http://stackoverflow.com/a/28393028

http://stackoverflow.com/comment/45187479
type: Comment
has text: Thanks but how can I add multiple variables? Should I change the name of the value (use.me.conditionally) for each variable? Can I put them all in once or add them in a loop?
type: AnswerComment
comment on: http://stackoverflow.com/a/28426275
score: 0

http://stackoverflow.com/comment/44965859
type: QuestionComment
has text: Give them all the same class, and use `$(".classname")` to operate on all of them at once.
score: 2
comment on: http://stackoverflow.com/q/28307483
type: Comment

http://stackoverflow.com/q/28293399
downvote count: 2
answer count: 1
has comment: http://stackoverflow.com/comment/44940869
favorite count: 0
has comment: http://stackoverflow.com/comment/44940322
has comment: http://stackoverflow.com/comment/44940985
type: AnsweredQuestion
upvote count: 0
has body: I can not figure out where my error is with in this JSON file. i know there is one somewhere because when trying to parse it. i get the error Uncaught SyntaxError: Unexpected token J i was wondering if you guys could help me by taking a look and seeing if you see my problem i have been researching all night on this one and i am still un able to find the error. Someone from the community helped me find one but it is still not working i am parsing the JSON like so var obj = JSON.parse("JSON.json"); and here is the JSON { "Subbackground":{"direction": "to bottom", "Color1": " #a90329 0%", "Color2": "#8f0222 44%", "Color3": "#6d0019 100%"}, "ButtonBG": {"direction":"to bottom", "Color1": "#216332 5%", "Color2": "#5cbf2a 100%"}, "ButtonHov": {"direction":"to bottom", "Color1": "#5cbf2a 5%", "Color2": "#216332 100%"}, "textColor":"#ffffff", "BorderSubColor":"#a90329", "ButtonShadow":"#2f6627", "ButtonBShawdow":"#3dc21b", "BorderMain":"#18ab29", "Sub1":"steaknshake", "urlPath1":"http://www.steaknshake.com/", "Sub2":"steaknshake", "urlPath2":"http://www.steaknshake.com/", "Sub3":"steaknshake", "urlPath3":"http://www.steaknshake.com/", "Sub4":"steaknshake", "urlPath4":"http://www.steaknshake.com/", "Sub5":"steaknshake", "urlPath5":"http://www.steaknshake.com/", "Sub6":"steaknshake", "urlPath6":"http://www.steaknshake.com/", "Sub7":"steaknshake", "urlPath7":"http://www.steaknshake.com/", "Sub8":"steaknshake", "urlPath8":"http://www.steaknshake.com/", "Sub9":"steaknshake", "urlPath9":"http://www.steaknshake.com/", "Sub10":"steaknshake", "urlPath10":"http://www.steaknshake.com/", "Pizza":"steaknshake", "urlPathP":"http://www.steaknshake.com/", "Berger":"steaknshake", "urlPathB":"http://www.steaknshake.com/", "Lobster":"steaknshake", "urlPathL":"http://www.steaknshake.com/", "Chicken":"steaknshake", "urlPathCN":"http://www.steaknshake.com/", "Shrimp":"steaknshake", "urlPathSP":"http://www.steaknshake.com/", "BLT":"steaknshake", "urlPathB":"http://www.steaknshake.com/", "Salmon":…
tagged with: http://stackoverflow.com/tag/json
tagged with: file
has title: Trying to figure out why i cannot parse my JSON file
has comment: http://stackoverflow.com/comment/44940846
type: Question
tagged with: syntax-error
score: -2
has comment: http://stackoverflow.com/comment/44940930
has comment: http://stackoverflow.com/comment/44940780
tagged with: javascript
has comment: http://stackoverflow.com/comment/44940896
has comment: http://stackoverflow.com/comment/44940737
tagged with: ajax
has answer: http://stackoverflow.com/a/28293433
accepted answer: http://stackoverflow.com/a/28293433

http://stackoverflow.com/a/28324980
has body: Testing the code gives the following error: Uncaught TypeError: function parse() { [native code] } is not a constructor This is because of the "new" keyword. Removing this fixes your problem: // Define the date I want to check var targetDate = "2015-02-04T19:30:00Z"; // Parse the string into a date object var target = Date.parse(targetDate); // Compare the target date againt a new date object set to 18:00:00 if (target &lt; new Date().setHours(18, 0, 0)) { console.log("BEFORE"); } else { console.log("AFTER"); }
type: Answer
answers question: http://stackoverflow.com/q/28324831
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/44998729
downvote count: 0

http://stackoverflow.com/a/28368624
type: Answer
type: AcceptedAnswer
has body: your problem is that datatables don't recognize the "data" from the plain array format as a array, so there's nothing to list since its a object. but if u change the format to this: { "data": [ //&lt;= { "id":"1", "code":"PRFS00001", "name":"Test 1" } ] //&lt;= } then you will see the data appears again. i made a fiddle for you here: http://jsfiddle.net/9chxhmk2/ here's a reference to the recognized json format for datatables: http://datatables.net/release-datatables/examples/server_side/post.html
score: 0
has comment: http://stackoverflow.com/comment/45078584
answers question: http://stackoverflow.com/q/28365837
accepted answer of: http://stackoverflow.com/q/28365837

http://stackoverflow.com/q/28422657
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: isotope : replace all filter for a new category
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28422872
score: 0
answer count: 1
tagged with: jquery-isotope
tagged with: jquery
has body: i have too many images in my gallery and i want to replace the "all" filter for "principal" and show it on the load. I already tried to use container.isotope filter='.principal' but then nothing shows at the lading, only if i click on principal it shows the filtered results. /* Portfolio Sorting */ jQuery(document).ready(function () { (function ($) { var container = $('section.portfolio_container'); function getNumbColumns() { var winWidth = $(window).width(), columnNumb = 1; if (winWidth > 1500) { columnNumb = 6; } else if (winWidth > 1200) { columnNumb = 5; } else if (winWidth > 900) { columnNumb = 4; } else if (winWidth > 600) { columnNumb = 3; } else if (winWidth > 300) { columnNumb = 2; } return columnNumb; } function setColumnWidth() { var winWidth = $(window).width(), columnNumb = getNumbColumns(), postWidth = Math.floor(winWidth / columnNumb); container.find('.portfolio').each(function () { $(this).css( { width : postWidth + 'px' }); }); } $('.gallerySelector .gallerySelectorList a').click(function () { var selector = $(this).attr('data-filter'); $(this).parent().parent().find('> li.current').removeClass('current'); $(this).parent().addClass('current'); container.isotope( { filter : selector }); setTimeout(function () { reArrangeProjects(); }, 300); return false; }); function reArrangeProjects() { setColumnWidth(); container.isotope('reLayout'); } container.imagesLoaded(function () { setColumnWidth(); container.isotope( { itemSelector : 'article.portfolio', layoutMode : 'masonry', resizable : false } ); } ); $(window).on('debouncedresize', function () { reArrangeProjects(); } ); } )(jQuery); } ); /* DebouncedResize Function */ (function ($) { var $event = $.event, $special, resizeTimeout; $special = $event.special.debouncedresize = { setup : function () { $(this).on('resize', $special.handler); }, teardown : function () { $(this).off('resize', $special.handler); }, handler : function (event, execAsap) { var context = this, args = arguments, dispatch = functi…

http://stackoverflow.com/comment/44920488
comment on: http://stackoverflow.com/a/28281397
score: 0
type: AnswerComment
type: Comment
has text: Thanks for the answer but that's not what I'm looking for. I'll try to ilustrate: client(local network) --> server1 (internet) --> redirect to local network server --> if local network server is inaccessible (for client), redirect to other page.

http://stackoverflow.com/q/28407418
upvote count: 4
answer count: 3
has title: How to stop some javascript file from loading?
has answer: http://stackoverflow.com/a/28407639
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/61462478
has comment: http://stackoverflow.com/comment/45149096
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: Some third party javascript is included in my HTML page. It adds some sharing buttons to my webpage, and is called as like &lt;script src=http://something/something.js&gt;&lt;/script&gt; But sometimes I would like not to load this javascript at all. It could be solved on the server side, which would block, under some conditions, the above mentioned line from appearing at the webpage. But this is not possible to remove this tag from the HTML at all due to technical reasons, neither by server side (like PHP) nor by javascript (eg. by using document.write to put the tag there only when needed). I need to resolve this in javascript only, and I need to BLOCK the script tag if condition is met, meaning the tag always exists in the HTML. Is there any possibility to block the something.js URL mentioned above from loading? So I would, for example, execute some other javascript before or after it. I thought that it would be possible this way, but it doesn't seem to work: &lt;script&gt; (function(){ var scripts=document.getElementsByTagName('script'); for (var i=0; i&lt;scripts.length; i++) if (scripts[i].src &amp;&amp; scripts[i].src=='http://something...') scripts[i].parentNode.removeChild(scripts[i]); })(); &lt;/script&gt; &lt;script src=http://something/something.js&gt;&lt;/script&gt; This doesn't work because when the script is called, it cannot see another &lt;script&gt; tag below at that moment. If I put the script below, it detects the script with src attribute, but it is too late to remove the element since it has already executed (and pasted sharing button elements to the webpage). Is there any other way to stop loading of the third party script? Thank you EDIT: updated the fact that the third party javascript needs to be in the HTML every time due to some internal reasons (despite the fact I disagree with that, I can do nothing about it).
score: 4
has comment: http://stackoverflow.com/comment/45148995
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28407589
tagged with: javascript

http://stackoverflow.com/q/28365572
has answer: http://stackoverflow.com/a/28365715
type: Question
has body: Here is the iframe I'm using CSS as overflow: hidden, but still I'm getting scrolling.. .iframe_style{ border: 3px solid red; overflow: hidden; } JSFIDDLE Any help on this?
answer count: 3
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28365698
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28365897
has title: Iframe scrolling overflow hidden not working in css
type: UnansweredQuestion
tagged with: iframe

http://stackoverflow.com/q/28422111
answer count: 1
tagged with: javascript
has title: backbone collection data google map
score: 0
has answer: http://stackoverflow.com/a/28423047
tagged with: backbone.js
type: AnsweredQuestion
tagged with: underscore.js
has body: I am having trouble getting the data from the collection in the render() function for the map view. I have tried getting the data in multiple ways, but I cannot seem to get it correctly. This is where I am currently at https://jsfiddle.net/huntonas/pt17bygm/89/ APP = {}; APP.ArtPiece = Backbone.Model.extend({ defaults: { first_name: null, title: null, location: null, description: null, last_name: null, longitude: null, latitude: null, type: null, medium: null } }); APP.ArtPieces = Backbone.Collection.extend({ model: APP.ArtPiece, url: 'https://data.nashville.gov/resource/dqkw-tj5j.json' }); APP.artPieces = new APP.ArtPieces(); APP.Map = Backbone.Model.extend({ defaults: { center: new google.maps.LatLng(36.159480, -86.792112), zoom: 8, mapTypeId: google.maps.MapTypeId.ROADMAP } }); APP.map = new APP.Map(); APP.MapView = Backbone.View.extend({ id: 'map', initialize: function () { this.collection.fetch(); this.map = new google.maps.Map(this.el, this.model.attributes); this.render(); }, render: function () { this.collection.each(function (artPiece) { console.log(artPiece.toJSON()); var marker = new google.maps.Marker({ position: new google.maps.LatLng(artPiece.latitude, artPiece.longitude), title: artPiece.title }); return marker; }, this); $('#map').replaceWith(this.el); } }); APP.mapView = new APP.MapView({ model: APP.map, collection: APP.artPieces }); but it is not showing anything on the console.log. I assume that is because there is nothing in the collection, but I do not know where to call fetch() on the collection. Any help out there? Thanks.
accepted answer: http://stackoverflow.com/a/28423047
type: Question
tagged with: google-maps

http://stackoverflow.com/comment/45015753
score: 0
type: AnswerComment
has text: @DavidMartins Ah, sorry... You need to remove the inline `visibility: visible;`
type: Comment
comment on: http://stackoverflow.com/a/28308106

http://stackoverflow.com/comment/45328363
type: AnswerComment
has text: In your event handler (the anonymous function to ae) you need to prevent the default event behavior, which is to submit the form. So change the function to function(evt) and insert a evt.preventDefault() statement.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28400630

http://stackoverflow.com/comment/45114495
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28387605
has text: You may also be interested in [Javascript proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#Common_mistakes_and_misunderstanding) a proposed feature of ES6. This allows you to handle requests for any arbitrary property that does not exist.

http://stackoverflow.com/comment/44963693
type: QuestionComment
has text: I would usually do it like this: `echo ' '; `
comment on: http://stackoverflow.com/q/28306079
score: 0
type: Comment

http://stackoverflow.com/comment/45120873
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28391898
has text: 'onkeyup' is js event listener. You should use 'keyup'.

http://stackoverflow.com/a/28320150
type: Answer
score: 5
accepted answer of: http://stackoverflow.com/q/28320094
answers question: http://stackoverflow.com/q/28320094
has comment: http://stackoverflow.com/comment/44990367
has body: You can bind the current this context to the this.onChildStatusChanged function using bind. this.onChildStatusChanged.bind(this) The bind function will return a function equal to onChildStatusChanged but with the this context set to the one you specify. bind is an ES5 feature so if you're targeting systems &lt; ES5 you'll need to polyfil this function. Update You add the bind in your current event assignment: &lt;SubComponent onStatusChanged={this.onChildStatusChanged.bind(this)} /&gt;
type: AcceptedAnswer
downvote count: 0
upvote count: 5
has comment: http://stackoverflow.com/comment/44988742

http://stackoverflow.com/comment/45070107
type: AnswerComment
comment on: http://stackoverflow.com/a/28354688
has text: @Bergi not sure where else to find you - wanted to ask if you were aware at #promises and to invite you to lurk some. We have interesting discussions there from time to time and your feedback would be appreciated on things :)
type: Comment
score: 0

http://stackoverflow.com/a/28414307
answers question: http://stackoverflow.com/q/28413935
type: AcceptedAnswer
has body: Require the array.js file atleast once like require('pathToArraj.js');
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28413935

http://stackoverflow.com/comment/44965305
type: Comment
comment on: http://stackoverflow.com/a/28307203
score: 1
has text: This won't work on a dynamically added DOM element. You need to use .on instead of .click.
type: AnswerComment

http://stackoverflow.com/a/29744833
type: Answer
answers question: http://stackoverflow.com/q/28410644
upvote count: 3
score: 3
has body: 1.You can use following preprocessor to render html npm install karma-ng-html2js-preprocessor --save-dev Add following into karma.config.js: ngHtml2JsPreprocessor : { moduleName:'templates' }, 2.Use $compile service of angular and create html which you want to test and add it to dom. Then you can perform any test on that html var $body=$('$body'); afterEach( $body.empty(); );
downvote count: 0

http://stackoverflow.com/comment/44996398
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/28323799
has text: I see you edited your question to show an AJAX attempt. However, you're just posting to the page. You should instead post to an ASP.NET Web API (instead of using the code behind, your server side code will be in a Web API Controller).
type: Comment

http://stackoverflow.com/q/28302644
favorite count: 0
has comment: http://stackoverflow.com/comment/44956754
has comment: http://stackoverflow.com/comment/44957351
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
has title: Possibility to automatically parent & position elements?
has answer: http://stackoverflow.com/a/28302937
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28302937
answer count: 1
downvote count: 0
has body: Is it possible to make certain elements w/ certain #ids / .classes be automatically parented & positioned together with matching #ids and/or .classes? I'm trying to make it so that instead of making separate images for each individual button, which would double, maybe triple the data, time, and space consumed , or using position: absolute because of different resolutions of monitors screwing that up, I want to be able to parent a element with a , so that when it does pair it up it will position the text in the center of img, and fix the position of the p element to the img element. Here's my code, and my attempt at writing the JavaScript for the detection. /* var pair = function() { if(this.class === this.class) { this.style.text-align = "center"; this.style.position = "relative"; this.style.position = "absolute"; } } pair(img, para); */ .nav { } .navlinks { } .navlinks a { font-family: "Lietz", arial; text-decoration: none; font-size: 110%; color: #FFA500; text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; } .news { } .donate { } .content { } .footer { } .footlinks { } Link 1 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut semper auctor nunc, ac rhoncus ligula. Nunc vel magna dignissim, finibus augue in, ultrices urna. In auctor id sapien sit amet facilisis. Nulla facilisi. Vivamus semper erat at nisi euismod facilisis. Nunc pharetra vel risus scelerisque posuere. Suspendisse malesuada magna ut faucibus consectetur. Aenean hendrerit fringilla lorem dictum tincidunt. Etiam libero tortor, dignissim ac consequat ut, ultricies in odio. Donec vel dui non metus lacinia vehicula ut sagittis orci. Pellentesque mauris mauris, dapibus ac sagittis a, volutpat id tortor. Donec tempor ante lobortis massa feugiat, sit amet molestie magna vestibulum. Sed hendrerit metus suscipit feugiat faucibus. Sed eget justo ligula. Morbi scelerisque sagittis sem, ut semper quam convallis lacinia. Vestibulum ac suscipit ex. Vivamus pharetra tellus ac t…

http://stackoverflow.com/comment/45093200
has text: It's not necessarily "incorrect." It's certainly a bit confusing on first glance if you're not used to it.
comment on: http://stackoverflow.com/a/28376489
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28324809
has title: Can a easeljs hitarea be set using image data?
type: Question
has answer: http://stackoverflow.com/a/28333494
tagged with: javascript
tagged with: easeljs
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/28333494
has body: I'd like to be able to set set the hit area of my Display objects using image data instead of a Shape object. However setting the hitarea property of my objects doesn't seem to be working. Here's an example of what I'm attempting. Say we have this sprite sheet for a button: example of sprite sheet button with 3 frames. frame 3 is a hitmask (Sorry my rep. isn't high enough to just post the image) I have a function to get my hitmask frame and make it into a bitmap this isn't working. /* Not the exact code, syntax may be a bit off */ var myButton = new createjs.Container() // assume this is an object with mouse events var myExtractedFrame = ExtractFrame(myButton._sprite, 2) // a createjs Bitmap of frame the hitmask frame myButton.hitArea = myExtractedFrame // will this work??
tagged with: http://stackoverflow.com/tag/png
type: AnsweredQuestion

http://stackoverflow.com/q/28370225
has comment: http://stackoverflow.com/comment/45082403
favorite count: 0
has comment: http://stackoverflow.com/comment/45081440
has comment: http://stackoverflow.com/comment/45082270
has body: Given two sortables setup with the following: one two three Add task four five six Add task $('task-list').sortable({ connect: 'task-list' }); By default the drop-target when dragging items between lists is the .task-list. When the lists are empty however the drop target is really small. How can I specify .task-list-wrapper as the drop target? (I can't just make the .task-list element taller because the button sticks to the bottom of the list, which in the case of an empty list is at the top). Working example: http://jsbin.com/hipetawemu/1/edit
has comment: http://stackoverflow.com/comment/45081685
has comment: http://stackoverflow.com/comment/45081402
has comment: http://stackoverflow.com/comment/45082373
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45082388
tagged with: jquery-ui-sortable
downvote count: 0
has title: Specify drop target for connected jquery-ui sortables
tagged with: jquery-ui
score: 1
has comment: http://stackoverflow.com/comment/45081121
has comment: http://stackoverflow.com/comment/45081209
type: Question
upvote count: 1
has comment: http://stackoverflow.com/comment/45081185
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/28331807
has comment: http://stackoverflow.com/comment/46027603
has comment: http://stackoverflow.com/comment/46197583
has body: Coffee script 1.9.0 doesn't play well with Windows. On my Windows 7 machine, using version 1.8.0 solved this problem. Add to Gemfile gem 'coffee-script-source', '1.8.0' then, run bundle update coffee-script-source and restart the server (if needed)
has comment: http://stackoverflow.com/comment/46197311
downvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/28312460
upvote count: 106
has comment: http://stackoverflow.com/comment/72867781
has comment: http://stackoverflow.com/comment/54584325
score: 105
has comment: http://stackoverflow.com/comment/65242070

http://stackoverflow.com/q/28393356
answer count: 1
tagged with: javascript
type: UnansweredQuestion
has title: Making a drop-down menu keyboard and mouse browsable
has body: I am working on a project for a client that requires a custom drop-down menu, accessible by clicking to open it, or using the keyboard to tab across to it. Currently, my solution works almost perfectly, but there is one problem: the first time you click the drop-down menu, it flashes open and then closes again. I'm sure there's a simple glitch with my JavaScript and jQuery here! The required functionality is this: The user must be able to click to open a drop-down menu. (DONE, but with problems) The user must be able to click another menu, and have the previous one close and the new one open. (DONE) The user must be able to click anywhere else on the page and have the open menu close. (DONE) The user must be able to tab along the menu bar, highlighting each link, and opening the menu when it is tabbed to. (DONE) The tabbing must then tab down the entire menu, before leaving onto the next menu or link, closing the previous menu. (DONE) As I say here, I have it almost entirely working, but the keyboard focus recognition also detects mouse focusing, meaning that when I click, it triggers a keyboard focus instantly after the mouse one, closing it again. Or so I think. Please help! JavaScript Code $(document).ready(function() { function toggle(select) { closeAll(select); if(select.hasClass("expanded")) { select.removeClass("expanded"); } else { select.addClass("expanded"); } } function closeAll(select) { var close = $(document).find("#navigation li.select.expanded"); if(select != null) { close = close.not(select); } close.removeClass("expanded") } $("#navigation > ul > li.select > a").click(function(event) { event.preventDefault(); toggle($(this).parent()); }); $(document).mouseup(function(event) { var select = $("#navigation > ul > li.select.expanded"); if(!select.is(event.target) && select.has(event.target).length === 0) { closeAll(); } }); $(document).on("focus", "#navigation > ul > li > a", function () { closeAll(); if($(this).parent().hasClass("select")) { toggle($(…
tagged with: jquery-events
has answer: http://stackoverflow.com/a/28393770
tagged with: drop-down-menu
tagged with: jquery
type: Question
tagged with: css
score: 0

http://stackoverflow.com/comment/45070996
type: AnswerComment
comment on: http://stackoverflow.com/a/28364674
type: Comment
has text: You can redirect request after call SetSession on server-side.
score: 0

http://stackoverflow.com/q/28378740
tagged with: http://stackoverflow.com/tag/html
duplicate of: http://stackoverflow.com/q/28379775
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45097293
linked to: http://stackoverflow.com/q/28379775
has title: Drawing cloud on HTML5
has body: I am trying to create a symmetrical cloud as part of a landscape on the canvas element using arc but I am not getting beyond the first arc. I have researched answers on the site but nothing came up specifically for drawing a cloud. (I got as far as speech bubble instead).Can anyone help ?
type: Question
tagged with: canvas
tagged with: javascript
has comment: http://stackoverflow.com/comment/45107549
has comment: http://stackoverflow.com/comment/45098974
score: 0

http://stackoverflow.com/q/28283439
type: UnansweredQuestion
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
type: Question
has body: I am currently using w3widgets' responsive calendar plugin. I have been able to load events on load using AJAX to fetch the dates and calling the plugin and passing the event dates as such //AJAX call to fetch and store event dates in variable eventList and then... $(".responsive-calendar").responsiveCalendar({ events: eventList }); However, I have a button to fetch more events. I am able to fetch the new dates and store in a variable as above but unable to populate them on the calendar. Any ideas on how 'm supposed to achieve this?
has answer: http://stackoverflow.com/a/28283581
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/42691183
upvote count: 1
tagged with: calendar
has title: Load events dynamically on w3widgets responsive calendar
downvote count: 1
has comment: http://stackoverflow.com/comment/72381999

http://stackoverflow.com/a/28321148
has body: The response you are getting is in json format. You have to parse it first. Try with - var response = jQuery.parseJSON(data[0]); //parse json data console.log(response.request_id);
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44990626
accepted answer of: http://stackoverflow.com/q/28321021
type: Answer
answers question: http://stackoverflow.com/q/28321021
upvote count: 2
downvote count: 2

http://stackoverflow.com/q/28314069
has title: d3 donut chart with labels
score: 2
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/28314683
tagged with: css
has body: I am new to d3.js any one help me ,I want donut revenue chart with total value at centre with two label separate outside circle.but ,I cannot add one more label outside the circle and middle total value. Here is my code, &lt;script src="http://d3js.org/d3.v3.min.js"&gt;&lt;/script&gt; &lt;div id="pie-chart"&gt;&lt;/div&gt; &lt;script&gt; var div = d3.select("body").append("div").attr("class", "toolTip"); var w = 650; var h = 400; var r = 100; var ir = 75; var textOffset = 24; var tweenDuration = 1050; //OBJECTS TO BE POPULATED WITH DATA LATER var lines, valueLabels, nameLabels; var pieData = []; var oldPieData = []; var filteredPieData = []; //D3 helper function to populate pie slice parameters from array data var donut = d3.layout.pie().value(function(d){ return d.itemValue; }); //D3 helper function to create colors from an ordinal scale var color = d3.scale.category20c(); //D3 helper function to draw arcs, populates parameter "d" in path object var arc = d3.svg.arc() .startAngle(function(d){ return d.startAngle; }) .endAngle(function(d){ return d.endAngle; }) .innerRadius(ir) .outerRadius(r); /////////////////////////////////////////////////////////// // GENERATE FAKE DATA ///////////////////////////////////// /////////////////////////////////////////////////////////// var data; var dataStructure = [ { "data":[ { "itemLabel":"Suv", "itemValue":7165.0 }, { "itemLabel":"Sedans", "itemValue":2430.0 }, { "itemLabel":"Hatchback", "itemValue":1998.0 }, { "itemLabel":"VAN", "itemValue": 898.0 }, ], "label":"2007" }, ]; /////////////////////////////////////////////////////////// // CREATE VIS &amp; GROUPS //////////////////////////////////// /////////////////////////////////////////////////////////// var vis = d3.select("#pie-chart").append("svg:svg") .attr("width", w) .attr("height", h); //GROUP FOR ARCS/PATHS var arc_group = vis.append("svg:g") .attr("class", "arc") .attr("transform", "translate(" + (w/2) + "," + (h/2) + ")"); //GROUP FOR LABELS var label_group = vis.ap…
tagged with: d3.js
upvote count: 3
type: UnansweredQuestion
downvote count: 1
type: Question

http://stackoverflow.com/comment/45651815
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28375045
has text: OK I think I am getting closer. I don't have rect's in rect. and I think I am using D3's nested selections. Still not seeing my "bar"'s getting drawn. http://jsfiddle.net/5kLeag9m/4/

http://stackoverflow.com/a/28328118
downvote count: 0
has comment: http://stackoverflow.com/comment/45005133
type: Answer
has comment: http://stackoverflow.com/comment/45011353
has comment: http://stackoverflow.com/comment/45011660
has comment: http://stackoverflow.com/comment/45005212
has comment: http://stackoverflow.com/comment/45004497
has comment: http://stackoverflow.com/comment/45011704
upvote count: 1
has body: Make a method, call it when page is opened and on button click. Script: $(document).ready(function() { function refresh(){ $("#loading").show(); $.getJSON("listapps.php",function(data) { var div_data = ''; $.each(data, function(i,data) { data.title = data.title.replace(/[^a-z0-9\s]/gi, '').replace(/[_\s]/g, '-').replace(/-+/g,'-'); if (data.title =='' | data.title =='-') { data.title = 'App'; } div_data += "&lt;div &gt;&lt;a href='"+data.title+"-"+data.appID+"'&gt;&lt;img src='"+data.icon+"'&gt;&lt;/img&gt;&lt;/a&gt;&lt;/div&gt;"; }); $("#iconsfree").html(div_data); $("#loading").hide(); }); } // call the method on button click: $(document).on('click', '#button', function(e){ e.preventDefault(); refresh(); }); // call the method when page is opened: refresh(); });
accepted answer of: http://stackoverflow.com/q/28327932
has comment: http://stackoverflow.com/comment/45011771
answers question: http://stackoverflow.com/q/28327932
score: 1
has comment: http://stackoverflow.com/comment/45004573
type: AcceptedAnswer

http://stackoverflow.com/comment/45189789
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28427714
type: Comment
has text: If you click the button _before_ the image is loaded you'll get an empty canvas. So you should maybe also come up with a way of disabling that button before the image loads, just to be safe.

http://stackoverflow.com/a/42377458
downvote count: 0
answers question: http://stackoverflow.com/q/28314586
has comment: http://stackoverflow.com/comment/77178218
type: Answer
has body: Go to Internet Options -> Advanced. Uncheck Disable script debugging, Disable script debugging (Others)
score: 17
has comment: http://stackoverflow.com/comment/106398840
has comment: http://stackoverflow.com/comment/93536290
upvote count: 17
has comment: http://stackoverflow.com/comment/93522881

http://stackoverflow.com/comment/44975911
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28312757
has text: I will bear the filter vs find comment in mind when I get the syntax working. Re title, I do want the tootips showing in this case.
score: 0

http://stackoverflow.com/a/28345159
type: Answer
answers question: http://stackoverflow.com/q/28344945
score: 0
has body: Try moving the alert() inside the success callback. function checkIfIsInDB(o, n) { var target_url = window.location.pathname + 'user/check_if_username_exist', valid = ''; $.ajax({ type: "POST", dataType: "json", url: target_url, data: { username: o.val() }, success: function (json) { if (json['check'] === false) { o.addClass("ui-state-error"); updateTips(n + " has been alredy taken."); } if (json['check'] === true) { valid = true; } alert(valid); //return(valid); need for returning true or false } }); }

http://stackoverflow.com/comment/45137863
has text: Shouldn't this be `style="display:block"` ?
comment on: http://stackoverflow.com/a/28401088
type: AnswerComment
score: 0
type: Comment

titanium
type: Tag
tags question: http://stackoverflow.com/q/28422362
tag name: titanium
tags question: http://stackoverflow.com/q/28433343
tags question: http://stackoverflow.com/q/28306519
tags question: http://stackoverflow.com/q/28399311

http://stackoverflow.com/a/28377616
accepted answer of: http://stackoverflow.com/q/28375520
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/28375520
type: AcceptedAnswer
downvote count: 0
has body: function createPathContent(svgID, popupText, pathDirections) { var path = document.createElementNS("http://www.w3.org/2000/svg","path"); path.setAttribute("d",pathDirections); var popup = document.createElementNS("http://www.w3.org/2000/svg","title"); // popup.textContent = popupText; // &lt;-- LINE TO FOCUS ON popup.textContent=" " //popup.firstChild.nodeValue=popupText popup.firstChild.nodeValue='Edgar' Node.prototype.appendChild.call(popup, document.createElement("br")) Node.prototype.appendChild.call(popup, document.createTextNode('Allen Poe.')) path.appendChild(popup); document.getElementById(svgID).appendChild(path); } It always makes my head spin when I try to figure out if textContent is officially supposed to interpret \n (\x0A \u000A ...) as anything except whitespace. textContent: http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#Node3-textContent Interface Text: http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-1312295772 Interface CharacterData: http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-FF21A306 Anyway, I made an exercise with some primitives, above. I hope you'll find this as instructive as I did. It produces the tooltip with "Edgar" on one line, and "Allen Poe." on the next. function createPathContent(svgID, popupText, pathDirections) { var path = document.createElementNS("http://www.w3.org/2000/svg","path"); path.setAttribute("d",pathDirections); var popup = document.createElementNS("http://www.w3.org/2000/svg","title"); //popup.textContent = popupText; // &lt;-- LINE TO FOCUS ON popupText= popupText.split('\n') // note: firefox needs "\r" passed in "\r\n". while (true) { popup.appendChild(document.createTextNode(popupText.shift())) // note: "" here is ok, will be appended as empty #text node if (popupText.length) popup.appendChild(document.createElement("br")) else break } path.appendChild(popup); document.getElementById(svgID).appendChild(path); } Here's a working patch within the function itself. It makes use of Jonathan'…
has comment: http://stackoverflow.com/comment/45216258
type: Answer

http://stackoverflow.com/q/28410286
type: Question
has answer: http://stackoverflow.com/a/28410377
has comment: http://stackoverflow.com/comment/45154060
has title: Multiple callbacks after jquery click event
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/28410377
tagged with: javascript
tagged with: jquery
has body: I need to do 2 things on click. The first happens straight away, then the second thing happens after the first thing has finished. I'm trying to chain functions as callbacks, but this doesn't seem to be working. $(document).ready(function(){ $('button').click(function(){ // first thing console.log('click'); }, function(){ // second thing console.log('callback'); }); }); That code only logs the second message. I need it to do the first, then the second. What's the correct way of doing this?
has comment: http://stackoverflow.com/comment/45154046
has comment: http://stackoverflow.com/comment/45154022
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28410401
has answer: http://stackoverflow.com/a/28410401

http://stackoverflow.com/comment/45123576
type: Comment
type: QuestionComment
has text: .find("p[data-id='" + contact_id + "']")) should be .find("[data-id='" + contact_id + "']")) . i can't see ant p tag inside "#modalBodyContact"
score: 0
comment on: http://stackoverflow.com/q/28393357

http://stackoverflow.com/comment/44922310
comment on: http://stackoverflow.com/q/28283769
score: 0
type: Comment
has text: narrow it down with only mongo shell commands first. note that mongo will find an element within an array with no special treatment. ie. find({tags: "one"}). if you're trying to find a complete match then use {$all : []} as you have. not sure what 'text' means. whats the expected document
type: QuestionComment

http://stackoverflow.com/comment/45117233
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28389912
has text: use sqlite or a server-based one, which can be about anything.

http://stackoverflow.com/comment/45031121
score: 0
type: AnswerComment
type: Comment
has text: Which are the differences between LocalFileSystem and window?
comment on: http://stackoverflow.com/a/28343288

http://stackoverflow.com/comment/45185832
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28412604
has text: @KimGysen, thanks for your comment. that really helped. i looked that up and this article [link](http://spin.atomicobject.com/2014/08/21/backbone-event-best-practices/) has also a good explanation.

http://stackoverflow.com/a/28327861
has body: Ah, I figured it out. Here's how I solved it: 1) Create resize template In my transloadit account, I created this template. Most important is the resize_optimal step. This step contains width and height values of "10", but those values will be overwritten before the step is executed. { "steps": { "thumb": { "use": ":original", "robot": "/image/resize", "width": 150, "height": 150, "resize_strategy": "pad", "background": "#ffffff" }, "resize_optimal": { "use": ":original", "robot": "/image/resize", "width": 10, "height": 10, "resize_strategy": "pad", "background": "#ffffff" }, "store": { "use": [ ":original", "resize_optimal", "thumb" ], "robot": "/s3/store", "key": "...", "secret": "...", "bucket": "...", "path": "staging/${file.id}.${file.ext}" } } } 2) Add width/height to data attributes I modified both &lt;input type="file"&gt; tags to include the width and height that should be used for resizing the image as data attributes, like so: &lt;input type="file" name="primary_image" id="fld_primary_image" data-width="300" data-height="150" /&gt; &lt;input type="file" name="secondary_image" id="fld_secondary_image" data-width="200" data-height="200" /&gt; 3) Add global resize_options array I added the following global array to my javascript: var resize_options = { width: 200, height: 200 }; 4) Override template width/height In my transloadit binding, I overrode the resize_optimal width and height using the values of the resize_options array: Before: params: { auth: { key: "..." }, template_id: '...' }, After: params: { auth: { key: "..." }, template_id: '...', steps: { resize_optimal: { width: resize_options.width, height: resize_options.height } } }, 5) Populate resize_options In my javascript, I was already running code whenever the file input changed. This is a great place to add code for keeping the resize_options array populated with the correct values: Old: $('#my-form').on('change', 'input[type="file"]', function() { var form = $(this).closest('form'); bindTransl…
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28313308
score: 1
downvote count: 0

http://stackoverflow.com/a/28392337
type: Answer
accepted answer of: http://stackoverflow.com/q/28392266
answers question: http://stackoverflow.com/q/28392266
type: AcceptedAnswer
has body: You can just change the line to the following: tomorrow.setHours(tomorrow.getHours()+1);
score: 0

http://stackoverflow.com/q/28292580
score: 0
tagged with: codeigniter
has comment: http://stackoverflow.com/comment/44938247
answer count: 0
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44938260
tagged with: facebook-comments
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44938084
type: Question
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/44938179
has title: facebook comment box display issue in website
has body: I need to display Facebook comment option in website, sometime randomly display only in google chrome.But I need to display both Mozilla and Google Chrome browsers. I use this script: (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/all.js#xfbml=1&amp;appId="+&lt;?php echo $fb_app_id; ?&gt;; fjs.parentNode.insertBefore(js, fjs); document.getElementById(id).innerHTML=''; arser=document.getElementById(id); //parser.innerHTML='&lt;div style="padding-left:5px; min-height:500px" class="fb-comments" data-href="'+newUrl+'" data-num-posts="20" data-width="380"&gt;&lt;/div&gt;'; FB.XFBML.parse(parser); } (document, 'script', 'facebook-jssdk')); &lt;/script&gt;&lt;/div&gt;

http://stackoverflow.com/q/28386369
has body: Working on a portfolio navigation made of pictures and hover-captions over them. The following code works perfectly on desktop (both figcaption and h3 appear on hover), but when it comes to mobile, only figcaption is visible. HTML: Text CSS: figure { margin: 0; padding: 0; height: 100%; position: relative; display: block; overflow: hidden; } figcaption { height: 100%; width: 100%; opacity:0; position:absolute; background: rgba(0,0,0,.15); color: #fff; } figcaption h3, figcaption h3 a { font-family: 'Raleway', sans-serif; color:white; font-weight: 400; top: 80%; text-align: center; position:relative; transform: translateY(-50%); font-size: 36px; } figcaption h3 a:hover, figcaption h3 a:focus, figcaption h3 a:active { font-family: 'Raleway', sans-serif; color:white; font-weight: 400; top: 80%; text-align: center; position:relative; transform: translateY(-50%); font-size: 36px; text-decoration:none; border-bottom: 2px solid white; padding-bottom: 3px; } jQuery: $(document).ready(function($){ $('figcaption').hover( function () { $(this).animate({opacity:'1'}); }, function () { $(this).animate({opacity:'0'}); } ); });
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
type: UnansweredQuestion
tagged with: css
answer count: 0
score: 1
upvote count: 1
type: Question
tagged with: mobile
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Link inside doesn't show on mobile

http://stackoverflow.com/q/28332032
tagged with: javascript
has comment: http://stackoverflow.com/comment/45012815
score: 4
has comment: http://stackoverflow.com/comment/45012006
has answer: http://stackoverflow.com/a/28334315
has title: Dynamically load JS/CSS per template with Meteor
answer count: 1
tagged with: meteor
has comment: http://stackoverflow.com/comment/45012780
favorite count: 0
has body: I understand a couple questions (i.e. this) of this nature have already been posted, however no solid solution has been found. From what it seems, Meteor currently lacks of the ability to dynamically load/render different UI JavaScript (i.e. uilang) or CSS files per template. In my application, I have templates that require specific JS libraries and CSS as oppose to other templates. For example: user.html requires -&gt; uilang.js, user_ui_code.js, userstyle.css admin.html requires -&gt; uilang.js, admin_ui_code.js, admin_style.css I would need each js/css file to render/load depending on which route gets requested (i.e. example.com/user or example.com/admin), for things like different background-colors, transitions, etc. Meteor documentation states: Files in /public are served to the client as-is. Use this to store assets such as images. For example, if you have an image located at /public/background.png, you can include it in your HTML with or in your CSS with background-image: url(/background.png). Note that /public is not part of the image URL. So you would think that putting all your js/css/images assets in public and calling the needed files statically in head would solve the problem. Instead, it seems that the JS (CSS as well) files get concatenated and it all runs at the same time regardless of which route you are on, thus overlapping code. I'm not sure if I am missing something blatantly obvious or is this an actual issue in Meteor? Thanks for any help.
tagged with: http://stackoverflow.com/tag/html
upvote count: 4
tagged with: css
type: AnsweredQuestion
downvote count: 0
linked to: http://stackoverflow.com/q/27263232
type: Question
accepted answer: http://stackoverflow.com/a/28334315

http://stackoverflow.com/comment/45099180
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28372574
has text: @mesosteros It would be there as long as its javascript, so long as you view it under a modern web browser. Meteor doesn't add it, the ES6 pre-final javascript spec adds it. It's only visible under a debugger. If you call it even outside a debugger using `xxx.__proto__` you will be able to see its properties.
type: Comment

http://stackoverflow.com/a/28377038
score: 0
answers question: http://stackoverflow.com/q/28326998
type: Answer
has body: Finally I found the real problem. I was in a jquery document ready which is a closure. I did not knew what closures were before today. Thanks all for your help

http://stackoverflow.com/comment/44981829
score: 0
type: Comment
type: QuestionComment
has text: Do you try painting about one minute without release mouse ?
comment on: http://stackoverflow.com/q/28304684

http://stackoverflow.com/a/28413877
answers question: http://stackoverflow.com/q/28413790
has body: You should call .resolve, like this function doSomething(){ var chain = $.Deferred(); console.log("middle"); chain.then(function(){ console.log("end"); }); chain.resolve(); }
type: Answer
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/45161145
has comment: http://stackoverflow.com/comment/45161287
downvote count: 0
has comment: http://stackoverflow.com/comment/45161458
has comment: http://stackoverflow.com/comment/45161412

http://stackoverflow.com/q/28292024
has answer: http://stackoverflow.com/a/28292150
has comment: http://stackoverflow.com/comment/44937269
tagged with: javascript
has comment: http://stackoverflow.com/comment/44937238
has answer: http://stackoverflow.com/a/28292176
has body: my question is simple, suppose I have 10 divs: And I want that when I click 'foo' just 2 of the divs change their background to red. How can I achieve this with something like Math.random from js?
linked to: http://stackoverflow.com/q/11186631
score: 0
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28292150
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 4
possible better answer: http://stackoverflow.com/a/28292152
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44937293
has answer: http://stackoverflow.com/a/28292152
has comment: http://stackoverflow.com/comment/44937257
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/28292092
has title: Select 2 random divs with the same class jQuery
type: Question

http://stackoverflow.com/q/28417252
has body: The Pinterest mobile site changes my browser toolbar and my nexus 5 toolbar to red. How did do it? especially the device's styles? I searched and only found sources for changing scrollbar colors, which I'm not interested in.
answer count: 1
downvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: android
tagged with: css
upvote count: 0
has title: changing device and browser toolbar colors
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45167760
score: -1
type: Question
has answer: http://stackoverflow.com/a/28417457
tagged with: mobile

http://stackoverflow.com/a/28285815
type: AcceptedAnswer
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28284630
type: Answer
answers question: http://stackoverflow.com/q/28284630
has body: No need to put click handlers on the img tags. Moreover this doesn't work, because they are not bound to functions in the paper-lightbox element. What you want is event.path[0].getAttribute("data-fullimage") But this only works if your light DOM elements consist of exactly one element. If your light DOM elements are more complex, but it should be possible to click them anywhere, use this expression instead event.path[[].indexOf.call(event.path, sender) - 1].getAttribute("data-fullimage")
score: 2
downvote count: 0

http://stackoverflow.com/comment/45099445
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28380089
type: Comment
has text: you must define it global after the script tag

http://stackoverflow.com/comment/45084663
comment on: http://stackoverflow.com/q/28372084
has text: You don't really need javascript, all menus can be build in pure css nowadays. You can also add animations, which will work in modern browsers. First result in google http://purecss.io/menus/
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45167263
score: 0
comment on: http://stackoverflow.com/q/28369572
type: Comment
type: QuestionComment
has text: @bluestrattos Does it have to be divs, or are you OK with a table based solution? Edit: Nevermind - I see you've found your answer.

http://stackoverflow.com/q/28321547
linked to: http://stackoverflow.com/q/6967081
tagged with: slidetoggle
score: 1
type: Question
tagged with: javascript
tagged with: jquery
has title: slideToggle() multiple elements show/hide
downvote count: 0
answer count: 1
duplicate of: http://stackoverflow.com/q/6967081
has body: When an element opens, all others open elements close . I have this code: jQuery(document).ready(function() { jQuery('#servico1').click(function() { jQuery('.descricao2').hide("slow"); jQuery('.descricao3').hide("slow"); jQuery('.descricao4').hide("slow"); jQuery('.descricao1').slideToggle("slow"); }); jQuery('#servico2').click(function() { jQuery('.descricao1').hide("slow"); jQuery('.descricao3').hide("slow"); jQuery('.descricao4').hide("slow"); jQuery('.descricao2').slideToggle("slow"); }); jQuery('#servico3').click(function() { jQuery('.descricao2').slideToggle("slow"); }); jQuery('#servico4').click(function() { jQuery('.descricao3').slideToggle("slow"); }); }); I know it's bad code and very repetitive. I want to know how can I create a simpler and cleaner code. FIDDLE
has answer: http://stackoverflow.com/a/28321676
accepted answer: http://stackoverflow.com/a/28321676
favorite count: 0
has comment: http://stackoverflow.com/comment/44991474
upvote count: 1
type: AnsweredQuestion

http://stackoverflow.com/q/28401762
accepted answer: http://stackoverflow.com/a/28401803
has body: Here's what I'm trying to do...check if a specific div is empty. If it's empty immediately append a loading spinner (.gif)...then wait 3 seconds and append a button that let's you report a problem because the actual content for the div didn't load: if( $('#this_div').is(':empty') ) { $('#this_div').append( ' ' ); $('#this_div').delay(3000).append( ' Click to Report ' ); } I know that the empty part is working because the loading gif shows up fine, so my if statement is okay. However, the button appears immediately after the loading gif instead of waiting 3 seconds. What am I doing wrong here?
answer count: 1
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has title: If div is empty, delay before showing button...not working
has answer: http://stackoverflow.com/a/28401803
score: 0
type: Question
type: AnsweredQuestion
tagged with: javascript

http://stackoverflow.com/a/28307281
has comment: http://stackoverflow.com/comment/44965444
accepted answer of: http://stackoverflow.com/q/28307222
type: AcceptedAnswer
downvote count: 0
has body: You can add loading class while content is being loaded: var d = $('.refresh_div'); d.live("click",function(){ d.addClass('loading'); $('.content').load('present.php', function () { d.removeClass('loading'); }); }); Then just apply needed styles in CSS (e.g. icon, animation, etc).
type: Answer
score: 2
answers question: http://stackoverflow.com/q/28307222
upvote count: 2

infinite-scroll
tag name: infinite-scroll
tags question: http://stackoverflow.com/q/28419123
tags question: http://stackoverflow.com/q/28334409
type: Tag
tags question: http://stackoverflow.com/q/28334788

http://stackoverflow.com/a/28432226
downvote count: 0
has comment: http://stackoverflow.com/comment/80829605
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/28413474
upvote count: 2
answers question: http://stackoverflow.com/q/28413474
has comment: http://stackoverflow.com/comment/80866852
has body: This is a just-for-fun answer. Not really an answer because it really feels like a dirty little hack, and also I am not sure to understand what exactly you are trying to highlight (is it all streets or the results of a Directions request &mdash; this is unclear from your question). But basically, I added 2 maps. The first one is the base map and the other one is positioned on top of the first one, with a border radius, and styles applied. I then synchronize both maps so that they both move relatively (when panning / zooming). var myLatlng = new google.maps.LatLng(51.51, -0.12); var styles = [{ "featureType": "road", "elementType": "geometry.fill", "stylers": [{ "color": "#ff3380" }] }]; var mapOptions = { zoom: 12, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; var roundedMapOptions = { zoom: 12, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP, disableDefaultUI: true, scrollwheel: false, styles: styles }; var map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions); var roundedMap = new google.maps.Map(document.getElementById("map-rounded"), roundedMapOptions); google.maps.event.addListener(map, 'drag', function () { roundedMap.setCenter(map.getCenter()); }); google.maps.event.addListener(roundedMap, 'drag', function () { map.setCenter(roundedMap.getCenter()); }); google.maps.event.addListener(map, 'idle', function () { roundedMap.setCenter(map.getCenter()); }); google.maps.event.addListener(map, 'zoom_changed', function () { roundedMap.setZoom(map.getZoom()); }); Note on the use of the idle event listener: If you are dragging the map very quickly, sometimes the sync is kind of lost. So with the idle event listener, the maps are re-synced after a drag. Note that I added the below CSS rule to hide the copyright on the rounded map: #map-rounded .gm-style-cc { display: none; } This is clearly against Google Maps TOS but since it is still there on the base map, I would think this is a fair or acceptable misuse of the API :) …
type: AcceptedAnswer

http://stackoverflow.com/comment/45068929
type: Comment
type: QuestionComment
has text: why is your setinterval inside `mouseover`?? this code will create new intervals everytime you hover on `.product`
comment on: http://stackoverflow.com/q/28363429
score: 0

http://stackoverflow.com/a/28425770
score: 2
has body: I think you need to pass "q.id" instead of name={{q.id}} provided $scope.q.id is defined in your corresponding controller.
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/28425711
type: Answer

http://stackoverflow.com/q/28298585
tagged with: javascript
score: 0
has body: I am currently trying to run a few bits of JS within my webView to simply fill out a few text fields on a 3rd party site. This has so far been successful on other sites but I seem to be getting issues with a specific url. let loadFirstNameJS = "var inputFields = document.getElementById('Field1'); inputFields.value = '\(firstName)';" self.webView.stringByEvaluatingJavaScriptFromString(loadFirstNameJS) Executing the JS to input a string value (firstName) has previously been simple. However I can't seem to access the element 'Field1' as it looks as though it doesn't exist? (returning a null value) even though I am able to view and edit within a browser. It was my understanding that a UIWebView doesn't excuse any JS until the page has fully loaded so assume it can't be a problem of trying to access the element before it is created. Here is the html of the specific Field1 I am trying to edit. &lt;li id="fo134li1" class="notranslate leftHalf "&gt; &lt;label class="desc" id="title1" for="Field1"&gt; First Name &lt;span id="req_1" class="req"&gt;*&lt;/span&gt; &lt;/label&gt; &lt;div&gt; &lt;input id="Field1" name="Field1" type="text" class="field text medium" value="" maxlength="255" tabindex="2" onkeyup="handleInput(this); " onchange="handleInput(this);" required=""&gt; &lt;/div&gt; &lt;/li&gt; This is one of the last things that I need to work out before my project is completed, so any assistance as to why this isn't working would be greatly appreciated! Thanks!
tagged with: getelementbyid
answer count: 1
tagged with: uiwebview
accepted answer: http://stackoverflow.com/a/28300031
tagged with: swift
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28300031
has title: UIWebView unable to run JavaScript as document.getElementById returns null
type: Question
tagged with: ios

http://stackoverflow.com/comment/44983464
has text: Check your link path before unlink. May be you link was relative not absolute
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28317219

http://stackoverflow.com/comment/45154207
comment on: http://stackoverflow.com/q/28400602
score: 0
type: Comment
type: QuestionComment
has text: the css file was missing, thanks a lot for that plunker, however the console still showing me that error, i have no idea what it is

http://stackoverflow.com/comment/44919463
type: Comment
type: QuestionComment
has text: @Stephane You'll want to take a look at [child processes](http://nodejs.org/api/child_process.html). You can start a child process, run your script, and get status updates from it.
score: 0
comment on: http://stackoverflow.com/q/28280822

http://stackoverflow.com/q/28400843
tagged with: http://stackoverflow.com/tag/q
has answer: http://stackoverflow.com/a/28401209
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/45137692
has comment: http://stackoverflow.com/comment/45137383
has comment: http://stackoverflow.com/comment/45137398
favorite count: 0
has comment: http://stackoverflow.com/comment/45148801
tagged with: promise
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45147896
tagged with: node.js
downvote count: 0
has comment: http://stackoverflow.com/comment/45147491
score: 1
has body: I have a Node app that I'm writing where I need to use promises for async calls. I currently have a foreach loop being called from within a .then(function()) of a promise, but when I return the end result of the foreach, I get nothing. In the foreach I can console.log the value of data and retrieve it, but not outside the for loop before the return? var Feeds = function(){ this.reddit = new Reddit(); } Feeds.prototype.parseRedditData = function(){ var _this = this; this.getData(this.reddit.endpoint).then(function(data){ return _this.reddit.parseData(data, q); }); } Feeds.prototype.getData = function(endpoint){ var deferred = q.defer(); https.get(endpoint, function(res) { var body = ''; res.on('data', function(chunk) { body += chunk; }); res.on('end', function() { deferred.resolve(JSON.parse(body)); }); }).on('error', function(e) { deferred.reject(e); }); return deferred.promise; } var Reddit = function(){ this.endpoint = "https://www.reddit.com/r/programming/hot.json?limit=10"; } Reddit.prototype.parseData = function(json, q){ var dataLength = json.data.children.length, data = []; for(var i = 0; i &lt;= dataLength; i++){ var post = {}; post.url = json.data.children[i].data.url; post.title = json.data.children[i].data.title; post.score = json.data.children[i].data.score; data.push(post); } return data; }
type: Question
has title: Node.js promises using Q
tagged with: javascript

http://stackoverflow.com/q/28316230
tagged with: google-maps
tagged with: javascript
score: 0
answer count: 1
tagged with: angular-ui
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29017064
has comment: http://stackoverflow.com/comment/45001626
has title: What will happen if I set `center` and `bounds` at the same time in Angular-google-maps?
type: Question
tagged with: angular-google-maps
has body: For ui-gmap-google-map, it seems that center attributes conflicts with bounds attributes sometimes, but its document doesn't say which has higher priority if I set both.. Consider the following situation, which I want to change the display area of google map 3 times: First time changes center, second time changes bounds and the third time changes center again.. Does anyone have ideas about how to do this? Thanks!

http://stackoverflow.com/comment/44957570
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28302583
has text: Have you checked what the data type of your `form` variable is, and whether it has anything in it, or it's `undefined`?
score: 0

http://stackoverflow.com/comment/44979298
type: Comment
has text: The only part of this that I would consider to be a bit of an "anti-pattern" is that your component is persisting it's own state inside of localStorage. If this component was used multiple times, then you would have to deal with key collisions. Imo, information that is this important (needs to be persisted to localStorage) should probably be moved up to a higher state or data layer within the applications architecture... but this is the easiest way to get the job done until the details are worked out
score: 46
type: AnswerComment
comment on: http://stackoverflow.com/a/28314706

http://stackoverflow.com/q/28372327
answer count: 1
downvote count: 1
accepted answer: http://stackoverflow.com/a/28372387
tagged with: jquery
favorite count: 0
tagged with: twitter-bootstrap
has title: Why this jQuery doesn't work in Codeigniter?
has comment: http://stackoverflow.com/comment/45085133
tagged with: php
has answer: http://stackoverflow.com/a/28372387
type: AnsweredQuestion
tagged with: codeigniter
has comment: http://stackoverflow.com/comment/45085104
type: Question
has comment: http://stackoverflow.com/comment/45085461
has comment: http://stackoverflow.com/comment/45085080
tagged with: javascript
has body: This jQuery is already tested correctly on an html website, now I need to use it on a Codeigniter setup. So I have a php page that looks like this: <link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/themes/<?php echo $this->config->item("theme"); ?>/normalize.css" type="text/css" /> <link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/themes/<?php echo $this->config->item("theme"); ?>/component.css" type="text/css" /> <script src="<?php echo base_url(); ?>assets/js/modernizr.custom.js"> <img src="<?php echo base_url(); ?>assets/css/themes/<?php echo $this->config->item("theme"); ?>/images/dummy.png" alt="dummy"> A fantastic title <script src="<?php echo base_url(); ?>assets/js/imagesloaded.pkgd.min.js"> <script src="<?php echo base_url(); ?>assets/js/colorfinder-1.1.js"> <script src="<?php echo base_url(); ?>assets/js/masonry.pkgd.min.js"> <script src="<?php echo base_url(); ?>assets/js/gridScrollFx.js"> <script src="<?php echo base_url(); ?>assets/js/classie.js"> I don't have any Javascript problem on console, however when I scroll down the "GridScrollFx" jQuery doesn't add class "shown" to list items GridScrollFx.prototype._scrollPage = function() { var self = this; this.items.forEach( function( item ) { if( !classie.has( item.el, 'shown' ) && !classie.has( item.el, 'animate' ) && inViewport( item.el, self.options.viewportFactor ) ) { ++self.itemsRenderedCount; if( !item.curtain ) { classie.add( item.el, 'shown' ); return; }; classie.add( item.el, 'animate' ); // after animation ends add class shown var onEndAnimationFn = function( ev ) { if( support.animations ) { this.removeEventListener( animEndEventName, onEndAnimationFn ); } classie.remove( item.el, 'animate' ); classie.add( item.el, 'shown' ); }; if( support.animations ) { item.curtain.addEventListener( animEndEventName, onEndAnimationFn ); } else { onEndAnimationFn(); } } }); this.didScroll = false; } And this is the CSS: /* Hover effects */ .grid li.shown:hover h3 { color: #fff; -…
has comment: http://stackoverflow.com/comment/45085416
score: 0
upvote count: 1

http://stackoverflow.com/comment/44976807
has text: You could always programmatically check for jQuery and dynamically include it if it's not there. See http://www.sitepoint.com/dynamically-load-jquery-library-javascript/. Otherwise, JSONP is damned tricky
score: 1
type: Comment
comment on: http://stackoverflow.com/q/28313269
type: QuestionComment

http://stackoverflow.com/a/28376489
type: Answer
has comment: http://stackoverflow.com/comment/45093200
score: 0
has body: var bottlesDiv = document.getElementById("bottles"); It is merely a case of incorrect formatting. bottlesDiv is the variable holding the element with the id of bottles. getElementById() is a Javascript selector function.
answers question: http://stackoverflow.com/q/28376445

http://stackoverflow.com/q/28364501
tagged with: javascript
has title: Why does java script click() function for asp Button is not working in chrome browser?
score: 0
has body: I am using java script click event to call one server function to assign some session values. But this java script is only calling in the Onclick event of the Anchor tag. this redirecting to other pages. &lt;a onclick="javascript:SetSession();" href="Some other page"&gt; &lt;asp:Button runat="server" ID="ButtonId" Style="display: none;" OnClick="SetSession" /&gt; Then the Javascript function is function SetSession() { var y = some values; $("#hiddenfield").val(y); document.getElementById("ButtonId").click(); } Then the C# code is like protected void SetSession(object sender, EventArgs e) { Session["SessionName"] = this.HiddenField.Value; } Its working fine in all browsers except Chrome. Even it is not calling the Button.Click() Server function In chrome ! I need the same functions. AnyOne Know the solution for chrome ?
answer count: 1
tagged with: asp.net
favorite count: 0
has answer: http://stackoverflow.com/a/28364674
has comment: http://stackoverflow.com/comment/45070649
has comment: http://stackoverflow.com/comment/45070585
type: AnsweredQuestion
upvote count: 1
accepted answer: http://stackoverflow.com/a/28364674
downvote count: 1
type: Question
tagged with: c#

http://stackoverflow.com/q/28397609
has answer: http://stackoverflow.com/a/52123280
has answer: http://stackoverflow.com/a/28398017
tagged with: angularjs
has body: I am a new AngularJS learner. My code is calling a JSON file and displays the output. However, I want the call to change the JSON call based on change in certain variable (i.e. KeyWord). Here is the HTML part: Click to Change KeyWord KeyWord:{{ keyWord }} ==== iter:{{ iter }} {{ x.Name + ', ' + x.Country }} And here goes the Controller part: var app = angular.module('App', []); app.controller('AppController', function($scope, $window) { $scope.keyWord = 3; $scope.iter = 1; $scope.ChangeKW = function() { if ( $scope.keyWord === 3 ) $scope.keyWord = 1; else $scope.keyWord = $scope.keyWord + 1; } }); app.controller("customersController", function($scope, $http) { $scope.iter = $scope.iter + 1; $http({ url: 'test' + $scope.keyWord + '.txt', dataType: 'json', method: 'GET', data: '', headers: { "Content-Type": "application/json" } }).success(function(response) { $scope.names = response; }).error(function(error) { $scope.names = [{ "Name": "Errrrrrr" }]; }); }); I want the program to load respective JSON file text1.txt, text2.txt or text3.txt based on value of KeyWord variable, which can be changed by clicking on the red button. I have defined mg-model="KeyWord" in HTML, which changes the value of {{ KeyWord }} in the output but it doesn't send refresh JSON call/output. The initial file loaded is tex3.txt (all three files can be distinguished from 1st record). The Plunker can be found here: Plunker.
upvote count: 2
tagged with: refresh
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
accepted answer: http://stackoverflow.com/a/28398017
type: Question
answer count: 2
tagged with: javascript
tagged with: ajax
has title: How to refresh controller to change/refresh JSON call in AngularJS?
score: 2
downvote count: 0
possible better answer: http://stackoverflow.com/a/52123280
favorite count: 0

http://stackoverflow.com/a/33810916
upvote count: 34
downvote count: 2
score: 32
type: Answer
answers question: http://stackoverflow.com/q/28357965
has body: You can use mongoose-auto-increment package as follows: var mongoose = require('mongoose'); var autoIncrement = require('mongoose-auto-increment'); /* connect to your database here */ /* define your CounterSchema here */ autoIncrement.initialize(mongoose.connection); CounterSchema.plugin(autoIncrement.plugin, 'Counter'); var Counter = mongoose.model('Counter', CounterSchema); You only need to initialize the autoIncrement once.
has comment: http://stackoverflow.com/comment/108300912

http://stackoverflow.com/a/28415964
has comment: http://stackoverflow.com/comment/45165696
upvote count: 1
has body: You can instruct paragraph to respect new lines characters (and other whitespaces like tabs, spaces, etc.) by setting its white-space property to pre: function MakePreview() { var getText = document.getElementById('inputText').value; document.getElementById('outputText').innerHTML = getText; } #outputText { white-space: pre; }
score: 1
has comment: http://stackoverflow.com/comment/45165518
downvote count: 0
answers question: http://stackoverflow.com/q/28415781
type: Answer
has comment: http://stackoverflow.com/comment/45166377

http://stackoverflow.com/comment/44996146
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28323956
score: 0
has text: You are missing something and I can't see what because you didn't post all of your code. Here is the implementation which works fine: [JSFiddle](http://jsfiddle.net/bardhlohaj/pgzxyybp/)

http://stackoverflow.com/comment/44985745
comment on: http://stackoverflow.com/q/28318433
score: 0
type: Comment
has text: can you post your html too ? have you try with the change event on your input type file ?
type: QuestionComment

http://stackoverflow.com/a/30014936
has body: The IE bug that Chris is referring to is a caching error that allows old content to be re-served when using angular's $http and IE. I've written about the subject here: http://benjii.me/2014/07/ie-is-caching-my-angular-requests-to-asp-net-mvc/ A better fix than removing the bug-fix code is to fix it. Use the following instead: //initialize get if not there if (!$httpProvider.defaults.headers.get) { $httpProvider.defaults.headers.get = {}; } //disable IE ajax request caching $httpProvider.defaults.headers.get["If-Modified-Since"] = "Fri, 01 Jan 2010 00:00:00 GMT";
answers question: http://stackoverflow.com/q/28416551
type: Answer
score: 3
upvote count: 3
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28416551

http://stackoverflow.com/a/28337112
score: 0
accepted answer of: http://stackoverflow.com/q/28336935
type: Answer
type: AcceptedAnswer
has body: Just add a CSS properties for your image tag or change it through script like image.style.width='50%'; image.style.height='auto'; by doing this you can maintain the resolution of image. so it can not lose its quality.
answers question: http://stackoverflow.com/q/28336935

http://stackoverflow.com/comment/45082229
comment on: http://stackoverflow.com/a/28366618
has text: Thanks @Jorg W Mittag for the detailed response! Your explanation has been really helpful - at least it confirms my mental model of how Ruby objects look up methods.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28352330
has title: Readmore arrow - hover effect - slide in text
type: UnansweredQuestion
downvote count: 2
tagged with: animation
tagged with: css
has body: I've a container with an arrow on the bottom. On hover I want that the arrow animates to the right when the readmore (lees meer) text slides in. State 1: http://postimg.org/image/5ovuxrfdd/ (readmore text is invisible, overflow:hidden) State 2: http://postimg.org/image/y5imixrbd/ I already have this working with some CSS animation BUT I use fixed pixels on the transform property. I also want this to work responsively. So I need a more dynamic approach. I hope I can solve this without JS.
has comment: http://stackoverflow.com/comment/45048736
type: Question
score: -2
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28352774
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
upvote count: 0

http://stackoverflow.com/comment/45125129
type: Comment
has text: am not good in json and i need progress value only cuz img i display with bootstrap and js
type: AnswerComment
comment on: http://stackoverflow.com/a/28386040
score: 0

http://stackoverflow.com/q/28419899
tagged with: createjs
score: 0
has answer: http://stackoverflow.com/a/28420997
accepted answer: http://stackoverflow.com/a/28420997
answer count: 1
tagged with: multiple-inheritance
has comment: http://stackoverflow.com/comment/45173359
type: AnsweredQuestion
has body: I'm creating a new class definition Button that extends an existing Container class in EaselJS. There are no problems with that. However, I'd also like Button to inherit from a super class All, so that Button also has access to its .banana and .eatBanana. How do I go about this? (function() { function All() { this.banana = 0; } var p = All.prototype; p.eatBanana = function() { alert(this.banana); } window.All = All; }()); (function() { function Button(apple) { this.apple = apple || 0; this.Container_constructor(); } var p = createjs.extend(Button, createjs.Container); p.sayHi = function() { alert(this.apple + this.banana); } window.Button = createjs.promote(Button, 'Container'); }());
has comment: http://stackoverflow.com/comment/45173528
type: Question
tagged with: javascript
tagged with: inheritance
has title: Inherit two classes - Javascript
tagged with: easeljs

http://stackoverflow.com/a/75756171
score: 2
has body: https://www.npmjs.com/package/react-helmet Install react-helmet and use it for dynamic css for separate components. Example is For 1st component, using style1.css &lt;&gt; &lt;Helmet&gt; &lt;link rel="stylesheet" href="/css/style1.css" /&gt; &lt;/Helmet&gt; ... &lt;/&gt; For 2nd component, using style2.css &lt;&gt; &lt;Helmet&gt; &lt;link rel="stylesheet" href="/css/style1.css" /&gt; &lt;/Helmet&gt; ... &lt;/&gt;
answers question: http://stackoverflow.com/q/28386125
downvote count: 0
upvote count: 2
type: Answer

http://stackoverflow.com/a/28392247
has body: Yes, jQuery will refuse to select elements with special characters in CSS selector. You just need to escape them with \\: var elem = $location.hash().replace(/\?/, '\\\\?'); This will properly escape ? character. Also note that location.hash will already include leading # so you don't need to prepend one more.
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45121399
answers question: http://stackoverflow.com/q/28392181
type: Answer
accepted answer of: http://stackoverflow.com/q/28392181
downvote count: 0
has comment: http://stackoverflow.com/comment/45121390
score: 1
has comment: http://stackoverflow.com/comment/45121418

http://stackoverflow.com/comment/45133329
comment on: http://stackoverflow.com/a/28396546
score: 0
has text: @guest271314 your implementation works as well. I improved my answer to support any number of arguments etc. as in your answer ;)
type: Comment
type: AnswerComment

http://stackoverflow.com/q/28393212
has comment: http://stackoverflow.com/comment/45123203
type: Question
has comment: http://stackoverflow.com/comment/45123146
tagged with: javascript
has comment: http://stackoverflow.com/comment/45123250
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 0
type: UnansweredQuestion
has body: I'm trying to make a similar title bar (or form row) like of StackOverflow with UIKit with this code: Text Title: Here's a screenshot of what it looks like now:
tagged with: getuikit
has title: How to make a Stackoverflow-like Title bar (row) with UIKit

http://stackoverflow.com/comment/45051078
comment on: http://stackoverflow.com/q/28353646
type: Comment
type: QuestionComment
score: 1
has text: I can't give you a clear answer, but I can say that prototype is what you should be looking into.

http://stackoverflow.com/comment/44928202
comment on: http://stackoverflow.com/a/28286912
score: 0
type: AnswerComment
has text: Sorry but I didn't recognize JQuery in his code..only regular javascript.
type: Comment

http://stackoverflow.com/comment/52469091
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28389178
has text: @JonRed Maybe your run failed by another reason, not because of a constant. I have just tried it and my run works pretty well.

http://stackoverflow.com/comment/45125289
score: 0
comment on: http://stackoverflow.com/q/28381960
type: Comment
type: QuestionComment
has text: Just a code check. Are you sure you want to `_.extend @options, opts` in that order? Generally the default options (in your case `opt`) are meant to be overriden. So you'd want to do `opts = opts || {}` `_.extend opts, @options`.

http://stackoverflow.com/q/28316947
has title: Is my jQuery .load bloacked by the CMS?
score: 0
has comment: http://stackoverflow.com/comment/44993170
has body: I am using prettyPhoto inside a Movable Type CMS page. To make it work I have to use a <mt:setvarblock name="html_head" append="1"> JS scripts here </mt:include> section. To make a gallery with 30-40 pictures, I have to add a block for each picture that looks something like this: I want to generate these entries from a csv file using a (python) script and put into a separate file on the web server. Then I use this code to load these entries into the page: When I load the page the thumbnails show up, but when I click them the pathtoimage.jpg is loaded instead of prettyphoto. My question: Am I doing something wrong or is movable type blocking the execution for security reasons? How to debug this? I have firebug but no idea what to look for. P.S: When pasting the entries directly into the page it works as expected. Edit: full working code <mt:setvarblock name="html_head" append="1"> </mt:setvarblock> <mt:include name="include/header.tmpl"> </mt:include>
tagged with: movabletype
accepted answer: http://stackoverflow.com/a/28317503
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44982957
has answer: http://stackoverflow.com/a/28317503
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28337387
downvote count: 0
tagged with: javascript
score: 4
tagged with: go
has answer: http://stackoverflow.com/a/28337872
favorite count: 0
tagged with: angularjs
has title: POST request treated as OPTIONS on beego framework
accepted answer: http://stackoverflow.com/a/28337872
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/48098559
has body: I'm using beego framework as my API framework and AngularJS on the client. I have set all CORS setting correctly. I can do GET request. But, when i try to POST, beego treat is as OPTIONS request. It also throw a warning: multiple response.WriteHeader calls. what could possibly wrong? my beego CORS setting: func init() { orm.RegisterDataBase("default", "mysql", "root:@tcp(127.0.0.1:3306)/fakeapi") beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&amp;cors.Options{ AllowOrigins: []string{"*"}, AllowMethods: []string{"GET", "DELETE", "PUT", "PATCH", "POST"}, AllowHeaders: []string{"Origin"}, ExposeHeaders: []string{"Content-Length"}, AllowCredentials: true, })) } My ANgularJS request var transaction = $http.post(BASE_URL + "transaction", transactionData); return $q.all([transaction]).then(function(response) { console.log(response); }); my system: Ubuntu 14.04 beego: 1.4.2 bee: 1.2.4 angularJS: 1.3.12
has answer: http://stackoverflow.com/a/48098559
type: Question
upvote count: 4
answer count: 2
tagged with: beego

http://stackoverflow.com/q/28319457
has answer: http://stackoverflow.com/a/28320702
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28321451
type: Question
has body: Here is the screen shot of my table where the two [th] and two [td] are made resizable by jquery-ui resizable() function. I used Jquery-1.10.2 and Jquery-ui 1.10.2. Now the border is fine for Chrome, but doesn't show on IE or Mozilla Chrome ScreenShot: Mozilla or IE ScreenShot: The code for these two table is here below:
has answer: http://stackoverflow.com/a/28321451
has comment: http://stackoverflow.com/comment/44988229
tagged with: javascript
score: 0
answer count: 3
has title: why or border is not showing ( I used Jquery UI resizable() function on these or ) in mozilla and IE, but works fine for chrome?
tagged with: jquery
has comment: http://stackoverflow.com/comment/44988148
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28319869
has comment: http://stackoverflow.com/comment/44988422
has comment: http://stackoverflow.com/comment/44988261
tagged with: css
has answer: http://stackoverflow.com/a/28319869
has comment: http://stackoverflow.com/comment/44988331

http://stackoverflow.com/q/28341238
tagged with: ajax
upvote count: 1
has comment: http://stackoverflow.com/comment/45027473
tagged with: callback
favorite count: 0
type: UnansweredQuestion
has body: I'm generating some divs and radio buttons with diferents ids depending of a "for" indentifier, like this: @for (int i = 0; i &lt; Model.Opc.Count; i++) { &lt;input id="maininfo_@(i)" type="radio" name="maininfo" value="@(value)" checked="@maininfo.Selected" /&gt; &lt;div id="info-@(i)" /&gt; } I have too an ajax call like this $("input[name='maininfo']").change(function () { var value = $("input[name='maininfo']:checked").val(); $.post("/Opc/Info?value=" + value, submitCallback); }); and this is the callback function: var submitCallback = function (data) { $("#info").html(data.Result.Html); } The idea is show all radiobuttons and, when one is checked, show the information just below of each radiobutton. For this reason, I need a callback parameter ("for" identifier) to show the correct info. But I don't know how to do this correctly and eficiently.
tagged with: parameters
downvote count: 0
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/45027746
has title: Submit Callback parameters in Ajax
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/45082817
has text: `var x; x = a1 ? a1 : (a2 ? a2: null)`
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28371068
score: 0

http://stackoverflow.com/comment/45203334
type: Comment
comment on: http://stackoverflow.com/q/28436614
type: QuestionComment
has text: Check the request details **Network** tab in your browser to see exactly what payload is being send to the server, to make sure you're sending what you expect from JS.
score: 0

http://stackoverflow.com/q/28285667
score: 0
answer count: 1
type: UnansweredQuestion
has body: I'm trying to build some charts using AmCharts, and I need to set the titles dynamically. According to the docs, each chart should have an addTitle() method: http://docs.amcharts.com/3/javascriptcharts/AmChart addTitle(text, size, color, alpha, bold) text - text of a title size - font size color - title color alpha - title opacity bold - boolean value indicating if title should be bold. Adds title to the top of the chart. Pie, Radar positions are updated so that they won't overlap. Plot area of Serial/XY chart is also updated unless autoMargins property is set to false. You can add any number of titles - each of them will be placed in a new line. To remove titles, simply clear titles array: chart.titles = []; and call chart.validateNow() method. I can see no such method. I'm creating the chart using AmCharts.makeChart(), passing a div and a chart definition object: var chart = AmCharts.makeChart($chartDiv[0], chartDefinition); When I examine my chart object, I can see the array of titles I've included in my chartDefinition, but there's no addTitle() method defined on it.
tagged with: amcharts
type: Question
has title: AmChart - addTitle not defined
tagged with: javascript
has answer: http://stackoverflow.com/a/28295011

http://stackoverflow.com/comment/45137660
type: Comment
comment on: http://stackoverflow.com/a/28401055
type: AnswerComment
has text: You could also use the Yahoo Catalog API https://help.yahoo.com/kb/yahoo-merchant-solutions/SLN19824.html?impressions=true
score: 0

http://stackoverflow.com/q/28401674
has title: Form doesn't submit values in ASP.NET MVC
tagged with: razor
has comment: http://stackoverflow.com/comment/45138770
type: Question
tagged with: asp.net-mvc-5
has body: I am using ASP.NET MVC 5. Here, when i click on the search bar it calls the java script function, and when i provide the searchString value to the form, and click SUBMIT, it doesn't submit anything. Why is that? &lt;script&gt; $(function () { $('a[href="#search"]').on('click', function (event) { event.preventDefault(); $('#search').addClass('open'); $('#search &gt; form &gt; input[type="search"]').focus(); }); $('#search, #search button.close').on('click keyup', function (event) { if (event.target == this || event.target.className == 'close' || event.keyCode == 27) { $(this).removeClass('open'); } }); }); &lt;/script&gt; View: &lt;body&gt; &lt;div class="navbar navbar-inverse navbar-fixed-top"&gt; &lt;div class="container"&gt; &lt;div class="navbar-header"&gt; &lt;button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;/button&gt; @if (Request.IsAuthenticated) { @Html.ActionLink("TimeEntry", "Index", "TimeEntry", null, new {@class = "navbar-brand"}) } else { @Html.ActionLink("TimeEntry", "Login", "User", null, new {@class = "navbar-brand"}) } &lt;/div&gt; &lt;div class="navbar-collapse collapse"&gt; &lt;ul class="nav navbar-nav"&gt; &lt;li&gt;@Html.ActionLink("Clock In/Out(WIP)", "Index", "TimeEntry")&lt;/li&gt; &lt;li&gt;@Html.ActionLink("Time Summary", "BackEnd", "TimeEntry")&lt;/li&gt; &lt;li&gt;@Html.ActionLink("Users", "Index", "User")&lt;/li&gt; &lt;li&gt;&lt;a href="#search"&gt;Search&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;ul class="nav navbar-nav navbar-right"&gt; @if (Request.IsAuthenticated) { &lt;li&gt; @Html.ActionLink("Log Out", "Logout", "User")&lt;/li&gt; } &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="search"&gt; &lt;button type="button" class="close" style="padding-top: 35px"&gt;x&lt;/button&gt; @using (Html.BeginForm("Search", "User", FormMethod.Get)) { @Html…
has comment: http://stackoverflow.com/comment/45139218
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45138728
has answer: http://stackoverflow.com/a/28402132
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28402164
has comment: http://stackoverflow.com/comment/45138888
has comment: http://stackoverflow.com/comment/45138787
has comment: http://stackoverflow.com/comment/45139452
has comment: http://stackoverflow.com/comment/45138904
type: UnansweredQuestion

http://stackoverflow.com/comment/45001210
has text: Thanks, what do you recommend using instead, to stop that from happening?
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28326751

http://stackoverflow.com/comment/101233817
comment on: http://stackoverflow.com/a/34588812
has text: @Jasper, another assumption, "refused to learn to use" != "made a conscious decision" (which is understanding benefits and drawbacks, and considering benefits to overweigh drawbacks). The standard still misses a lot of useful functionality. What are you going to do - struggle with verbose and hardly discoverable functions and hacks here and there, which lead to all kinds of bugs (thinly spread across the whole codebase and summarily more impacting than built-in object prototype conflicts - this is subjective, though), or thoughtfully extend the language?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45171423
type: Comment
comment on: http://stackoverflow.com/a/28414721
has text: @FrankvanPuffelen You are right. I was unclear. Hopefully now it's better
type: AnswerComment
score: 0

http://stackoverflow.com/a/28300078
has comment: http://stackoverflow.com/comment/45013444
downvote count: 1
has comment: http://stackoverflow.com/comment/44978653
has comment: http://stackoverflow.com/comment/45046367
has comment: http://stackoverflow.com/comment/44992671
has body: If 'width' is a model property, then &lt;div class="progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" data-bind=" style: { width: width + '%' }, attr: {'aria-valuenow' : width + '%'}"&gt; For more details check the style binding article. Note that it makes sense to change the aria-valuenow attribute, which requires the ' around the value for Knockout to set correctly
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28299896
answers question: http://stackoverflow.com/q/28299896
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/44980404
score: 1

http://stackoverflow.com/q/28353199
has answer: http://stackoverflow.com/a/28353497
accepted answer: http://stackoverflow.com/a/28353497
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has title: Call Chrome-Extension Method from within options page?
tagged with: google-chrome-extension
type: AnsweredQuestion
has body: I wrote a chrome extension for a specific website. If the extension is installed and I navigate to that site "example.com", my extension calls the following method: var search="john"; $.get("https://www.example.com/complete/search?q="+search, function (data) { console.log(data); }); That works just fine. Now I have to call the same method from within the options-page of that extension. When I do that, I receive the following error: XMLHttpRequest cannot load https://www.example.com/complete/search?q=John. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. I understand why this happens but have to find a way to get around this. My idea is to trigger the Extension-Script to call the method and then return the results to the options page. I expect, chrome.runtime.sendMessage() isn't help here. Needless to say: That domain is not hosted by me, so I can't just change the header.
type: Question

http://stackoverflow.com/comment/45179609
type: QuestionComment
comment on: http://stackoverflow.com/q/28422818
has text: both the image and text. preferably in two seperate entities. I can replicate the effect using basic z-index however I need it to be responsive which is why im using slick. any suggestions?
score: 0
type: Comment

http://stackoverflow.com/q/28427154
has comment: http://stackoverflow.com/comment/45186128
answer count: 4
has comment: http://stackoverflow.com/comment/45186082
has answer: http://stackoverflow.com/a/28427617
has answer: http://stackoverflow.com/a/28428680
has comment: http://stackoverflow.com/comment/45186183
type: Question
has answer: http://stackoverflow.com/a/28428333
has answer: http://stackoverflow.com/a/28428037
has body: I'm new with javascript/jquery. I'm trying to retrieve some values from a div, without success. This is what I get in the execution of my code. Uncaught ReferenceError: getQuestionOptionValues is not defined. My code: Escoja una opción Opciones SI NO This is a dropdownlist and I only want to retrieve the selected value, but only a part of the value. In this case 3514 or 3515. And I'm trying this: var ret = getQuestionOptionValues("div#divQ<?php echo $cond->question_id_dep; ?>"); The result of this is: var ret = getQuestionOptionValues("div#divQ1113"); And the function does the next: function getQuestionOptionValues(element) { var ret = new Array(); x$(element).find("input").filter(function() { return this.selected; }).each(function(optelement, index, xui) { ret.push(parseInt(x$(optelement).attr("value").toString().replace(/Q\d+_QO/g, ""))); }); return ret; } What am I doing wrong? I've to do the same for another kind of div, with checkboxes. Like this: Por favor indique el motivo o motivos de su insatisfacción: Limpieza habitación Atención del personal Restaurante, alimentación, calidad o falta de servicio Estado de las instalaciones Otros motivos, especificar And in this case I've to retrieve only the checked checkboxes, specifically the last number on name or id label. I.E. For Q2_QO5, I need to get 5, but only if the checkbox is checked.
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45186421
tagged with: jquery
has comment: http://stackoverflow.com/comment/45186018
has title: DOM with javascript/jquery
type: UnansweredQuestion

http://stackoverflow.com/comment/45077414
comment on: http://stackoverflow.com/q/28368231
has text: on my fiddle, please check it out
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45115756
score: 3
has text: `closestTo([1,2,3],1,'prev')` will show `undefined`. OP wants `3` to be the output.
type: AnswerComment
comment on: http://stackoverflow.com/a/28389005
type: Comment

http://stackoverflow.com/comment/45064089
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28292080
has text: George plz check my answer
score: 0

http://stackoverflow.com/comment/44924930
type: QuestionComment
has text: because ie does not properly enforce cross-site request policies. It makes it quite a dangerous browser to be using.
comment on: http://stackoverflow.com/q/28285459
score: 0
type: Comment

http://stackoverflow.com/a/28319742
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28319572
score: 1
answers question: http://stackoverflow.com/q/28319572
type: AcceptedAnswer
upvote count: 1
type: Answer
has body: You have to escape the symbols that are not accepted. One way to do it is var ID = $(this).attr("id").replace(/\|/g, '\\|'); I would still recommend you use the standard recommended symbols for ID attributes. var i = $('div').attr('id').replace(/\|/g, '\\|'); var t = $('#mask'+i).text(); alert(t); Text

http://stackoverflow.com/a/28389986
has comment: http://stackoverflow.com/comment/45173365
score: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45192374
type: Answer
accepted answer of: http://stackoverflow.com/q/28389783
has body: You might update the height of the &lt;iframe&gt; from the framed page using JavaScript after a new element is shown. function resizeParent() { if (!window.parent) return; var height = $(document).height(); $(window.parent.document).find('iframe').height(height); } Demo Source of framed page Note, this will only work if both pages are loaded from the same domain.
answers question: http://stackoverflow.com/q/28389783
upvote count: 1

http://stackoverflow.com/comment/89567245
score: 1
has text: This is not changing model value
comment on: http://stackoverflow.com/a/33499434
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44933035
has text: You're not using a "load" handler, you're using a "ready" handler. The "ready" event fires when the DOM is built but (potentially) *before* external resources like CSS has been loaded. Try changing `jQuery(document).ready(...)` to `jQuery(window).load(...)` (you won't get `$` passed to you in that case, but it should wait for your CSS to load).
comment on: http://stackoverflow.com/q/28289634
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45053141
has text: @mare no, the issue wouldis that `$http(args)` return httpPromise and $http(args).then.. returns q promise. But yes if you return $http you will get both error blocks executed. But then if you want to chanin through transforming and propagating data you would want to do `then` instead of success.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28354478
type: Comment

http://stackoverflow.com/q/28427704
has comment: http://stackoverflow.com/comment/45187062
upvote count: 1
has answer: http://stackoverflow.com/a/28427775
accepted answer: http://stackoverflow.com/a/28427775
tagged with: events
favorite count: 0
downvote count: 5
score: -4
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45187038
tagged with: keypress
has title: How to create event keypress using javascript
answer count: 1
linked to: http://stackoverflow.com/q/24739519
tagged with: javascript
has comment: http://stackoverflow.com/comment/45186993
has body: Like title, i want create a function using javascript and php. This function will be process keyboard press. example, i dont need press ctrl and Prt Scr to capture screen. I want take it with javascript. No press key, just do it with javascript. HOW I CANT DO IT? Please help me!!!
has comment: http://stackoverflow.com/comment/45186995

http://stackoverflow.com/comment/45178023
score: 0
has text: You can send an object with the type in it: `{type: "uint8", data: myArrayBuffer}`.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28421827

http://stackoverflow.com/q/28341192
has body: I have a form that has a dropdown selection menu that loads invoice ids from my database. I'm trying to prefill my form based on the value of the invoice selected from the drop down menu. In my database is a column "invoiceidcopy" which contains a value(s) that shows as a selection(s) for my drop down menu. If you notice in my image of my database table below you will notice the first row/record's invoiceidcopy field is blank..in my drop down menu ...of course...the first selection is blank. Ultimately my code below im trying to get to prefill my form works only when i select the blank selection from the drop down menu but not for the other 2 selections? How can I prefill my form based on a dropdown menu selection value? FORM -- Select One -- Prefill Form Submit SCRIPT /tst/orders2.php <?php // Create the connection to the database $con=mysqli_connect("xxx","xxx","xxx","xxx"); // Check if the connection failed if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); die(); } if (isset($_GET['invoiceidcopy'])) { $invoiceidcopy= $_GET['invoiceidcopy']; $query = "SELECT txt1, txt2, q1 FROM seguin_orders WHERE invoiceidcopy = '".($invoiceidcopy)."'"; $result = mysqli_query($con,$query); while ($row = mysqli_fetch_assoc($result)) { echo json_encode($row); die(); } } ?>
type: UnansweredQuestion
tagged with: php
has answer: http://stackoverflow.com/a/28342408
score: 2
downvote count: 0
tagged with: mysql
has title: How can I prefill my form based on a dropdown menu selection value?
type: Question
upvote count: 2
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28301747
has comment: http://stackoverflow.com/comment/44955008
has body: this is my javascript code : document.getElementById("&lt;%= btnUpload.ClientID %&gt;").click(); This code is working perfectly in all other browsers except IE 9. what could be the possibility ?
type: Question
tagged with: c#
tagged with: internet-explorer-9
tagged with: javascript
has comment: http://stackoverflow.com/comment/44954959
has comment: http://stackoverflow.com/comment/44955733
answer count: 1
has answer: http://stackoverflow.com/a/28302117
tagged with: asp.net
has title: button click event from java script not working in IE 9
type: UnansweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/44955117

http://stackoverflow.com/comment/45120323
type: AnswerComment
comment on: http://stackoverflow.com/a/28391582
type: Comment
has text: Hey I am new to asp.net. Could you please tell me how to show any error message in the already loaded page from controller?
score: 0

http://stackoverflow.com/comment/45055246
score: 0
comment on: http://stackoverflow.com/q/28355830
type: QuestionComment
type: Comment
has text: I believe it's a string. Here is how it's declared: `var encrypted = CryptoJS.AES.encrypt(e.target.result, password);` ... for what I know, this returns me a base64 string.

http://stackoverflow.com/comment/45127262
type: AnswerComment
has text: so, ive lied a ltitle. The data is a little changed in the json results. So for example the `json.results[i].price` will be a littlle different on each api sorry!
comment on: http://stackoverflow.com/a/28387175
type: Comment
score: 0

http://stackoverflow.com/comment/45176619
type: QuestionComment
type: Comment
has text: In the example you cited the guy who open the question wrote: `I am using the jQuery Form Plugin to upload files.`. Did you tried that? I've and is awesome.
comment on: http://stackoverflow.com/q/28421278
score: 0

http://stackoverflow.com/a/28376400
accepted answer of: http://stackoverflow.com/q/28375166
answers question: http://stackoverflow.com/q/28375166
has body: I believe you need to use the meta param in that getClass function meta.attr = 'background-color: #F1F1F1;' http://docs.sencha.com/extjs/4.2.3/#!/api/Ext.grid.column.Action
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/46079361
type: QuestionComment
comment on: http://stackoverflow.com/q/28310501
has text: I looked through that commit, and I still can't see a sensible reason for why this was dropped... other than laziness on Apple's part in implementing it properly. Chrome seems to have implemented this differently. Shame the fork isn't being looked at by Apple.
score: 2
type: Comment

http://stackoverflow.com/q/28408764
tagged with: javascript
tagged with: rows
answer count: 1
has answer: http://stackoverflow.com/a/28409273
has title: PHPExcel search/return all rows containing perticular value in cells
tagged with: php
tagged with: cells
tagged with: phpexcel
type: AnsweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/45154771
has body: I tried to find a way to just get a particular rows using PHPExcel. After searching on the internet, I cannot figure it out on my own. What I want to do is to list all the rows that have a "I1/027" as a column content. For example: Hours | Place | Name ------|-------|----------------- 3 |I1/027 | example1 //------> Want to add it to my list!!! 6 |I2/025 | example2 //------> Ignore this 7 |I1/030 | example3 2 |I1/027 | example4 //------> Want to add it to my list!!! Here's the code without the rows filter, it shows all the excel rows: <?php if(isset($_FILES['file']['name'])) { ?> <?php require_once 'reader/Classes/PHPExcel/IOFactory.php'; //Extra functions function get_cell($cell, $objPHPExcel){ //Cell selection $objCell = ($objPHPExcel->getActiveSheet()->getCell($cell)); //taking cell value return $objCell->getvalue(); } function pp(&$var){ $var = chr(ord($var)+1); return true; } //==========Displaying Code $name = $_FILES['file']['name']; $tname = $_FILES['file']['tmp_name']; $type = $_FILES['file']['type']; if($type == 'application/vnd.ms-excel') { // excel 97 extension $ext = 'xls'; } else if($type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') { // excel 2007 and 2010 extensions $ext = 'xlsx'; }else { // invalid extension echo -1; exit(); } $xlsx = 'Excel2007'; $xls = 'Excel5'; //read creator $objReader = PHPExcel_IOFactory::createReader($$ext); //loading $objPHPExcel = $objReader->load($tname); $dim = $objPHPExcel->getActiveSheet()->calculateWorksheetDimension(); // put $start and $end array list($start, $end) = explode(':', $dim); if(!preg_match('#([A-Z]+)([0-9]+)#', $start, $rslt)){ return false; } list($start, $start_h, $start_v) = $rslt; if(!preg_match('#([A-Z]+)([0-9]+)#', $end, $rslt)){ return false; } list($end, $end_h, $end_v) = $rslt; //starting to read excel doc $table = " "; for($v=$start_v; $v<=$end_v; $v++){ // calculate progress bar $percent = intval($v/$end_v * 100)."%"; // progress bar update echo ' '; // buffer flush ec…
accepted answer: http://stackoverflow.com/a/28409273
has comment: http://stackoverflow.com/comment/45157095
type: Question

http://stackoverflow.com/comment/45006104
type: QuestionComment
has text: Mmm, this code doesn't define `chart1` or `chart2`. Where are they defined? I don't think this has anything to do with ExpressJS, you just haven't defined the variables or they are not accessible from this context
comment on: http://stackoverflow.com/q/28329175
score: 0
type: Comment

http://stackoverflow.com/a/28357331
score: 11
has comment: http://stackoverflow.com/comment/94136568
has comment: http://stackoverflow.com/comment/94136761
downvote count: 0
has body: Use parentNode to get the row. function clicked() { alert("clicked cell at: " + this.cellIndex + ", " + this.parentNode.rowIndex); }
answers question: http://stackoverflow.com/q/28357314
type: Answer
upvote count: 11

http://stackoverflow.com/a/28351090
accepted answer of: http://stackoverflow.com/q/28333327
type: Answer
downvote count: 0
has body: Since we cannot listen for events directly on the textNodes themselves, we have to take a more creative path to solving the problem. One thing we can do is look at the coordinates of the click event, and see if it overlaps with a textNode. First, we'll need a small helper method to help us track whether a set of coordinates exists within a set of constraints. This will make it easier for us to arbitrarily determine if a set of x/y values are within the a set of dimensions: function isInside ( x, y, rect ) { return x &gt;= rect.left &amp;&amp; y &gt;= rect.top &amp;&amp; x &lt;= rect.right &amp;&amp; y &lt;= rect.bottom; } This is fairly basic. The x and y values will be numbers, and the rect reference will be an object with at least four properties holding the absolute pixel values representing four corners of a rectangle. Next, we need a function for cycling through all childNodes that are textNodes, and determining whether a click event took place above one of them: function textNodeFromPoint( element, x, y ) { var node, nodes = element.childNodes, range = document.createRange(); for ( var i = 0; node = nodes[i], i &lt; nodes.length; i++ ) { if ( node.nodeType !== 3 ) continue; range.selectNodeContents(node); if ( isInside( x, y, range.getBoundingClientRect() ) ) { return node; } } return false; } With all of this in place, we can now quickly determine if a textNode was directly below the clicked region, and get the value of that node: element.addEventListener( "click", function ( event ) { if ( event.srcElement === this ) { var clickedNode = textNodeFromPoint( this, event.clientX, event.clientY ); if ( clickedNode ) { alert( "You clicked: " + clickedNode.nodeValue ); } } }); Note that the initial condition if ( event.srcElement ) === this allows us to ignore click events originating from nested elements, such as an image or a span tag. Clicks that happen over textNodes will show the parent element as the srcElement, and as such those are the only ones we're conce…
score: 9
has comment: http://stackoverflow.com/comment/78730500
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28333327
upvote count: 9

http://stackoverflow.com/comment/45300402
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28324153
type: QuestionComment
has text: Which binding for Selenium are you using? Are you using the legacy driver or are you using a WebDriver binding in an environment such as Java, NodeJS, or Ruby?

http://stackoverflow.com/q/28386544
downvote count: 2
type: Question
accepted answer: http://stackoverflow.com/a/28387668
has comment: http://stackoverflow.com/comment/45110932
has title: For loop in javascript object
score: -2
has comment: http://stackoverflow.com/comment/45110812
has body: Maybe I'm really tried but not sure why this is not working, I'm trying to get back the correct value from the var object for (i = 1; i &lt; 11; i++) { (function(i) { var EFPStart = form.formData.plantSample[i].EFPStart; console.log(EFPStart); $('#PO-'+i+'-EFP-start').val(EFPStart); }(i)); } and here is the form data formData: plantSample1: CE: 0EFAEnd:1 EFAStart: 1 EFPEnd: 1 EFPStart: 1 plantSample2: CE: 0EFAEnd:1 EFAStart: 1 EFPEnd: 1 EFPStart: 1 plantSample3: CE: 0EFAEnd:1 EFAStart: 1 EFPEnd: 1 EFPStart: 1
upvote count: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45110876
favorite count: 0
has answer: http://stackoverflow.com/a/28387668
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45110825

http://stackoverflow.com/comment/44970192
type: QuestionComment
comment on: http://stackoverflow.com/q/28309512
has text: @blex I did not explicitly set an encoding type in my PHP script. How would I set the encoding type to UTF-8? I will give this a try.
score: 0
type: Comment

http://stackoverflow.com/comment/45191767
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28429440
has text: This is a very interesting solution!
type: Comment

http://stackoverflow.com/comment/45070770
type: QuestionComment
has text: we cannot see localhost links i'm afraid
type: Comment
comment on: http://stackoverflow.com/q/28364631
score: 0

http://stackoverflow.com/q/28312468
favorite count: 0
linked to: http://stackoverflow.com/q/4140324
possible better answer: http://stackoverflow.com/a/28313011
tagged with: regex
has answer: http://stackoverflow.com/a/28313011
type: AnsweredQuestion
has body: I am trying to capture the last element of the url and strip out any unwanted characters such as below http://www.myurl.com/abcs/der/er/..../asdsad/hrllo.shtml#header?query=whatever&amp;.... from the above URl, for example, I need to get only hrllo var search_param = $(location).attr("href").split('/').pop().replace('#', ''); I think maybe a regex? the text hrllo can only have letters (capital or not).
has title: How to get last element of url stripping out unwanted characters?
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44975324
type: Question
has answer: http://stackoverflow.com/a/28313066
has comment: http://stackoverflow.com/comment/44975335
tagged with: javascript
has comment: http://stackoverflow.com/comment/44995316
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/44976080
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28313066

jquery-select2
tags question: http://stackoverflow.com/q/28281263
tags question: http://stackoverflow.com/q/28340566
tag name: jquery-select2
tags question: http://stackoverflow.com/q/28328044
tags question: http://stackoverflow.com/q/28355083
tags question: http://stackoverflow.com/q/28353891
type: Tag
tags question: http://stackoverflow.com/q/28366512

http://stackoverflow.com/q/28289424
tagged with: string
favorite count: 0
has answer: http://stackoverflow.com/a/28289431
has comment: http://stackoverflow.com/comment/44932594
has title: Whats wrong is with the code? Its giving me a run time error?
upvote count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44932603
has answer: http://stackoverflow.com/a/28289461
has comment: http://stackoverflow.com/comment/44932601
has body: var names = ['Atlanta', 'Georgia', 'USA']; for (var i = 1; i &lt; names.length; i++) { if (names[i] = '') alert("Go Atlanta!"); alert("You rock!"); } // Above code giving me a run time error.. please help
type: Question
downvote count: 2
answer count: 2
score: -2
tagged with: arrays
tagged with: javascript

http://stackoverflow.com/a/28399785
answers question: http://stackoverflow.com/q/28399760
has body: Your if syntax is wrong. It should be this instead: if (userAnswer === "yes")
type: Answer
upvote count: 4
downvote count: 0
type: AcceptedAnswer
score: 4
accepted answer of: http://stackoverflow.com/q/28399760

http://stackoverflow.com/comment/45151924
comment on: http://stackoverflow.com/q/28408978
score: 0
type: Comment
type: QuestionComment
has text: @jbutler483 I'm dumb, I forgot to add that! I'm going to add that in right now!

http://stackoverflow.com/a/28394150
answers question: http://stackoverflow.com/q/28394067
type: Answer
upvote count: 1
downvote count: 1
has body: Try this, which clones the node and appends it to an element. $(document).ready(function() { $('.item-input').on('keyup', function (e) { var itemName = $.trim($(this).val()); if (itemName != '') { var templateRow = $(".template-row").clone(); templateRow.appendTo('table').removeClass('template-row').addClass("row"); } }); });
score: 0

http://stackoverflow.com/comment/45105084
type: Comment
type: QuestionComment
has text: so I want execute a function after form is submit.
comment on: http://stackoverflow.com/q/28383524
score: 0

http://stackoverflow.com/comment/44947079
has text: You shouldn't need to suspend compilation/linking. Could you provide more details why you would do that? I can't think of a good reason
comment on: http://stackoverflow.com/q/28297361
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/44936331
score: 1
type: AnswerComment
has text: *"your current implementation is returning an array"* Actually, either it's a syntax error or if ES6 syntax enabled, it's an object with a property `optionList`.
comment on: http://stackoverflow.com/a/28291469
type: Comment

http://stackoverflow.com/comment/44938240
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28292609
has text: How about this.. /^([a-zA-Z]{2}\d{6}[a-zA-Z])$/ ?

http://stackoverflow.com/q/28315126
answer count: 1
tagged with: meteor
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28315359
tagged with: css
type: Question
has title: Meteor Parse json results into span or div?
tagged with: http://stackoverflow.com/tag/json
has body: I am trying to make a page using meteor that displays the latest powerball results. So far I have a working page using: RESULTS.JS Template.results.helpers({ results: function () { return Session.get('lottery-results'); }, winning: function() { return Session.get('winning') } }); Template.results.rendered = function(){ Session.set('lottery-results', []); HTTP.get("http://data.ny.gov/resource/d6yy-54nr.json", function (err, result) { Session.set('lottery-results', JSON.parse(result.content) ); }); }; Template.results.events({ 'change #date': function (e, tmpl) { Session.set('winning', $('#date option:selected').data('winning')) } }); Template.results.destroyed = function(){ Session.set('winning', []); }; and RESULTS.HTML Select a date {{#each results}} {{dateFormat draw_date format="MM/DD/YYYY"}} {{/each}} {{ winning }} I want to style the results so that the numbers come out inside of a ball. The first 5 numbers would be one style (white balls)and the last number< the powerball, would be it's own style (red ball). I think I need to somehow parse the results into spans or divs but I don't know how. Suggestions?
tagged with: javascript
score: 0

http://stackoverflow.com/q/28311047
has title: How to update page after AJAX file upload?
score: 0
has body: I'm trying to come up with a way to display a progress bar for file uploads to my site. So far I came up with the following: HTML: Current Progress: JavaScript: function btnAddClkd() { var frm_obj = document.getElementById("frmUpload"); if(frm_obj != undefined) { var ajaxOK = false; if(frm_obj.action) { try { var objFrm = document.forms['frmUpload']; if(objFrm != undefined) { var fd = new FormData(objFrm); var xhr = new XMLHttpRequest(); if(xhr != undefined) { xhr.upload.addEventListener("progress", uploadProgress, false); xhr.addEventListener("load", uploadComplete, false); xhr.addEventListener("error", uploadFailed, false); xhr.addEventListener("abort", uploadCanceled, false); xhr.open("POST", frm_obj.action); xhr.send(fd); ajaxOK = true; } } } catch(e) { ajaxOK = false; } } if(!ajaxOK) { //Failed to send with ajax, use regular method frm_obj.submit(); } return false; } return true; } function uploadProgress(evt) { var objPerc = document.getElementById('idPerc'); if(objPerc != undefined) { if(evt.lengthComputable) { var percentComplete = Math.round(evt.loaded * 100 / evt.total); objPerc.innerHTML = percentComplete.toString() + '%'; } else { objPerc.innerHTML = "-"; } } } function uploadComplete(evt) { var objPerc = document.getElementById('idPerc'); if(objPerc != undefined) { objPerc.innerHTML = "Done"; } } function uploadFailed(evt) { var objPerc = document.getElementById('idPerc'); if(objPerc != undefined) { objPerc.innerHTML = "Failed"; } } function uploadCanceled(evt) { var objPerc = document.getElementById('idPerc'); if(objPerc != undefined) { objPerc.innerHTML = "Canceled"; } } This concept works for the progress bar while a large file is uploading, but when the upload is done, the web server (or upload/files.php page) returns the result as a generated HTML page. So my question is how to get that HTML to be displayed? (Currently my upload finishes and my message shows, "Current Progress: Done" and that's it.)
type: Question
tagged with: upload
tagged with: javascript
tagged with: ajax
has answer: http://stackoverflow.com/a/28311104
tagged with: http://stackoverflow.com/tag/html
answer count: 1
type: UnansweredQuestion

http://stackoverflow.com/comment/44973737
type: Comment
type: QuestionComment
has text: That's what i thought. I can't give it a constant size because sometimes it can be smaller.
score: 0
comment on: http://stackoverflow.com/q/28311409

http://stackoverflow.com/a/28342842
has body: In the option tag, the attribute selected doesn't need a value: Delivery is the same as Delivery check it here: http://jsfiddle.net/n99L2xhv/1/
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28342551

http://stackoverflow.com/q/28409739
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45153416
type: Question
has answer: http://stackoverflow.com/a/28410770
has comment: http://stackoverflow.com/comment/45153983
tagged with: javascript
has comment: http://stackoverflow.com/comment/45153924
score: 0
answer count: 1
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28410770
has body: I included css3 animate it on scroll: http://jackonthe.net/css3animateit/ the animations are working. the problem is the animations are not working on scroll-reveal. i am using onepage-scroll.js. this is my body: I am Leon Laci Front End Web Developer About Me this is how the site looks: http://leonlaci.tk/test/
has title: CSS3 Animate it on scroll not working
tagged with: animation

http://stackoverflow.com/comment/44922800
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28284357
has text: Please post all code that would be relevant, not just what you think is relevant. Creating a http://jsfiddle.com would also be helpful. The answer is usually not where we initially think it is.
score: 0

http://stackoverflow.com/q/28290581
has title: angularjs - ng-show doesn't update class when $interval triggers
answer count: 1
downvote count: 0
tagged with: angularjs-ng-repeat
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28290614
type: AnsweredQuestion
score: 2
upvote count: 2
has body: Trying to use $interval from angular to change the currently visible item in a list using ng-show. Inspecting the html, I noticed that angular changes ng-show from true/false, but it doesn't remove the ng-hide class. The html is simple: Hello Plunker! Iterator: {{i}} {{i}} - {{$index}} - {{d}} The app.js is quite basic as well: (function(){ var app = angular.module('MyApp', ['my-controller']); })(); and my module/controller (function(){ var app = angular.module('my-controller', []); app.controller('MyCtrl', ['$scope', '$interval', function($scope, $interval){ $scope.data = [111, 222, 333, 444]; $scope.i = 0; var timeoutId; timeoutId = $interval(function(){ $scope.i ++; if ($scope.i >= $scope.data.length) $scope.i = 0; }, 1000); }]); })(); Here's my plnkr
type: Question
accepted answer: http://stackoverflow.com/a/28290614
tagged with: javascript
tagged with: angularjs-scope

http://stackoverflow.com/q/28326774
score: 8
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: audio
downvote count: 0
has answer: http://stackoverflow.com/a/62436373
has body: We need to replace our NPAPI browser plugin with a plugin-less solution. We have 3rd party input device that provides us live audio in the form of Opus 'frames'. We transmit those frames to the browser using binary WebSockets; and then, forward the data to our NPAPI plugin for decoding and audio playback. See picture. What approach should we take to replace the NPAPI plugin with an HTML5-ish solution given these requirements? Minimize end-to-end latency to no more than 3-5s (assumes 200mS round trip network latency). Provide a means to apply audio filters (client/browser side) Using the html5 audio tag seems to introduce a huge amount of latency as various browsers will require a certain amount of buffering (15-30s of audio) before beginning playback. We understand Opus may or may not be supported on all browsers. If needed (though we'd rather not to reduce bandwidth), we could encapsulate the Opus frames into a Ogg container within the web service before sending the data to the browser. Looking at one of the demos from html5rocks, HTML5 Audio Playground, it appears as though #2 is possible. If this is a poor place to ask such a design question, please suggest other forums/groups that might be more appropriate. Thanks for any help or suggests you might offer.
tagged with: html5-audio
upvote count: 8
type: Question
has answer: http://stackoverflow.com/a/77337175
has answer: http://stackoverflow.com/a/28333569
tagged with: audio-streaming
has title: HTML5: Playing live Opus audio frames without browser plug-in
tagged with: javascript
answer count: 3

http://stackoverflow.com/q/28330491
type: AnsweredQuestion
has body: When you use the flag 'showColumnMenu' with true value. the ng-grid is rendered with button on the right end top panel. Using this button we can hide/show the column on the grid. In my Case I don't want to make it possible for some column to be visible on the grid - Meaning I want the the column menu box will be rendered with out some column. Iv'e created plunker which demonstrated my problem &gt; http://plnkr.co/edit/VXOzBIRfyY3FoCTct9PI?p=preview In that plnkr - I set column 'Id' to be invisible using (visible: false) But if the user click on the column menu on the right end panel he will be able to set it visible.. EDIT Another scenario that I need to cover is case where there is some other column say 'name' that I don't want the let the user configure it (by setting it as invisible) inside the column menu - meaning that column 'name' must always be on the grid! and the user does not need to see it in the column menu.. So, if only i could hide those columns (id,name) inside the column menu my problem will be solved.. Thanks!
tagged with: javascript
answer count: 2
tagged with: ng-grid
tagged with: multiple-columns
tagged with: angularjs
has answer: http://stackoverflow.com/a/28353663
has answer: http://stackoverflow.com/a/28363828
possible better answer: http://stackoverflow.com/a/28353663
score: 0
accepted answer: http://stackoverflow.com/a/28363828
tagged with: grid
has title: Angular ng- grid - hide/remove column input from column menu
type: Question

http://stackoverflow.com/comment/44922452
type: QuestionComment
has text: **while(whatever){echo ' '.$supplier.' '; }** You'll need to show us the popup script if you need help there too.
score: 0
comment on: http://stackoverflow.com/q/28284115
type: Comment

http://stackoverflow.com/a/28290001
has comment: http://stackoverflow.com/comment/44933711
upvote count: 2
has comment: http://stackoverflow.com/comment/44933754
has comment: http://stackoverflow.com/comment/44933684
accepted answer of: http://stackoverflow.com/q/28289905
has body: When you send a information back, you must end the stream of information. You do this by calling end(). Sending the status code 404 can still be followed by content, such as a custom 404 page, rather than the browser showing you the default This page can not be found (Old, but an example of Chrome's built-in 404 page). If you do not end the request, the browser will keep waiting for the end of the stream and report a timeout after a certain amount of time. res.send() automatically closes the request for you, so that you don't have to call end() manually.
has comment: http://stackoverflow.com/comment/44933749
answers question: http://stackoverflow.com/q/28289905
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44971816
type: Answer
score: 2

http://stackoverflow.com/comment/45021013
score: 0
has text: Sir, I said I don't know advance and pure javascript I know basic Javascript.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28337537

http://stackoverflow.com/a/28326120
has comment: http://stackoverflow.com/comment/45000322
has comment: http://stackoverflow.com/comment/45025136
has comment: http://stackoverflow.com/comment/45025358
has comment: http://stackoverflow.com/comment/45000237
has comment: http://stackoverflow.com/comment/45000023
has comment: http://stackoverflow.com/comment/45035015
has comment: http://stackoverflow.com/comment/45005181
has comment: http://stackoverflow.com/comment/45034807
score: 0
answers question: http://stackoverflow.com/q/28309029
has body: You can use the offsetLeft and offsetTop properties to get the position of an element relative to its offsetParent. Here's a quick example, taking into account the fact that an element's offsetParent may be a table cell without positioning as you so rightly point out: function positionOver(targetNode) { var el = document.createElement("div"), left = targetNode.offsetLeft, top = targetNode.offsetTop, testParent = targetNode.offsetParent; while (testParent) { if ( testParent.tagName === "TD" || testParent.tagName === "TH" || testParent.tagName === "TABLE" ) { left += testParent.offsetLeft; top += testParent.offsetTop; } testParent = testParent.offsetParent; } el.style.left = left + "px"; el.style.top = top + "px"; el.classList.add("created"); targetNode.parentNode.appendChild(el); } // Create and position a new element over #target positionOver(document.querySelector("#target")); CSS .created { position: absolute; background: red; z-index: 10; width: 10px; height: 10px; } Fiddle here. Note that the above function won't work as expected if the targetNode is inside an absolutely positioned table.
type: Answer

http://stackoverflow.com/a/28357722
type: AcceptedAnswer
score: 6
type: Answer
has comment: http://stackoverflow.com/comment/45058777
has comment: http://stackoverflow.com/comment/45058772
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28357662
has body: I think this is what you want: (function(){ var Person = function(name){ this.name = name; }; Person.prototype.getName = function(){ return this.name; }; var arif = new Person("Arif"); console.log(arif.getName()); })(); Basically, you need to define "getName" on the prototype line, and the syntax you were using on the line with .prototype was trying to call it (before it was defined).
answers question: http://stackoverflow.com/q/28357662
has comment: http://stackoverflow.com/comment/45058756
upvote count: 6

http://stackoverflow.com/a/28385179
has comment: http://stackoverflow.com/comment/45108429
upvote count: 3
score: 3
has comment: http://stackoverflow.com/comment/45109304
downvote count: 0
answers question: http://stackoverflow.com/q/28384718
has body: /(?:[^laeiouy]es|ed|[^laeiouy]e)$/ That matches three possible substrings: a letter other than 'l' or a vowel followed by 'es' (like "res" or "tes"); 'ed'; or a non-vowel, non-'l' followed by just an 'e'. Those patterns must appear at the end of the word to match because of the $ at the end of the pattern. The grouping (?: ) is just a grouping; the leading ?: makes that distinction. The pattern could have been a little shorter: /(?:[^laeiouy]es?|ed)$/ would do the same thing. In any case, if the pattern matches the characters involved are removed from the word. Then, /^y/ matches a 'y' at the beginning of a word. If a 'y' is found, it's removed. Finally, /[aeiouy]{1,2}/g matches any one- or two-character stretch of vowels (including 'y'). The g suffix makes it a global match, so that the return value is an array consisting of all such spans of vowels. The length of that returned array is the number of syllables (according to this technique). Note that the words "poem" and "lion" would be reported as one-syllable words, which may be correct for some English variants but not all. Here is a pretty good reference for JavaScript regular expression operators.
type: Answer

http://stackoverflow.com/comment/45077152
comment on: http://stackoverflow.com/q/28368079
has text: at what point are you showing it? can you post the full code?
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45177329
has text: I did what you suggested. It still says Unexpected request: GET /api/product/undefined expect GET /api/product/12345 +1 though
comment on: http://stackoverflow.com/a/28421866
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45122175
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28392679
has text: @EdHeal I believe almost all these fields are hidden
type: QuestionComment

http://stackoverflow.com/comment/45013798
type: Comment
score: 0
type: QuestionComment
has text: Works for me as well on chrome stable.
comment on: http://stackoverflow.com/q/28333442

http://stackoverflow.com/comment/45084641
has text: Change `text = $(this).text()` to `text = $(this).html()` then you can add the anchor tags. However, this will probable cause the browser to redirect to the link, because it was clicked inside the button.
comment on: http://stackoverflow.com/a/28360869
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45183649
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28425741
has text: or `^(?!#)(\S+) *= *(.+?)(?= +#|$)`

http://stackoverflow.com/comment/44925012
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28285244
has text: yes, the url changes
score: 0

http://stackoverflow.com/comment/45152711
type: Comment
type: QuestionComment
has text: i did have custom implementation of angular-timer directive. please [look here](http://stackoverflow.com/questions/26450240/does-angularjs-help-out-in-any-way-when-it-comes-to-have-a-duration-counter-on-m), and [here](http://stackoverflow.com/questions/26775808/angular-timer-directive-not-working-with-ionic-framework) bascially the angular-timer is jquery based, hence i dont like it much
comment on: http://stackoverflow.com/q/28312575
score: 0

http://stackoverflow.com/comment/45051907
type: QuestionComment
comment on: http://stackoverflow.com/q/28353979
type: Comment
score: 0
has text: And the html looks like?

http://stackoverflow.com/a/29281787
type: Answer
answers question: http://stackoverflow.com/q/28372340
has body: Ignoring the already-mentioned errors here (invalid HTML, invalid PHP, etc.), your easiest (and best) solution to this is simply to refactor your code so it doesn't return the HTML/JS. Just put all of the HTML/JS that is currently being returned by the PHP into your page and hide it. Have the PHP return a status code of some sort ("invalid-email"/"ok"/"taken", etc.) and have jQuery hide/unhide the appropriate response on the page. This keeps a separation of concerns between your presentation and your business logic.
score: 0

http://stackoverflow.com/comment/45091069
has text: Either way, this will solve it I think, and just run a second with `&lt;` replaced by `$1>`
type: Comment
comment on: http://stackoverflow.com/a/28375319
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45090926
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28360869
has text: Unfortunately it doesnt work. Here is JSFiddle of product I am making: http://jsfiddle.net/qyac6n3d/embedded/result/. Tha I tried with CKEditor to insert anchor tags after pasting text... but it doesnt work either http://jsfiddle.net/qyac6n3d/2/embedded/result/

http://stackoverflow.com/a/28389708
answers question: http://stackoverflow.com/q/28382989
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28382989
type: Answer
score: 1
upvote count: 1
has body: The structure of your JSON file allows for simple slicing: it contains several chunks of "projects" (7097 to be exact). These "projects" are the highest level and contain itself a different amount of individual projects. It is quite easy to rip the large file at these seam-lines apart, a couple lines of Perl will do so (Perl because it is available for a large choice of operating systems and handles large files quite easily): #!/usr/bin/perl use strict; my $flag = 0; my $count = 0; my $start = "Kickstarter_Kickstarter_"; my $ending = "_.jison"; my $filename = ""; open (FILE, '&lt;', 'Kickstarter_Kickstarter.json') or die "file opening failed: $!"; while (&lt;FILE&gt;) { if (/"projects": \[/){ if($flag == 0){ $flag = 1; $filename = $start.$count.$ending; open (CHUNK, '&gt;&gt;', $filename) or die "file opening failed: $!"; print STDOUT "Writing a chunk to ".$filename."\n"; $count++; print CHUNK "{ ".$_; next; } if ( $flag == 1){ close (CHUNK) or die "file closing failed: $!"; $flag = 0; } } if(tell(CHUNK) != -1){ print CHUNK $_ unless /^\,{/; } close (FILE) or die "file closing failed: $!"; (will only work for this specific file!) This will place every of these "projects" chunks into its own, numbered file. You can do what you want with it (put them into ten folders, for example), but I would recommend to use the JSON parser you are most familiar with and index these files, that is: choose one or more of the entries (e.g.: id, name, goal, created_it and so on) and make one file per entry for connecting entries with the individual files. That way you only have to search these small files instead of the whole heap. I have not checked it but some entries might have multiple occurrences (e.g.: you might find several people named Smith) so simple tuples will most probably not do it.

http://stackoverflow.com/comment/45170824
type: Comment
score: 0
has text: @RichardCotrina It's dynamically created from files in the app.data folder so I don't have a javascript code snippet that creates the object to show you. I could write one out, it just would take a bit since it's big. Here is a better shot of the relevant objects from in chrome inspector: http://i.imgur.com/rcdoY4X.png Does that help?
comment on: http://stackoverflow.com/q/28418412
type: QuestionComment

http://stackoverflow.com/comment/45154796
has text: @bluestrattos Well, on the other hand I'm not quite sure about the last bit because I'm quite newbie with AngularJS so the question how to use the controller and the view in optimal way in this question is still unclear to me.
score: 0
comment on: http://stackoverflow.com/q/28369572
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44943819
has text: Your question doesn't make any sense if you don't show us how you are trying to _use_ the filter. Please add the relevant view HTML to your question.
score: 0
comment on: http://stackoverflow.com/q/28295241
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45128770
type: QuestionComment
type: Comment
has text: This should help - http://stackoverflow.com/questions/14796936/how-do-you-detect-when-css-animations-start-and-end-with-javascript
comment on: http://stackoverflow.com/q/28395977
score: 0

http://stackoverflow.com/q/28285502
has body: Is it possible to have a "lazy search" with JsTree where the search results can be a path that include nodes not currently in the tree? I have a large tree that I am node loading lazily and would like to be able to handle searches that include nodes not currently loaded. So far the only thing that works for me is using the search callback and replacing all of the data in the tree and refreshing. I was wondering if there was a less hacky way to accomplish this. The old documentation seems to imply so: "This object can be used to make a request to the server on each search - useful if you are using async trees. That way you can return an array of IDs that need to be loaded before the actual DOM search is performed (so that all the nodes that will match the search are loaded). For example if the user searches for "string", you get that on the server side, check the database and find out that there is a node containing that string. But the node is the child of some other node, etc - so in your response you must return the path to the node (without the node itself) as ids: ["#root_node","#child_node_3"]. This means that jstree will load those two nodes before doing the client side search, ensuring that your node will be visible." I tried testing this out with the following code. The search does trigger a url call but jsTree doesn't seem to be using the response or throwing an error if the nodes I return does not exist. I also do not see another query to the server, which presumably would be needed for nodes that don't already exist in the tree: tree goes here The solution at jsTree asynchronous search - trigger load new nodes doesn't seem to work for me. jsTree doesn't seem to be doing anything with the response from the server.
has title: jsTree lazy search
type: Question
tagged with: jstree
upvote count: 5
score: 5
answer count: 1
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/20310156
favorite count: 0
linked to: http://stackoverflow.com/q/31646186
type: UnansweredQuestion
tagged with: jstree-search
has answer: http://stackoverflow.com/a/31653529

http://stackoverflow.com/comment/45026899
type: QuestionComment
comment on: http://stackoverflow.com/q/28340731
type: Comment
has text: What browser(s) is this a problem in? I ask because there's a couple of down-voted answers that seem like they should be correct, and I don't know if I'm missing something.
score: 0

http://stackoverflow.com/a/28346812
has body: The last snippet is roughly equal to var test = 1; (function(){ var test; // it is undefined here as it is not initialized yet console.log(test); // undefined test = 2; // initialized console.log(test); // hence 2 })(); due to the fact that the variable declaration is hoisted to the top of the function. So, when you log test it is undefined and is over-shadowing the test which is outside.
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28346751
type: Answer
accepted answer of: http://stackoverflow.com/q/28346751
score: 1
upvote count: 1

http://stackoverflow.com/comment/45570482
has text: Haven't found a real solution to this, but the current workaround that avoids the flicker I mentioned is to actually call the `dayRender` function on each day in the calendar myself. Before you can do that, you must reset the day. This is somewhat non-trivial if you have to remove classes from the days, since you'd have to reapply several classes (including the day of the week, future, past, and current day classes). The date can fortunately be obtained via the `data-date` attribute on the cell.
type: QuestionComment
comment on: http://stackoverflow.com/q/28401749
score: 0
type: Comment

http://stackoverflow.com/comment/45191109
comment on: http://stackoverflow.com/a/28430095
score: 0
type: AnswerComment
has text: Oh I did not notice the call. The code should work: http://jsfiddle.net/w3Lr0vgk/
type: Comment

http://stackoverflow.com/comment/45193833
has text: probably you should use TRY ... CATCH block.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28431505

http://stackoverflow.com/a/28345742
score: 1
answers question: http://stackoverflow.com/q/28296354
has body: You are pushing javascript object into dataLayer. Inside of an object all the properties (ecommerce, event are in fact properties of an object) are indexed based on their name, not some number like in arrays, and they are further called precisely using their names. Objects in Javascript does not guarantee any order in their properties. Concluding, sequence in which you define properties in an object does not matter as they will be further "unordered", even in the moment of pushing it to the dataLayer.
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28296354
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45036845
type: Answer

http://stackoverflow.com/comment/45039288
type: QuestionComment
has text: For the selectOneMenu you miss the wrapping element with the ui-widget class
score: 0
comment on: http://stackoverflow.com/q/28344182
type: Comment

http://stackoverflow.com/q/28377488
answer count: 2
upvote count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28377519
favorite count: 0
has comment: http://stackoverflow.com/comment/45095102
tagged with: regex
has answer: http://stackoverflow.com/a/28377568
type: AnsweredQuestion
has title: Strip all trailing whitespace except last new line
downvote count: 0
score: 1
has body: Say I have a string: var str = 'I am a \nmultiline \nString.\n' How can I replace all trailing whitespace characters with '', except for the last \n? I have tried: str.replace(/\s+$/gm, '') But that returns "I am a\nmultiline\nString." and I would like to have something like "I am a\nmultiline\nString.\n"
type: Question
accepted answer: http://stackoverflow.com/a/28377519
possible better answer: http://stackoverflow.com/a/28377568

http://stackoverflow.com/comment/44946254
score: 12
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28296971
has text: MDN also has the polyfill: `Math.log10 = function (x) { return Math.log(x) / Math.LN10; };`

http://stackoverflow.com/comment/45059048
has text: price is set from page 1 and 2, out of 5 pages, its on page 3 that the calculations are made as that is where the user can select upgrades
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28357606
score: 0

http://stackoverflow.com/comment/44990624
score: 0
has text: @haxbh bang on the money. The error changes to Uncaught Error: [$injector:modulerr] Failed to instantiate module yoangfull2App due to: Error: [$injector:unpr] Unknown provider: $routeProvider
comment on: http://stackoverflow.com/q/28320204
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28327877
tagged with: http://stackoverflow.com/tag/jpeg
tagged with: webcam
answer count: 0
type: Question
has title: Post jpeg data to URL to image stream
has comment: http://stackoverflow.com/comment/45004032
tagged with: h.264
tagged with: javascript
has comment: http://stackoverflow.com/comment/45004103
has body: I am trying to set up a video feed from a microcontroller system. I am able to get data in JPEG format from an image sensor and post it to my webserver. I wish to display the stream of images that will be continually posted to the server in the form of a webcam stream. I have no idea where to start to get decent playback speed. How would I go about doing this without having a full page refresh every time the image is posted?
score: 0
has comment: http://stackoverflow.com/comment/45003393
type: UnansweredQuestion
tagged with: ruby-on-rails

http://stackoverflow.com/a/28425384
has comment: http://stackoverflow.com/comment/45183425
type: Answer
upvote count: 0
score: -1
downvote count: 1
has body: Run this code and check if it is still coming. I could not reproduce the error.
answers question: http://stackoverflow.com/q/28425273
has comment: http://stackoverflow.com/comment/45183112

http://stackoverflow.com/comment/45117500
has text: `seamless` would work great, except that almost no browser is supporting it (yet). source: http://caniuse.com/seamless
type: Comment
comment on: http://stackoverflow.com/a/28389938
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45167847
type: QuestionComment
score: 1
has text: You can try `google.maps.event.addListener(name, 'click', function (e) { //your code here});` inside your each link before `map.addLayer(name);`
comment on: http://stackoverflow.com/q/28386532
type: Comment

http://stackoverflow.com/q/28389684
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28418544
accepted answer: http://stackoverflow.com/a/28578845
has body: Edit: Overhauling the question and example, to try and narrow in on this. In local development I had avoided this issue by having ws and http each handled by their own server on their own port, and I'm running into some issues trying to get set on OpenShift, where I'm limited to a single port. I'm trying to set up a simple Websocket based chat system using Node on OpenShift, and I'm clearly doing something wrong - I've set up a simple server which delivers my index page as expected, but when that page requests a Websocket connection, the server tries to answer it as a regular HTTP request instead of upgrading the connection as expected. Live Version Server: var ip = process.env.OPENSHIFT_NODEJS_IP || '127.0.0.1'; var port = process.env.OPENSHIFT_NODEJS_PORT || 8080; var ws = require( 'ws' ).Server; var http = require( 'http' ); var path = require( 'path' ); var fs = require( 'fs' ); // Create main HTTP server for the application var httpServer = http.createServer( function( request, response ){ console.log( 'REQUEST: ' + request.url ); var filename = path.join( process.cwd(), request.url ); fs.exists( filename, function( exists ){ fs.readFile( filename, 'binary', function( err, file ){ if ( err ){ console.log( 'FILE ERROR: ' + request.url ); response.writeHead( 500, {"Content-Type": "text/plain"} ); response.write( "500 - File Error\n" + err + "\n" ); response.end(); return; } response.writeHead( 200 ); response.write( file, 'binary' ); response.end(); } ); } ); } ).listen( port, ip, function(){ console.log( 'Server is listening at http://' + ip + ':' + port ); } ); // Create WebSocket server and begin listening wsServer = new ws( { server: httpServer } ); wsServer.on( 'connection', function( connection ){ console.log( 'New websocket connection...' ); connection.on( 'message', function( message ){ connection.set( 'Received: ' + message ); } ); connection.send( 'welcome!' ); }); Client / Index Page: Connecting...
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28418544
answer count: 2
has title: Node HTTP and WS server doesn't upgrade connection as expected
has comment: http://stackoverflow.com/comment/45120126
downvote count: 0
tagged with: websocket
linked to: http://stackoverflow.com/q/27894058
favorite count: 0
has comment: http://stackoverflow.com/comment/45183136
has answer: http://stackoverflow.com/a/28578845
tagged with: web-services
tagged with: openshift
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45128037

http://stackoverflow.com/q/28338974
answer count: 4
has answer: http://stackoverflow.com/a/28339028
has answer: http://stackoverflow.com/a/28339008
has body: I'm trying to get this function to show 'true' or 'false' depending on my if-statement. The function should return boolean 'true' if 'value' is greater than 'rangeStart' and less than 'rangeStop'. Otherwise it should return boolean 'false'. var inRange = function(rangeStart3,rangeStop3,value) { if (value &gt; rangeStart3&amp;&amp;value &lt; rangeStop3) return inRange; }; ANSWER = inRange(167,521,264) I'm getting answer "undefined" and not sure what I'm doing wrong. I would also like to add that I'm very new to Javascript!
type: AnsweredQuestion
tagged with: if-statement
possible better answer: http://stackoverflow.com/a/28339008
type: Question
accepted answer: http://stackoverflow.com/a/28339028
has title: If statement returning undefined
tagged with: javascript
has answer: http://stackoverflow.com/a/28339022
has answer: http://stackoverflow.com/a/28339021
score: 0

http://stackoverflow.com/q/28405444
linked to: http://stackoverflow.com/q/28365233
has title: Inline CSS styles in React: how to implement media queries?
has answer: http://stackoverflow.com/a/28415346
linked to: http://stackoverflow.com/q/35073669
has answer: http://stackoverflow.com/a/45656540
has answer: http://stackoverflow.com/a/62318661
tagged with: reactjs
has answer: http://stackoverflow.com/a/72028652
downvote count: 0
answer count: 7
tagged with: javascript
favorite count: 0
score: 57
has comment: http://stackoverflow.com/comment/45145417
upvote count: 57
has body: I quite like the inline CSS pattern (video) in React and i am thinking about using it. However i have a question similar to this one. How does one go about implementing media queries for an application using React's inline CSS pattern.
has answer: http://stackoverflow.com/a/78192998
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28411831
has answer: http://stackoverflow.com/a/63199250
type: Question

http://stackoverflow.com/a/28429217
type: Answer
has body: The problem is that "string.concat" is a null pointer, what is "string" in your context? The "string" variable should be the original string. I guess what you are trying to achieve is: var pagina = "edi.do?serv=3.C&amp;ids=".concat(value); You can also do as Marius suggested: var pagina = "edi.do?serv=3.C&amp;ids="+value;
answers question: http://stackoverflow.com/q/28429116
upvote count: 1
score: 1
downvote count: 0

http://stackoverflow.com/comment/45037575
has text: downvoted, mine isn't a child of the tag and it works, as long as it comes after the a that triggers it most of the time you can get it with pure css
comment on: http://stackoverflow.com/a/28346630
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28415494
accepted answer of: http://stackoverflow.com/q/28415316
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28415316
has body: Web methods have to be static. It is impossible to have an instance web method. The reason is the way they are designed. Web methods do not have any state, or any relation to the rest of the page. There is no reason to go through the whole ASP.NET pipeline of creating a page object and all its life cycle. They also do not need to process the viewstate field that is required for page object creation. And as methods totally detached from the page object, they have to be declared as static to function properly. In return web methods offer a very good performance compared to regular ASP.NET pages or update panels.

http://stackoverflow.com/a/68898419
score: 2
has body: By default, the Sequelize association is considered optional. If you would like to make the foreign key required, you can set allowNull to be false. Foo.hasOne(Bar, { foreignKey: { allowNull: false } }); See the docs
upvote count: 3
downvote count: 1
answers question: http://stackoverflow.com/q/28401465
has comment: http://stackoverflow.com/comment/139130604
type: Answer

http://stackoverflow.com/q/28372474
type: Question
has body: I have a score formula (example): score = (price^2) * (distance^0.5) * (popularity/0.5) I want to visualize the impact of each factor on the score for specific score (for example score = 100 so the chart should express the contribute of each factor for the score). What is the proper way to do this ? In case the formula was addition formula then bar chart which combined all factors with their relative impact was a good choice to show the impact of each factor on the score, but in case of multiplicity bar chart is not an option. I am looking for a single chart which will express each factor impact. I plan to do this in javascript.
tagged with: data-visualization
has title: How to express factors multiplication in visualization?
score: 0
has comment: http://stackoverflow.com/comment/45183715
has comment: http://stackoverflow.com/comment/45085942
has comment: http://stackoverflow.com/comment/45168653
has comment: http://stackoverflow.com/comment/45085959
tagged with: google-visualization
has comment: http://stackoverflow.com/comment/45086021
has comment: http://stackoverflow.com/comment/45085443
has comment: http://stackoverflow.com/comment/45085455
answer count: 0
has comment: http://stackoverflow.com/comment/45122307
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45123101
tagged with: visualization
has comment: http://stackoverflow.com/comment/45086094
has comment: http://stackoverflow.com/comment/45085879

http://stackoverflow.com/q/28288381
possible better answer: http://stackoverflow.com/a/28288506
accepted answer: http://stackoverflow.com/a/28288521
has answer: http://stackoverflow.com/a/28288534
score: 1
upvote count: 1
type: Question
has body: I'm trying to change the border color of the label border based on if a file is selected or not. I am using the following jQuery and it always runs the first if statement resulting in a red border. I'm thinking that something is wrong with my if statement but I'm not sure. Select File $("#file").click(function(e) { if ($("#file").val().length == 0) { $("#file_display").css("border", "5px solid red"); } else { $("#file_display").css("border", "5px solid green"); } });
tagged with: javascript
answer count: 3
has answer: http://stackoverflow.com/a/28288521
downvote count: 0
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28288506
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has title: Change color of border on file upload based on if file is selected or not

http://stackoverflow.com/a/28376696
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28376408
has body: I do not know d3 very well. I figured out it is a library, but you need to specify what frameworks/libraries you are using in the question. It is my understanding that you have a .txt file and in the file is a list of .csv files (one per line) that you want to read in. To do this use ajax, I do not know d3 so I will use jQuery. $.ajax({ url: "./filestoplot.txt", success: function(x){ x = $.trim(x).split("\n"); // Make array from new lines /* x is now an array that looks like: ["file1.csv","file2.csv","file3.csv"] do what you want with it here */ } }); If I misinterpreted the question let me know in this answers comments and I will attempt to better answer the question. You need to be as specific as possible when asking a question and make sure to state any frameworks/libraries you may be using.
answers question: http://stackoverflow.com/q/28376408
upvote count: 1
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/44959241
comment on: http://stackoverflow.com/a/28303428
score: 0
type: AnswerComment
has text: Your code works perfectly fine i am trying to use mine to do nearly the same however with a marker, so that i can input the values and place a marker there... can i use those boxes as well for this particular use?
type: Comment

http://stackoverflow.com/comment/45080734
type: AnswerComment
has text: You're missing quotes around the ID.
comment on: http://stackoverflow.com/a/28370035
type: Comment
score: 1

http://stackoverflow.com/comment/45147507
has text: This is a function for that message.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28406157
score: 0

http://stackoverflow.com/comment/44985434
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28318049
has text: $scope.$apply(function(){
score: 0

http://stackoverflow.com/a/28403657
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45153599
has body: An easy way to handle this would be have two separate tables, and toggle between them when you edit a table. So for example we have a table that shows our normal data called shown and one with the input and select for a user to enter data called edit. These tables will share the same button, and when clicked it will toggle between the tables, making it look like it's switching between edit and show mode. This way we can just copy the values from the edit table to the text in the shown table. Here is an example: $("#edit").hide(); // Hide the edit table first $("#update").click(function() { $("#edit").toggle(); $("#shown").toggle(); // If we are going from edit table to shown table if($("#shown").is(":visible")) { // Get the data from the edit table var newSales = $("#edit tr:nth-child(1) td input[name='vouchertype']").val(); var newPay = $("#edit tr:nth-child(1) td select[name='mode']").val(); var newTax = $("#edit tr:nth-child(2) td select[name='tax']").val(); // Then add it to the shown table $("#shown tr:nth-child(1) td:nth-child(2)").text(newSales); $("#shown tr:nth-child(1) td:nth-child(3)").text(newPay); $("#shown tr:nth-child(2) td:nth-child(1)").text(newTax); $(this).val("Edit"); } else $(this).val("Update"); }); Sr no Sales Paid in Taxed Sr no Paidin Paidout Taxed Not Taxed Notice: This is an answer to the original question, which is quite different then the new question added in as an edit.
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/45142644
accepted answer of: http://stackoverflow.com/q/28403148
upvote count: 1
answers question: http://stackoverflow.com/q/28403148
has comment: http://stackoverflow.com/comment/45163393
downvote count: 0
has comment: http://stackoverflow.com/comment/45153740

http://stackoverflow.com/q/28416895
has comment: http://stackoverflow.com/comment/45211191
tagged with: cordova
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45208135
type: Question
has body: I am doing an app which has a side menu when clicking on one if the side menu items the app loads the linked template to that state correctly. However the controller of that state is not loaded at all. I tried debugging and checking the console but nothing. please may I get some help in that ?! This is the code I am running for the side menu : ` Navigation COE COBA CAS ` And this is my controller.js file code : angular.module('starter.controllers', []) .controller('homeController', function($scope) { }) .controller('COEController', function($scope) { console.log(" COEController is loaded"); }) ; Plus the app.js file : angular.module('starter',['ionic','angularCircularNavigation','starter.services', 'starter.controllers']) .run(function($ionicPlatform) { $ionicPlatform.ready(function() { 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) { $stateProvider .state('app', { url: "/app", abstract: true, templateUrl: "templates/menu.html" }) .state('app.home', { url: "/home", views: { 'menuContent' :{ templateUrl: "templates/home.html", controller: "homeController" } } }) .state('app.COE', { url: '/COE', views: { 'menuContent' :{ templateUrl: "templates/COE.html", controller: "COEController" } } }) ; $urlRouterProvider.otherwise('/app/home'); }); And these are the errors I am getting : Uncaught ReferenceError: rippleExtensionId is not defined (anonymous function) bootstrap.js:2 (anonymous function) bootstrap.js:2 GET http://localhost:63342/AdvisingAppV3/www/logo.png 404 (Not Found) (anonymous function) ionic.bundle.js:10615 forEach ionic.bundle.js:7950 forEach.append ionic.bundle.js:10613 JQLite.(anonymous function) ionic.bundle.js:10735 IonicModule.run.factory.getRenderer.enter ionic.bundle.js:39394 updateView ionic.bundle.js:42977 IonicModule.directive.direct…
tagged with: javascript
score: 0
tagged with: angularjs
has title: Controller is not loaded in angular?

http://stackoverflow.com/comment/46959105
type: Comment
type: QuestionComment
has text: Good news, your code works pretty well on my local server. Just had to fix some typos that may be causing your code to get stuck. Please check my answer.
score: 1
comment on: http://stackoverflow.com/q/28372340

http://stackoverflow.com/a/28373001
answers question: http://stackoverflow.com/q/28347728
type: Answer
has body: This is really interesting. Pub/Sub should be a right solution here. You could add extra order to your project by using Angular services as your MVC's model, and update this model for each change. The issue here is that you should implement an observable pattern inside your service and register to them, in order for this to be live synced. So - we're back to Pub/Sub (or other Observable solution that you could think about...). But, the project will be better organised that way. For example - SideInfo1Service will be a service/model. Each property change will trigger an observable change which will change all listeners: myApp.factory('SideInfo1Service', function($scope){ var _prop1; return { setProp1: function(value){ $scope.$broadcast('prop1Changed', value); _prop1 = value; }, getProp1: function(){ return _prop1; } } }); You could find those really interesting blog posts about using Angular Services as your MVC's model: http://toddmotto.com/rethinking-angular-js-controllers/ http://jonathancreamer.com/the-state-of-angularjs-controllers/ And, this post is about observable pattern in Angularjs: https://stackoverflow.com/a/25613550/916450 Hope this could be helpful (:
upvote count: 1
downvote count: 0
score: 1

http://stackoverflow.com/a/28372536
has comment: http://stackoverflow.com/comment/45085566
has comment: http://stackoverflow.com/comment/45085610
type: Answer
has comment: http://stackoverflow.com/comment/45085601
has comment: http://stackoverflow.com/comment/45085449
has comment: http://stackoverflow.com/comment/45086942
answers question: http://stackoverflow.com/q/28372466
upvote count: 4
downvote count: 0
score: 4
has body: Don't use the onclick attribute. What your code is doing is attaching a new onclick handler after the user clicks. That's probably not what you want. You should also use prop instead of attr for changing disabled. Since the element you want to attach your event to may not exist on document ready, attach it to the nearest ancestor that you're sure will be there. $( function() { // wait for document ready $( '#parent-div' ).on( 'click', ':checkbox', function( e ) { // attach click event $( '#appTimes' ).find(':text').prop( 'disabled', $(e.currentTarget).is(':checked') ); // set disabled prop equal to checked property of checkbox } ); } );
has comment: http://stackoverflow.com/comment/45085554
has comment: http://stackoverflow.com/comment/45085574

http://stackoverflow.com/comment/45154395
score: 0
has text: @sifriday using code put together for me by a developer. I'm currently useless with all things Javascript and jQuery, so I'm trying to work it all out as I go! Thanks for the thoughts.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28409736

http://stackoverflow.com/comment/45022589
comment on: http://stackoverflow.com/q/28336573
has text: Steven, Error is "ReferenceError : cordova is not defined at ....(pluginCall)...
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28286181
upvote count: 1
has comment: http://stackoverflow.com/comment/44928702
type: Question
tagged with: javascript
has title: Is it useful to select none with D3, and how?
has comment: http://stackoverflow.com/comment/44938966
has comment: http://stackoverflow.com/comment/44926746
has comment: http://stackoverflow.com/comment/44927302
tagged with: css-selectors
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44928368
favorite count: 0
has comment: http://stackoverflow.com/comment/44926573
has comment: http://stackoverflow.com/comment/44926424
has comment: http://stackoverflow.com/comment/44942832
tagged with: d3.js
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28287720
has comment: http://stackoverflow.com/comment/44926653
has body: I want a call to d3.selectAll to return nothing. It seems like this should be a common pattern, something like - d3.selectAll(false) // maybe? .data([10,20,30]) .enter() // ... manipulate Which would require a selector returning nothing. In particular this seems to be an issue in this implementation of a donut chart - var g = svg.selectAll(".arc") .data(pie(data)) .enter().append("g") .attr("class", "arc"); This is evil because "arc" is a global class that could be used somewhere else in the webpage and this is library code. Yet there's no good way to articulate the thing we're trying to select. The arc class? This is obviously a kludgey use of class and has this side effect. I can't say "arc" because they're just paths which are too general, although that's what's used in this example, only with circles. So seems to be a hanging point.
score: 1

http://stackoverflow.com/q/28347335
tagged with: xslt
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28347513
score: 0
has body: Using Saxon HE (net version) wget and batch, I'm trying to transform a page I've downloaded via wget. Whenever calling the command on the page, I get the following error: SXXP0003: Error reported by XML parser: The entity name must immediately follow the '&amp;' in the entity reference. It is related to a line in a VERY awkward line of javescript. However, I have no control about the page I am wanting to transform, so I can't do anything against this error on that side. Is there any way to tell Saxon to skip such errors? I would not mind if it would drop the entire tag, since I'm not looking to read any data from the javascript elements. Big thanks in advance!
tagged with: batch-processing
answer count: 1
has answer: http://stackoverflow.com/a/28347513
type: AnsweredQuestion
has title: SAXON Error- How to ignore/skip it?
tagged with: saxon

http://stackoverflow.com/comment/88475495
has text: @chris I completely agree with you because in this case index may be duplicated. Better to use dynamic values for key.
comment on: http://stackoverflow.com/a/50072646
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28339192
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/45023755
type: Question
has comment: http://stackoverflow.com/comment/45024061
score: 1
possible better answer: http://stackoverflow.com/a/28339292
has comment: http://stackoverflow.com/comment/45023761
has answer: http://stackoverflow.com/a/28339292
accepted answer: http://stackoverflow.com/a/28339302
answer count: 2
linked to: http://stackoverflow.com/q/1145850
has body: I'm trying to add some css to an element if the height of the document is taller than the viewport. var docH = $(document).height(), viewPortH = $(window).height(); console.log(docH); console.log(viewPortH); if (docH &gt; viewPortH) { $('.slick-slide img').css('max-width', '90%'); } However, console.log() outputs both docH and viewPortH as 733 which is not the case. I have the html set to height: 100% and the body set to min-height: 100%. Is there anything I missed? I looked over some of the other similar questions here and I seemed to have done everything correctly.
upvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28339302
linked to: http://stackoverflow.com/q/14231568
has comment: http://stackoverflow.com/comment/45023642
has title: If document height is taller than the viewport, perform X

http://stackoverflow.com/a/28312430
upvote count: 2
type: AcceptedAnswer
has body: .find might work. $(function(){ $("#contactForm").find('textarea,input').jqBootstrapValidation({ //jqBootstrapValidation CODE }); });
answers question: http://stackoverflow.com/q/28312032
has comment: http://stackoverflow.com/comment/45004370
accepted answer of: http://stackoverflow.com/q/28312032
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/q/28281844
has body: I wanted to create enum in javascript and I did the following code and I want to verify that this is the right way. var dataStates = { withMock: "withM", withoutMock: "withoutM", }; is it ok? I want for example to use it like oCation.dataMode === dataStates.withMock and that state.data.withMock will hold the value but Im not sure if it's the right way...
score: 0
has comment: http://stackoverflow.com/comment/44917950
answer count: 2
has answer: http://stackoverflow.com/a/28281885
tagged with: javascript
has answer: http://stackoverflow.com/a/28282066
type: UnansweredQuestion
type: Question
tagged with: enums
has title: Create enum in java script

http://stackoverflow.com/comment/45013366
comment on: http://stackoverflow.com/a/28332857
type: Comment
has text: First parameter is a KEY and second is a VALUE. For an array KEY would be INDEX (as e-neko described) but for the object key would be VARIABLE-NAME.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45159884
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28413038
has text: Please tell OP that you used Deligates !

http://stackoverflow.com/q/28425366
has body: I have a for each loop in my razor view (MVC4) @foreach (var fe in ViewBag.FeatureProducts) { @Html.Raw(fe.Details) } in the each loop i have to extract the @html row content and display in to the div 'product-qty-dt'. For that I write the following jquery, $(document).ready(function () { var data = $('.product-details p').map(function () { return $(this).text(); }).get(); //product availability var availability = data[2].split(","); $.each(availability, function (i) { $('.product-qty-dt').append( availability[i]) }); }); But this was only consider the last foreach raw. how can i call this jquery in each loop call. For example, In first loop, Lorem, Ispum doler emit,fghjh 9gm 9gm second loop Lorem, Ispum doler emit,fghjh 5gm 5gm Thirdloop Lorem, Ispum doler emit,fghjh 3gm 3gm
tagged with: asp.net-mvc-4
score: 0
has comment: http://stackoverflow.com/comment/45183077
possible better answer: http://stackoverflow.com/a/28426095
has answer: http://stackoverflow.com/a/28426095
has comment: http://stackoverflow.com/comment/45183183
has comment: http://stackoverflow.com/comment/45183379
has title: Loop in jquery based on razor loop
accepted answer: http://stackoverflow.com/a/28425850
tagged with: asp.net-mvc
tagged with: javascript
tagged with: jquery
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45183248
type: Question
has answer: http://stackoverflow.com/a/28425850
answer count: 2
tagged with: razor

http://stackoverflow.com/a/28413899
has comment: http://stackoverflow.com/comment/45161440
has comment: http://stackoverflow.com/comment/45161459
has body: You can achieve this by using the javascript function getTime(). Code: var a = new Date(); alert(a.getTime()); Working Example According to getTime() definition: The getTime() method returns the numeric value corresponding to the time for the specified date according to universal time. More can be found in this link UPDATE: If you want to have it in no of days then you would need to calculate it or use library like moment.js Working Fiddle for Days
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45161563
type: Answer
has comment: http://stackoverflow.com/comment/45161296
accepted answer of: http://stackoverflow.com/q/28413855
has comment: http://stackoverflow.com/comment/45161371
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28413855

http://stackoverflow.com/comment/45080034
comment on: http://stackoverflow.com/a/28369499
has text: `dataArray` is hash it should be `dataArray = "header", "html", "img"` though i would use `dataArray = [{'header': "header", 'content': "html", 'image': "img"}];` personally well unless you are planning on using `changeSlider.apply()` ....
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/q/28310537
score: 0
answer count: 2
has body: I have a view of listings and each listing has a 'favorite' button associated with it. This button submits an AJAX form, either liking or unliking the listing if it has already been liked. Submitting the form calls a like.js.erb method or destroy.js.erb which changes the state of the button. However, since the js.erb files target the #id of the element I am changing, this only works for the first element. I also can't use a class because that changes all elements. What's the best way to go about allowing users to like and unlike listings, and changing the view without reloading the page? I tried giving each of the IDs a unique number based on the listing ID, but can't pass the listing ID to the js.erb files so that doesn't work. Here is some relevant code: /listings/_like.html.erb &lt;%= link_to like_listing_path(@listing), method: :put, :remote =&gt; true, :class =&gt; "like-btn" do %&gt; &lt;i class="fa fa-heart-o"&gt;&lt;/i&gt; &lt;% end %&gt; /listings/like.js.erb $("#like-form").html("&lt;%= escape_javascript(render('listings/unlike')) %&gt;") $("#like-size").html('&lt;%= @listing.get_likes.size %&gt;') /listings/unlike.html.erb &lt;%= link_to unlike_listing_path(@listing), method: :put, :remote =&gt; true, :class =&gt; "unlike-btn" do %&gt; &lt;i class="fa fa-heart liked"&gt;&lt;/i&gt; &lt;% end %&gt; /listings/unlike.js.erb $("#like-form").html("&lt;%= escape_javascript(render('listings/like')) %&gt;") $("#like-size").html('&lt;%= @listing.get_likes.size %&gt;') Thank you!
tagged with: jquery
has answer: http://stackoverflow.com/a/28311021
tagged with: ajax
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28310792
accepted answer: http://stackoverflow.com/a/28311021
tagged with: ruby-on-rails
type: Question
possible better answer: http://stackoverflow.com/a/28310792
tagged with: javascript
has title: Multiple AJAX forms in the same view in Rails

http://stackoverflow.com/q/28310943
tagged with: javascript
tagged with: image
has comment: http://stackoverflow.com/comment/44972842
upvote count: 2
has answer: http://stackoverflow.com/a/28312334
has answer: http://stackoverflow.com/a/28311614
answer count: 3
has comment: http://stackoverflow.com/comment/44973923
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: My goal is to set the background image from a local image on my computer. I have two lines of code, one that works and one that doesn't: (the local one does not work) _html.style.backgroundImage = 'url("urlsourceblahblahblah")'; _html.style.backgroundImage = 'url("/~/Content/images/Image1.jpg")'; When I try running the second one (the local one), this is the error that I get: GET http://localhost:23433/~/Content/images/Image1.jpg 404 (Not Found) I can verify that the image path is correct, even if I put the image file in the same directory to make things simple. I know from documentation that the backgroundImage property in JS requires url(). Is there any reason why this wouldn't work?
score: 2
has comment: http://stackoverflow.com/comment/44973939
downvote count: 0
has answer: http://stackoverflow.com/a/28315856
type: Question
has title: How to access local image when setting the background image in javascript
has comment: http://stackoverflow.com/comment/44972944
has comment: http://stackoverflow.com/comment/44972759

http://stackoverflow.com/comment/47753025
type: Comment
has text: @Sukima Node v0.12 does not support [template strings](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/template_strings), nor with `--harmony` flag, nor without it. But `iojs` supports them without need of any flags.
comment on: http://stackoverflow.com/a/28389178
type: AnswerComment
score: 5

http://stackoverflow.com/a/28375554
type: Answer
downvote count: 2
upvote count: 1
score: -1
answers question: http://stackoverflow.com/q/28375494
has body: To make it work the way you use it in your example you would have to use a template engine and add some extra characters around the variable depending on the engine you went with. I think concatenation would be easiest for your case var text = '{"students":[' + '{"firstName": ' + first + ',"lastName":"Skousen" },' + '{"firstName": ' + first + ',"lastName":"Norman" },' + '{"firstName": ' + first + ',"lastName":"Coatney" }]}';

http://stackoverflow.com/a/28433300
accepted answer of: http://stackoverflow.com/q/28432959
score: 15
answers question: http://stackoverflow.com/q/28432959
type: Answer
has body: Since you are adding the c2gyoApp module with: beforeEach(module('c2gyoApp')); Everything registered inside that module should be injectable. So, this should work: var smConfig, stadtmobilRates; beforeEach(inject(function($controller, $rootScope, _smConfig_, _stadtmobilRates_) { scope = $rootScope.$new(); DatetimepickerCtrl = $controller('DatetimepickerCtrl', { $scope: scope }); smConfig = _smConfig_; stadtmobilRates = _stadtmobilRates_; }
upvote count: 15
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45639243
type: AnswerComment
type: Comment
has text: Edited the content to use the template cache. updated fiddle -http://jsfiddle.net/1gagvfj3/1/
score: 1
comment on: http://stackoverflow.com/a/28320945

http://stackoverflow.com/a/28424186
score: 1
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28423931
answers question: http://stackoverflow.com/q/28423931
has body: It seems fieldObj variable in your code is undefined. I would loop forms in this way: var formsList = document.getElementsByTagName('form'); for (var i=0; i &lt; formsList.length; i++) { var form = formsList[i]; for (field in form) { var value = form[field].value; } }

http://stackoverflow.com/q/28312848
tagged with: forms
has body: I have an input tag within a form, when I press enter in the input box. The url will be appended with a question mark. code: &lt;form&gt; &lt;input id="xyz" type="text" value=""&gt; &lt;/form&gt; This is very annoying, so I add some code to prevent the user from doing this behaviour. I change the body tag to: &lt;body onkeydown="(event.keyCode==13) ? 0 : 1"&gt; Well, this works in another webpage, but not in this case. What have I missed? And is this a good solution to prevent user from pressing enter on the keyboard? Please give some explanation in your answer, thanks. p.s. I can't use jQuery. UPDATE: I don't want the user to enter press on their keyboard to submit a form even I define the form action and method.
type: Question
downvote count: 0
tagged with: javascript
tagged with: keycode
tagged with: keyboard
has answer: http://stackoverflow.com/a/28312922
answer count: 1
favorite count: 0
has title: The URL will be appended with a question mark as the user press enter
upvote count: 2
type: UnansweredQuestion
tagged with: input
score: 2

http://stackoverflow.com/a/28297917
answers question: http://stackoverflow.com/q/28297344
score: 2
downvote count: 0
upvote count: 2
type: AcceptedAnswer
has body: The problem with your code is that thumb is after the images you want to display. If you look up the selector you are using then you will understand why. The ~ combinator separates two selectors and matches the second element only if it is preceded by the first, and both share a common parent. General sibling selectors So as you can see now we can get it working by putting .thumb infront. (a little change to the CSS so when we hover .thumb it displays the new image.) .primary.img1 { display: block; } .primary.img2 { display: none; } .thumb.img2:hover ~ .primary.img1 { display: none; } .thumb.img2:hover ~ .primary.img2 { display: block; } &lt;div class="container"&gt; &lt;!-- Thumbnails --&gt; &lt;div class="thumb img2"&gt; &lt;img src="http://placehold.it/350x150" /&gt; &lt;/div&gt; &lt;!-- Main images --&gt; &lt;div class="primary img1"&gt; &lt;img src="http://placehold.it/351x150" /&gt; &lt;/div&gt; &lt;div class="primary img2"&gt; &lt;img src="http://placehold.it/352x150" /&gt; &lt;/div&gt; &lt;/div&gt;
accepted answer of: http://stackoverflow.com/q/28297344
type: Answer

http://stackoverflow.com/a/28376150
accepted answer of: http://stackoverflow.com/q/28376058
score: 5
has comment: http://stackoverflow.com/comment/45092701
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28376058
has body: You need to make sure you're turning the string _id into an ObjectId. Also, you were using res.body instead of req.body. router.put('/updateuser/:id', function(req, res) { var db = req.db; var userToUpdate = req.params.id; db.collection('userlist').update({ _id: ObjectId(userToUpdate)}, req.body, function (err, result) { res.send( (err === null) ? {msg: ''} : {msg: err} ); }); }); Different drivers use a different method to create an ObjectId: mongoDB native driver: new ObjectId(idString); mongoJS: db.ObjectId(idString); mongoSkin: toObjectID(idString); mongoose: mongoose.Types.ObjectId(idString);
has comment: http://stackoverflow.com/comment/45092809
type: Answer
has comment: http://stackoverflow.com/comment/45092745
has comment: http://stackoverflow.com/comment/45093151
has comment: http://stackoverflow.com/comment/45092841
has comment: http://stackoverflow.com/comment/45092867
has comment: http://stackoverflow.com/comment/45092914
has comment: http://stackoverflow.com/comment/45093050
upvote count: 5
has comment: http://stackoverflow.com/comment/45092873

http://stackoverflow.com/comment/45058413
has text: Are you asking how to retrieve form data in a php script using php?
score: 0
comment on: http://stackoverflow.com/q/28357381
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44928827
type: Comment
has text: Thank you @MatthewG, that certainly clears things up! A lot cleaner than the original I had too.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28287352

http://stackoverflow.com/comment/45080539
type: Comment
has text: Well I wanted to try to get it to work without having to do that. Obviously That is a possibility and I had it working that way but the way the code is written now it will turn into a bit off a mess. EDIT: Using the ID is, in my opinion, an easy way out. Apparently it can't be done using the plugin itself. But it **can** be done by using jquery's `find()` and `parent()` methods. So i'll just do that then.
score: 0
comment on: http://stackoverflow.com/q/28369836
type: QuestionComment

http://stackoverflow.com/comment/45087309
type: Comment
comment on: http://stackoverflow.com/a/28371603
score: 0
type: AnswerComment
has text: I've edited my answer so now the include happens in a single function. If it still doesn't work, check if you get any errors in the console and if the script file is getting included in the page.

http://stackoverflow.com/comment/44954547
type: AnswerComment
comment on: http://stackoverflow.com/a/28301548
has text: How do I get it called then?
type: Comment
score: 0

http://stackoverflow.com/a/28315359
has body: Solved this you can check out the code at http://meteorpad.com/pad/yDbDX3WebMA5wuLKr/Leaderboard
answers question: http://stackoverflow.com/q/28315126
score: 0
type: Answer

http://stackoverflow.com/q/28282326
favorite count: 0
type: Question
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/44919200
has title: Datetimepicker doesn't work
has answer: http://stackoverflow.com/a/36933674
has answer: http://stackoverflow.com/a/28283252
upvote count: 3
answer count: 3
accepted answer: http://stackoverflow.com/a/28283403
has body: I have a situation with datetimepicker. It doesn't show any calendar When I click the icon. The chrome browser not showing any errors in the development console. Fecha de Nacimiento : $(function () { $('#datetimepicker1>input').datetimepicker({ format: "yyyy-mm-dd" }); });
has comment: http://stackoverflow.com/comment/44920386
downvote count: 1
possible better answer: http://stackoverflow.com/a/28283252
tagged with: javascript
tagged with: datetimepicker
score: 2
type: AnsweredQuestion
tagged with: jquery
has comment: http://stackoverflow.com/comment/44920019
has answer: http://stackoverflow.com/a/28283403

http://stackoverflow.com/comment/45136187
score: 0
type: Comment
has text: seems on the way you include it
comment on: http://stackoverflow.com/a/28399576
type: AnswerComment

http://stackoverflow.com/comment/44966189
comment on: http://stackoverflow.com/a/28307013
score: 0
type: AnswerComment
has text: @ShankarGuru It's always the smallest things that give us the largest headaches :)
type: Comment

http://stackoverflow.com/q/28294528
has title: Support of click() on input
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28294600
type: Question
has comment: http://stackoverflow.com/comment/44941894
has comment: http://stackoverflow.com/comment/44941938
score: 0
has body: I just made a neat little way of adding profile pictures, but I'm concerned about the browser support HTML JavaScript document.getElementById('profile-picture').onclick = function(){ document.getElementById('pic-upload-input').click(); } Would you recommend this is a safe thing to do?
answer count: 1
tagged with: javascript
linked to: http://stackoverflow.com/q/3763080
accepted answer: http://stackoverflow.com/a/28294600
has comment: http://stackoverflow.com/comment/44941788
has comment: http://stackoverflow.com/comment/44941826

http://stackoverflow.com/comment/45193189
type: Comment
type: QuestionComment
has text: @abhiklpm I used the row and column elements from the standard bootstrap
comment on: http://stackoverflow.com/q/28430876
score: 0

http://stackoverflow.com/comment/44962159
type: AnswerComment
comment on: http://stackoverflow.com/a/28305128
has text: Thanks, I've been having issues with understanding closures for days because of thinking inner functions are to be evaluated when outer ones are invoked
score: 0
type: Comment

http://stackoverflow.com/q/28428600
has body: I am using a jquery plugin called mmenu to load a side menu when a button has been clicked. That works fine, but Im also trying to get a hamburger style image going at the same time. I start off with the three lines and then when the menu button pressed it changes into a cross, this seems to work. my issue comes when trying to close the menu, I want it to return back to a cross. The mmenu allows you to click anywhere to close the menu but I cant get the jquery right to change it back. I added a class when the button (.menuvate) is clicked, called "active" which displays the cross but no matter how I try I cant get it to check that the class is active when anywhere on the page is clicked after the menu has been opened. This is my code so far $('.menuvate').click(function(){ $("#my-menu").trigger("open.mm"); $("#mm-0").addClass("menu-opened"); $("#nav-toggle").addClass("active"); }); $(document).click(function() { alert("me"); }); I just put an alert in to tell me when this is being fired which of course it does everytime the page is clicked. How do I get it to check for the active class after the menu has been opened when the page is clicked again so I can remove the class and change it back? Thank you.
answer count: 2
accepted answer: http://stackoverflow.com/a/28428706
score: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: jQuery/ javascript after something has been clicked, then check for something else
has answer: http://stackoverflow.com/a/28428754
possible better answer: http://stackoverflow.com/a/28428754
upvote count: 2
has answer: http://stackoverflow.com/a/28428706
type: AnsweredQuestion
type: Question

http://stackoverflow.com/q/28414937
accepted answer: http://stackoverflow.com/a/28417195
linked to: http://stackoverflow.com/q/10500362
type: Question
has comment: http://stackoverflow.com/comment/45163547
downvote count: 0
answer count: 1
has title: HTML5 File API - Send file to server for processing
tagged with: javascript
score: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/45163718
has comment: http://stackoverflow.com/comment/45163517
favorite count: 0
has comment: http://stackoverflow.com/comment/45163332
has answer: http://stackoverflow.com/a/28417195
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45164775
has comment: http://stackoverflow.com/comment/45163439
has body: I have form with the following form: ... Add ... The add element's click event is then wired up like so: var images = []; $("#add").click(function() { var files = $("#images")[0].files; for (var i = 0; i < files.length; i++) { images.push[files[i]; } $("#images").val(""); }); This allows me to add the images from multiple locations. Now I need to send the files back to the server. I found the following question: Passing path to uploaded file from HTML5 drag & drop to input field Which seems to be similar. Therefore I used the following to wire up an event when the form is submitted: var form = $("form"); form.submit(function() { for (var i = 0; i < images.length; i++) { var reader = new FileReader(); reader.onload = function(e) { $(" ").attr({ type: "hidden", name: "images[]" }).val(e.target.result).appendTo(form); }; reader.readAsDataURL(images[i]); } }); Finally on the server I have the following code: print_r($_POST); print_r($_FILES); However neither collection contains an item for the images submitted. I was wondering what I am doing wrong? Thanks
has comment: http://stackoverflow.com/comment/45163486
upvote count: 1
tagged with: php
type: AnsweredQuestion

http://stackoverflow.com/comment/44954147
type: Comment
type: QuestionComment
has text: @MilindAnantwar yes, the log is working but the dropdown UI is not updating with the selected value
comment on: http://stackoverflow.com/q/28301358
score: 0

http://stackoverflow.com/comment/45091656
comment on: http://stackoverflow.com/q/28375543
type: Comment
type: QuestionComment
score: 0
has text: as wayne stated just before, you need to add ` ` like here https://docs.angularjs.org/api/ngRoute. You will also have to add it in your modules : `angular.module('danApp', ['ngRoute']);`

http://stackoverflow.com/a/28298835
upvote count: 4
answers question: http://stackoverflow.com/q/28288471
downvote count: 0
has body: Check out http://docs.ractivejs.org/latest/ractive-observe You can observe objects that is changed by ractive
score: 4
type: Answer

http://stackoverflow.com/a/28321832
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28321029
answers question: http://stackoverflow.com/q/28321029
type: AcceptedAnswer
downvote count: 0
has body: You expect your getAnimalByCategory to return a flat list, so that the results of a loop can be merged by a concat. However, you don't return such in the recursive case. PlacesService.getAllAnimals = -&gt; [].concat.apply([], getAnimalByCategory(category) for category in animals.list) getAnimalByCategory = (category) -&gt; if not category.withCategories category.animal else [].concat.apply([], getAnimalByCategory(an) for an in category.categories)

http://stackoverflow.com/q/28296994
has body: I have some bar charts that have really long labels and they affect the size of the charts. Example: http://jsfiddle.net/norbiu/aqa8w19d/4/ I'm trying to truncate the labels that show up under the chart while keeping the label that shows up in the tooltips when hovering over a bar. The problem is that the tooltips and the canvas labels both get their values from the labels array in the data structure. Truncating the value will show the shortened version in both locations. sales: ko.observable({ labels: ['A really really long label', 'Another long labe', 'A third label that is long', 'Q4', 'Q5', 'Q6'], datasets: [{ label: 'Helados', fillColor: '#152491', data: [70, 32, 6, 23, 63, 43] }] }), The documentation has nothing on this. Any ideas?
tagged with: javascript
upvote count: 26
downvote count: 0
has comment: http://stackoverflow.com/comment/45065133
favorite count: 0
has answer: http://stackoverflow.com/a/39537545
score: 26
has answer: http://stackoverflow.com/a/30221661
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45076387
possible better answer: http://stackoverflow.com/a/28304977
has answer: http://stackoverflow.com/a/28304977
accepted answer: http://stackoverflow.com/a/39537545
has title: Truncating canvas labels in ChartJS while keeping the full label value in the tooltips
type: Question
has answer: http://stackoverflow.com/a/30809578
tagged with: chart.js

http://stackoverflow.com/q/28381835
tagged with: php
score: 1
tagged with: codeigniter
upvote count: 1
type: Question
has title: javascript array Not Working properly
has comment: http://stackoverflow.com/comment/45102515
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/28382926
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/45102453
has comment: http://stackoverflow.com/comment/45102558
type: UnansweredQuestion
has body: I am facing some problems arrays in php,, &lt;input class="form-control" placeholder="Start Time" value="'.date("H.i").'" type="text" name="starttime[]" id="starttime"/&gt; &lt;/div&gt; &lt;div class="col-lg-4"&gt; &lt;input class="form-control" name="endtime[]" id="endtime" onchange="myfunction1()" value="00.00" type="text" placeholder="End Time"&gt; This is my ajax code and when I change end time It must be show other text box &lt;input class="form-control" name="kmcost" id="exkms" type="text" placeholder="Cost"&gt; But single entry working but second entry(array) Not woeking my javascript code is here please help me.. my javascript is here.. function myfunction1() { var ftime = document.getElementById("starttime").value; var etime = document.getElementById("endtime").value; var timeanswer = etime - ftime; var localtottme = document.getElementById("textbox3").value; if(timeanswer &gt; 8) { var totextme = timeanswer-8; } var exkms = document.getElementById('exkms'); exkms.value=totextme; }

http://stackoverflow.com/q/28356974
score: 0
has comment: http://stackoverflow.com/comment/45210647
answer count: 1
has comment: http://stackoverflow.com/comment/45210394
accepted answer: http://stackoverflow.com/a/28453699
has comment: http://stackoverflow.com/comment/45211589
type: AnsweredQuestion
tagged with: footable
has body: I have data in a footable table. The first row (tr) has averages for each row underneath. Example: | Name | Number | -------------------- | Average | 4.5 | | Jim | 5.0 | | Sam | 4.0 | The average row shouldn't be sorted, is there a class or attribute to prevent the average value from being sorted?
type: Question
has comment: http://stackoverflow.com/comment/45211650
has answer: http://stackoverflow.com/a/28453699
tagged with: javascript
has title: Stopping a row from being sorted via the sorting plugin
tagged with: sorting

firefox
tags question: http://stackoverflow.com/q/28328790
tags question: http://stackoverflow.com/q/28351312
tags question: http://stackoverflow.com/q/28337512
tags question: http://stackoverflow.com/q/28404626
tags question: http://stackoverflow.com/q/28407755
tags question: http://stackoverflow.com/q/28357815
tags question: http://stackoverflow.com/q/28421917
tags question: http://stackoverflow.com/q/28312869
tags question: http://stackoverflow.com/q/28353352
tags question: http://stackoverflow.com/q/28282385
tags question: http://stackoverflow.com/q/28360207
tags question: http://stackoverflow.com/q/28388084
tags question: http://stackoverflow.com/q/28292700
tags question: http://stackoverflow.com/q/28365953
tag name: firefox
tags question: http://stackoverflow.com/q/28342194
tags question: http://stackoverflow.com/q/28335593
tags question: http://stackoverflow.com/q/28281415
tags question: http://stackoverflow.com/q/28379253
tags question: http://stackoverflow.com/q/28402100
tags question: http://stackoverflow.com/q/28386490
type: Tag
tags question: http://stackoverflow.com/q/28370713
tags question: http://stackoverflow.com/q/28427728
tags question: http://stackoverflow.com/q/28311991
tags question: http://stackoverflow.com/q/28420697
tags question: http://stackoverflow.com/q/28390231
tags question: http://stackoverflow.com/q/28379806
tags question: http://stackoverflow.com/q/28373623
tags question: http://stackoverflow.com/q/28335282
tags question: http://stackoverflow.com/q/28380078
tags question: http://stackoverflow.com/q/28316589
tags question: http://stackoverflow.com/q/28404269
tags question: http://stackoverflow.com/q/28296007
tags question: http://stackoverflow.com/q/28356267
tags question: http://stackoverflow.com/q/28369121
tags question: http://stackoverflow.com/q/28281449

http://stackoverflow.com/q/28399393
score: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28399424
tagged with: dom
has body: I wasn't quite sure how to word this in the title, so thank you for clicking to on this. So now to my problem: Up Down Left Right This code is not complete, as I want to fix this problem first. I want to use Math.floor to get a certain ID (thus, IDs as numbers), and manipulate them. More specifically, I want to find the ID of the cell that currently has the .block class, find the ID of the cell above that using Math.floor(oldBlock + 1), remove the class from the original cell, and add the class to the new cell. I used variables so that the function would always be able to run, rather than making a million if/else if/else statements. Unfortunately, this doesn't work with my current code. How would I be able to do this? Any help is appreciated!
type: Question
tagged with: javascript
tagged with: class
has comment: http://stackoverflow.com/comment/45134505
accepted answer: http://stackoverflow.com/a/28399424
has title: Calculating Number IDs
answer count: 1

readonly
tag name: readonly
tags question: http://stackoverflow.com/q/28312874
type: Tag

http://stackoverflow.com/comment/45121214
has text: Could you provide me the way you've implemented this?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28380886
type: AnswerComment

http://stackoverflow.com/a/28343158
has comment: http://stackoverflow.com/comment/45033177
answers question: http://stackoverflow.com/q/28343019
has comment: http://stackoverflow.com/comment/45030961
has comment: http://stackoverflow.com/comment/45030832
has comment: http://stackoverflow.com/comment/45030854
has comment: http://stackoverflow.com/comment/45030910
score: 0
has body: We can easily use css for achieve this Hope this helps
type: Answer

http://stackoverflow.com/q/28367438
has answer: http://stackoverflow.com/a/28367745
accepted answer: http://stackoverflow.com/a/28367745
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
has body: I'm having some issues outputting KeyValue pairs within an object as a link using AngularJS. The object is constructed in C# using the following code: Dictionary<int, string> page = new Dictionary<int, string>(); updatedCountryNodesList.ForEach(x => page.Add(x.Id, x.Name)); When a request is made using a button in my HTML and Angular code this object is returned as part a general object to my Javascript code which is defined as follows: public class ResponseMessage { public bool Result { get; set; } public string Message { get; set; } public Dictionary<int, string> Updates { get; set;} } This object is then processed using the following function: $scope.getCountries = function() { $scope.loadCountries = true; $scope.info = []; getMessage("Retreiving updates"); AxumTailorMade.getCountries().success(function (data) { if (!data.Result) { notificationsService.error("Error", data.Message); } else if (data.Result) { getMessage("Content updated"); console.log(data.Updates); $scope.link = data.Updates; notificationsService.success("Success", data.Message); } $scope.loadCountries = false; }); }; The following is the output of the console.log within this code: Object { 5118="Costa Rica", 5129="Ecuador and Galapagos", 4851="Venezuela"} I am then using an ng-repeat as follows to loop through the keyValue pairs in the object and output a link using the key within the link href and the name within the link text. {{item}} {{value}} However, the problem I have is that this is not behaving in the way I would expect. When the code is returned, I am seeing this in my Firebug console suggesting it is parsing each letter of my value and making it into a link: V e n e z u e l a How do I amend my code so that the links are displayed as I intend? Any help would be greatly appreciated.
type: AnsweredQuestion
has title: Outputting a KeyValue pair as a link in AngularJS
type: Question
score: 0
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/45050340
type: Comment
has text: But I want my wrapper to be promisified as well. This example is returning a string to the caller of query.
type: AnswerComment
comment on: http://stackoverflow.com/a/28353083
score: 0

http://stackoverflow.com/comment/45058348
type: Comment
comment on: http://stackoverflow.com/a/28334988
score: 0
type: AnswerComment
has text: Okay, ran that, got an error in the console `parsererror:SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data` so that gives me something to start looking for thanks :)

http://stackoverflow.com/q/28391290
tagged with: ecmascript-6
answer count: 2
has answer: http://stackoverflow.com/a/28394370
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28394370
has body: I recently started using traceur and stumbled upon an odd behavior when creating a class with default values on the prototype. I want to know if is this a bug in traceur or is this the intended behavior for ES6 classes? class hasDefault { setValue ( v ) { this.v = v; } } Object.defineProperty( hasDefault.prototype, "v", { value : 5, enumerable : true }); let a = new hasDefault; console.assert(a.v === 5); a.setValue(2); console.assert(a.v === 2); <a href="https://google.github.io/traceur-compiler/demo/repl.html#class%20hasDefault%20%7B%0A%20%20setValue%20(%20v%20)%20%7B%0A%20%20%09this.v%20%3D%20v%3B%0A%20%20%7D%0A%7D%0AObject.defineProperty(%20hasDefault.prototype%2C%20%22v%22%2C%20%7B%0A%20%20value%20%3A%205%2C%0A%20%20enumerable%20%3A%20true%0A%7D)%3B%0A%0Alet%20a%20%3D%20new%20hasDefault%3B%0Aconsole.assert(a.v%20%3D%3D%3D%205)%3B%0Aa.setValue(2)%3B%0Aconsole.assert(a.v%20%3D%3D%3D%202)%3B" rel="nofollow">run in traceur REPL It throws an error that I can't assign to the read only property "v" when I try to set it. Which doesn't make sense as the property is defined on the prototype, not the instance. Also I'm unable to get that Error to throw in es5 on sealed/frozen/non-extensible objects and as far as I know Proxies aren't implemented in V8, so... how does it throw the error in the first place? It's not a compile-time error. My main interest isn't to "make it work", which is trivial. All you need to do is replace this.v = v by the Object.defineProperty equivalent. I primarily want to know if and why it behaves this way and if there are negative performance implications in this data structure that outweigh the memory gain by assigning default properties to the prototype instead of storing them on every instance.
score: 0
type: Question
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28394237
has title: es6 class with default property on prototype throws in traceur
tagged with: traceur
has answer: http://stackoverflow.com/a/28394237

http://stackoverflow.com/a/28399330
has comment: http://stackoverflow.com/comment/45144999
has comment: http://stackoverflow.com/comment/45134593
has comment: http://stackoverflow.com/comment/45143335
score: 5
has comment: http://stackoverflow.com/comment/45145170
upvote count: 5
answers question: http://stackoverflow.com/q/28399252
downvote count: 0
has comment: http://stackoverflow.com/comment/45145107
accepted answer of: http://stackoverflow.com/q/28399252
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45134425
has body: The AngularJS lives in the client, while ASP.NET MVC lives in the server. The controllers of AngularJS has nothing to do with the controllers of ASP.NET MVC. When a web request will be crafted from your browser and it will be send to the server, then a ASP.NET MVC controller will find the model and bind it to the view. Then the server will send back to you the rendered view. When your page will be rendered in your browser, the scripts, including those of angular's will be interpreted by the browser's JavaScript interpreter. Then each dynamic template you may have defined with angular will be feed with data. Any behavior, like on click of a button or something else that will be handled by your client code has nothing to do with ASP.NET MVC. This will be the reign of either AngularJS or any other JavaScript framework you use. The only resemblance between AngularJS and ASP.NET MVC is the fact that they are both two MVC frameworks. The MVC pattern is in their core.
has comment: http://stackoverflow.com/comment/45134605
type: Answer

http://stackoverflow.com/comment/45137185
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28400624
score: 0
has text: about being a newbie, it will help you get more/better answers on SO if you get in the habit of marking correct answers when they are given. it looks like you'v done that about once in >25 answers received.

http://stackoverflow.com/comment/45104983
comment on: http://stackoverflow.com/q/28383370
type: Comment
type: QuestionComment
score: 0
has text: besides a small error (you have nothing after the comma here: `$.post("/abc.aspx", )` ) this seems to be [completely ok](http://jsfiddle.net/w80f63ke/). Are you sure you aren't missing some information?

http://stackoverflow.com/a/30090002
type: Answer
answers question: http://stackoverflow.com/q/28290871
has comment: http://stackoverflow.com/comment/60324545
score: 0
has comment: http://stackoverflow.com/comment/60342794
has body: In dependency_OnChange, you need to check e.Type. If it's != SqlNotificationType.Change, then the handler was called for some reason other than a data change. The subscription itself likely failed.

http://stackoverflow.com/q/28361252
answer count: 1
downvote count: 0
favorite count: 0
score: 11
accepted answer: http://stackoverflow.com/a/28361545
upvote count: 11
type: AnsweredQuestion
type: Question
tagged with: reactjs
tagged with: javascript
has title: If the props for a child component are unchanged, does React still re-render it?
has answer: http://stackoverflow.com/a/28361545
has body: Suppose I have the following pairing of parent and child components in React: var ChildComponent = React.createClass({ getDefaultProps: function(){ return { a: 'a', b: 'b', c: 'c' } }, render: function() { return ( /* jshint ignore:start */ &lt;div className={'child' + (this.props.b ? ' modifierClass' : '')} something={this.props.a}&gt; {this.props.c} &lt;/div&gt; /* jshint ignore:end */ ); } }); var ParentComponent = React.createClass({ componentDidMount: function(){ //After 10 seconds, change a property that DOES NOT affect the child component, and force an update setTimeout(function(){ this.setState({foo: 'quux'}); this.forceUpdate(); }.bind(this), 10000); } getInitialState: function(){ return { foo: 'bar', a: 1, b: 2, c: 3 } }, render: function() { return ( /* jshint ignore:start */ &lt;div className="parent"&gt; &lt;ChildComponent a={this.props.a} b={this.props.b} c={this.props.c}/&gt; &lt;/div&gt; /* jshint ignore:end */ ); } }); React.render( /* jshint ignore:start */ &lt;ParentComponent /&gt;, /* jshint ignore:end */ document.getElementsByTagName('body')[0] ); When I do the forceUpdate, since none of the props that were passed to the ChildComponent changed, will React try to re-render it? What if I have 1000 such children, etc? What I'm worried about is a situation where I have a very deep ChildComponent containing a whole massive tree of descendant components, but I only want to enact some relatively cosmetic changes on the ParentComponent. Is there any way to get React to update only the parent, without trying to re-render the children as well?

http://stackoverflow.com/a/28422456
answers question: http://stackoverflow.com/q/28421755
score: 3
downvote count: 0
has body: It sounds like both buttons should call the update action in your controller. From there, you can then check the param 'commit' and handle your response as you wish. For example, buttons in view: &lt;%= form.submit 'Save' %&gt; &lt;%= form.submit 'Update' %&gt; check which button was clicked in controller: if params[:commit] == 'Save' ... redirect somewhere ... else ... do something else ... end
upvote count: 3
type: Answer

http://stackoverflow.com/a/28296635
type: Answer
has body: The options you can use are: plotOptions:{ bar:{ pointPadding: 0, groupPadding: 0, } } But you also need to not force your bar point width. Remove: series: { pointWidth: 20, http://jsfiddle.net/d9f8b22x/ The API docs discuss how these options relate to each other: http://api.highcharts.com/highcharts#plotOptions.column.pointPadding
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45060996
downvote count: 0
answers question: http://stackoverflow.com/q/28296118

http://stackoverflow.com/comment/45117007
type: QuestionComment
has text: i have no idea what youre asking
comment on: http://stackoverflow.com/q/28389746
score: 0
type: Comment

http://stackoverflow.com/q/28419042
tagged with: javascript
has comment: http://stackoverflow.com/comment/45172335
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45174576
favorite count: 0
has comment: http://stackoverflow.com/comment/45171322
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45174284
has comment: http://stackoverflow.com/comment/45175238
upvote count: 1
has body: My simple angular app has three pages so far; each page has its own controller that handles various interactions with the user and backend system. I want to add in a div header that contains a searchbar, much like the one you see at the top on every page on StackOverflow!. The problem is in separating controller logic between the searchbar and the page content. I feel they should be put in separate controllers so that the code can be modularized. The Search controller will handle interactions with the searchbar across all pages as well as displaying the search results page, while the page content controllers will handle logic for their specific page content. My current setup is (snippets): app.js function appRouteConfig($stateProvider, $urlRouteProvider) { $stateProvider .state("landingpage", { url: '/', controller: "LandingPageCtrl", templateUrl: "views/html/landing.html" }) .state("discussion", { url: '/discussion', controller: "DiscussionCtrl", templateUrl: "views/html/discussion.html" }) .state("search_content", { url: "/search_results", controller: "SearchCtrl", templateUrl: "views/html/searchpage.html" }) } controller.js controllers.controller("SearchCtrl", ["$scope", "$location", function($scope, $location) { $scope.search = function(query) { // Query backend server and redirect to /search_results with response. } } ]); discussion.html &lt;div data-ng-include=" 'views/html/searchNav.html ' "&gt;&lt;/div&gt; &lt;div class="discussion"&gt; &lt;!-- Discussion html --&gt; &lt;/div&gt; But the problem here is that I have already declared a controller for each route in app.js. So when I visit /discussion, the controller that will be loaded will be DiscussionCtrl, and the search controller will not be loaded so search won't work. I could remove all the controllers specified in the routes, and set them manually, something along the lines of: &lt;div ng-controller="SearchCtrl"&gt; .... &lt;/div&gt; &lt;div ng-controller="DiscussionCtrl"&gt; .... &lt;/div&gt; That way …
tagged with: angularjs-directive
tagged with: angular-ui-router
score: 1
type: Question
has answer: http://stackoverflow.com/a/28419438
has title: Angularjs - separating global search and page contents?
answer count: 1
downvote count: 0

http://stackoverflow.com/q/28365503
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/28410860
has comment: http://stackoverflow.com/comment/45153140
tagged with: javascript
has comment: http://stackoverflow.com/comment/45149878
score: 0
answer count: 1
tagged with: ractivejs
has title: ractivejs observe init vs set/push/update
has body: in this code sample, on init, observe is fired for each element, even ones without "prices", but does not fire on any other method, Why? var _deals = [ { prices: [ { id: 1, deal_id: 1, guests_from: 100, guests_to: 200, price: 250 } ] }, { prices: [] }, {} // this fires also, Why? ]; var deals = [], // app database dealsGuy; // app instance deals = _deals; // create our app view dealsGuy = new Ractive({ el: '#app_block', template: '#app-template', noIntro: true, // disable transitions during initial render data: { deals: deals }, decorators: { datepicker: datepickerDecorator } }); dealsGuy.observe('deals.*.prices', function (newValue, oldValue, keypath) { console.log( 'observe', keypath ); if( newValue === void 0 || newValue.length &lt;= 0 ){ this.set(keypath,[{}]); } }); dealsGuy.push('deals', {}); // does not fire 'deals.*.prices'
has answer: http://stackoverflow.com/a/28410860
has comment: http://stackoverflow.com/comment/45154961
has comment: http://stackoverflow.com/comment/45242098
has comment: http://stackoverflow.com/comment/45155124

http://stackoverflow.com/comment/49487029
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/30714666
has text: Could you point out the key difference that makes this work? That's a lot of code to read through when I'm sure most of it is just taken straight from the demo. We shouldn't have to get a diff to see what fixed the problem.

http://stackoverflow.com/a/29112215
type: Answer
answers question: http://stackoverflow.com/q/28435253
score: 3
upvote count: 3
has body: Just a quick note to clarify: disabling the corresponding checkbox and adding the .disabled class to the appropriate li is not sufficient. You also have to disable the underlying option. Example (can also be found in the documentation): Option 1 Option 2 Option 3 Option 4 Option 5 Option 6 Disable an option! Check
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28435253

http://stackoverflow.com/comment/44930828
comment on: http://stackoverflow.com/q/28286620
score: 1
has text: For future reference I'd recommend creating a [jsfiddle](http://jsfiddle.net/) that demonstrates your problem as it makes it a lot easier for people who are answering
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44934999
score: 0
comment on: http://stackoverflow.com/q/28290442
type: Comment
type: QuestionComment
has text: have you checked the console for errors? there are a few things in there that look like they will throw an error.

http://stackoverflow.com/a/30160209
type: Answer
has body: You can dispatch the uploading work to background by using GCD. I suggest you use the XWebView. It can do all dirty works for you, such as bridging and background dispatching.
score: 0
answers question: http://stackoverflow.com/q/28345463

http://stackoverflow.com/comment/45177184
type: Comment
type: QuestionComment
has text: Actually I was hoping to derive the second stack of bars from he first based the difference (value)...I am thinking of doing some sort of intercept reversal before the data is fed to dimple.chart(). But I wonder if there is a less mechanical way other than janking with my dataset.The chart in my jsfiddle looks like my google chart, just the method I used to make it is different and I am new to dimple, I'm sure I will figure out something.
comment on: http://stackoverflow.com/q/28416750
score: 0

http://stackoverflow.com/q/28280822
has answer: http://stackoverflow.com/a/28282270
type: Question
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/44915778
tagged with: express
has comment: http://stackoverflow.com/comment/44919351
score: 0
has body: I'm getting started in express and my knowledge is quite limited. I have an entire working script (tested in index.js) and I'd like to launch it on demand when clicking on a button on my webpage. I want to make sure that my script still goes on if I leave the webpage. I'm looking for the simplest way to achieve that by updating the index.js file below: var express = require('express') var app = express() var myscript = require('myscript.js') app.get('/', function (req, res) { res.send('Hello World!') }) var server = app.listen(3000, function () { var host = server.address().address var port = server.address().port console.log('Example app listening at http://%s:%s', host, port) })
has title: Simple button to launch a script in express
has comment: http://stackoverflow.com/comment/44919418
type: UnansweredQuestion
tagged with: node.js
has comment: http://stackoverflow.com/comment/44916054
has comment: http://stackoverflow.com/comment/44919463
has comment: http://stackoverflow.com/comment/44915731

http://stackoverflow.com/q/28401595
tagged with: datatables
downvote count: 0
has answer: http://stackoverflow.com/a/28402313
tagged with: jquery
score: 1
favorite count: 0
type: Question
accepted answer: http://stackoverflow.com/a/28402313
has body: Do you know how to dynamically/later hide or show column when datatable's source is javascript? this method works for tables created with html source but not with method created with javascript source? var table = $('#example').dataTable({ "data": source, "columns": columns, "columnDefs": [ { "targets": [ 0 ], "visible": false, // no worries for hiding column at start }); var col = table.column("1").visible(false); //error if source is javascript
upvote count: 1
has title: How to hide or show dynamically column of table created using datatables in javascript with javascript source?
answer count: 1
has comment: http://stackoverflow.com/comment/45138601
tagged with: javascript
type: AnsweredQuestion

http://stackoverflow.com/a/28422345
has comment: http://stackoverflow.com/comment/45178524
has comment: http://stackoverflow.com/comment/45178668
score: 0
has comment: http://stackoverflow.com/comment/45178645
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45177827
has body: here is your solution http://jsbin.com/poturukeha/1/edit you need to float :right the whole section.
has comment: http://stackoverflow.com/comment/45179591
type: Answer
accepted answer of: http://stackoverflow.com/q/28422178
has comment: http://stackoverflow.com/comment/45181187
has comment: http://stackoverflow.com/comment/45178680
answers question: http://stackoverflow.com/q/28422178
has comment: http://stackoverflow.com/comment/45181095

http://stackoverflow.com/comment/45084584
type: AnswerComment
score: 0
type: Comment
has text: Hi, for some reasons, I can't make it work. Here's my fiddle: http://jsfiddle.net/8x488smq/1/
comment on: http://stackoverflow.com/a/28351376

oauth
tags question: http://stackoverflow.com/q/28428245
tags question: http://stackoverflow.com/q/28325645
tag name: oauth
type: Tag
tags question: http://stackoverflow.com/q/28347800
tags question: http://stackoverflow.com/q/28306953
tags question: http://stackoverflow.com/q/28308803
tags question: http://stackoverflow.com/q/28373085
tags question: http://stackoverflow.com/q/28417831

http://stackoverflow.com/a/28437681
upvote count: 4
has comment: http://stackoverflow.com/comment/45246475
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45246704
type: Answer
has body: It’s hard to say what you are trying to achieve, but I would point at some glitches within your code and provide the working version with paper-button instead of flip-card (since I have no code of flip-card.) TL;DR Live preview: http://plnkr.co/edit/yO865EkclZAsWBhzVSU4?p=preview The main issue with your code is that you call function addElementToDOM instead of passing it as a callback as requested by Polymer.import. function() { addElementToDOM(...); } would be OK. You use hyphen-less names for custom elements (like front and back) which is conventionally prohibited. Please use dashed as in my example. You have your function polluted into global space for no reason. I put it inside an element. You were likely want to puts your custom flip-card between front and back, but there is no vestige of content select='front/back' tag inside your template. You are trying to access shadowRoot in improper way. You might want to take a look at getDistributedNodes function, but in this case it’s easier to use naming convention and address an element simply by this.$.elementHere. You are supposed to explicitly specify for the polyfill to take care about unresolved things. The working code: Add paper button FRONT BACK I bet, your code could be working by applying the fix #1 but I strongly suggest you to fix other glitches as well. Hope it helps. P.S. Why on the earth you needed to dynamically import your element? What’s wrong with simple
accepted answer of: http://stackoverflow.com/q/28435057
answers question: http://stackoverflow.com/q/28435057
score: 4

http://stackoverflow.com/comment/88186776
comment on: http://stackoverflow.com/q/28353179
score: 0
type: Comment
type: QuestionComment
has text: Hello - were you able to get this working? If so, how did you do it?

http://stackoverflow.com/comment/45218464
has text: This does seem to be the answer. I would also appreciate it if you gave the JavaScript GitHub uses for this and/or your Firefox code, even if just to learn from. Thank you!
type: Comment
score: 2
comment on: http://stackoverflow.com/a/28440959
type: AnswerComment

http://stackoverflow.com/comment/45114680
type: AnswerComment
score: 0
type: Comment
has text: yes ! am recieving it (Y) . but how do i disay my values ?
comment on: http://stackoverflow.com/a/28387859

http://stackoverflow.com/comment/45677650
has text: Again, not really fulfilling the requirements here, while it will have the appearance of not reloading, it is basically reloading. Side effects will be executed, etc.
type: Comment
comment on: http://stackoverflow.com/a/28689345
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45138778
type: AnswerComment
comment on: http://stackoverflow.com/a/28401576
type: Comment
has text: I tried that, but it still refuses to allow null: `{ through: Library, as: "Books", foreignKey: { name: 'bookId', allowNull: true }}` gives `null value in column "bookId" violates not-null constraint`
score: 0

onsubmit
tags question: http://stackoverflow.com/q/28292153
type: Tag
tags question: http://stackoverflow.com/q/28333613
tag name: onsubmit

http://stackoverflow.com/q/28425542
tagged with: javascript
has title: How to extract data schema from json-ld format to generate html form
score: 0
tagged with: json-ld
answer count: 1
has body: So I am new to linked web and linked data. I have a data schema on remote server that is written in json-ld. I have to et that data and generate html forms based on t. I have actually tried rdforms and callimachus library and both haven't helped me much. Is there any other way to do so?
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
upvote count: 1
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28439894

http://stackoverflow.com/comment/44931300
comment on: http://stackoverflow.com/q/28288707
has text: Probably duplicate of http://stackoverflow.com/questions/4770025/how-to-disable-scrolling-temporarily
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/44995833
type: Comment
has text: I had tried calling other functions in my controller and had no luck. I also tried putting your suggestion in my controller and it didn't work.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28323991

http://stackoverflow.com/comment/45134605
type: Comment
comment on: http://stackoverflow.com/a/28399330
has text: @AlminIslamovic That being said, I don't see how you could set aside this and make use only of angular's controllers to build you application.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45190071
type: Comment
comment on: http://stackoverflow.com/a/28429150
has text: Overkill is the term that came to my mind after seeing the question. This answer should have been accepted by now:)
score: 0
type: AnswerComment

http://stackoverflow.com/q/28384459
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28396018
possible better answer: http://stackoverflow.com/a/28389847
has answer: http://stackoverflow.com/a/28389847
upvote count: 1
has body: I have seen many questions concerning randomly selecting array items without repeating. However, most of them are answered by using the splice method. But this removes items. I have already selected my items randomly, but they are repeating. In my two functions I select from each randomly selected item two "sub-items". The two functions are not working together, I am looking for a way that it is possible to select two different randomly selected items, without repetition, and without removing them. Can one please help me out? (Using Adobe Edge Animate) var xml_source = "series.xml"; var initLoadScript = false; var items = []; var itemTitle1; var obj = new Object(); var previousNumber = -1; loadXML(); function loadXML() { $.ajax({ type: "GET", url: xml_source, dataType: "xml", success: function(xml) { $(xml).find('sbs').find('channel').find('item').each(function() { items.push($(this)); }); itemOne(); itemTwo(); } }); } function itemOne(){ var randomNumber = Math.floor(Math.random()*14); var assignItem = randomNumber; console.log("random nummer 1: " + assignItem); sym.$("TitleText1").html(items[assignItem].find("author_name").text()); sym.$("Image1").html(" "); } function itemTwo(){ var randomNumber = Math.floor(Math.random()*14); var assignItem = randomNumber; console.log("random nummer 2: " + assignItem); sym.$("TitleText2").html(items[assignItem].find("author_name").text()); sym.$("Image2").html(" "); } Example of XML Structure: <?xml version="1.0" encoding="UTF-8" ?> <sbs version="1.0" xmlns:media="http://search.yahoo.com/mrss/"> <channel> Feed Video //www.URL.com Fri Fri 1 title aflevering //www.google.com //www.google.com berg Wed 1.0 video <provider_name>provider</provider_name> <provider_url>http://www.video.nl/url</provider_url> 10 10 title1 <author_name>author name</author_name> <author_url>http://www.google.com/</author_url> <media:content url="http://google.com" type="text/html" medium="document" expression="full" height="10" width="10" lang="us"> <media:…
has comment: http://stackoverflow.com/comment/45109797
accepted answer: http://stackoverflow.com/a/28390302
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45107224
has comment: http://stackoverflow.com/comment/45109643
has comment: http://stackoverflow.com/comment/45110075
type: Question
has comment: http://stackoverflow.com/comment/45108315
has title: Random select array item without duplicates without removing items (JavaScript)
tagged with: arrays
tagged with: javascript
tagged with: jquery
tagged with: random
answer count: 3
has answer: http://stackoverflow.com/a/28390302
downvote count: 0

http://stackoverflow.com/comment/100672166
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28433113
has text: @Kaddath I just validated this on the version this patch was written for (`jsPDF 0.9.0rc1 ( 2013-04-07T16:52 commit ID d95d8f69915bb999f6704e8021108e2e755bd868 )`), and it is actually correct as-is *for that version*. However, then I also checked it on the **latest version**, and you're indeed absolutely correct, and I'll correct the answer to reflect that with a note :).
score: 0

http://stackoverflow.com/a/28340714
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/28340633
has comment: http://stackoverflow.com/comment/45026970
score: 5
has comment: http://stackoverflow.com/comment/45026876
has comment: http://stackoverflow.com/comment/45027016
has body: You could set the type to search : &lt;input type="search" class="signup-input text-value" name="" placeholder="e.g. example@url.com"&gt; type="search" will add a x button inside the input, that deletes the content when clicked. fiddle -> http://jsfiddle.net/rnfp59jg/ Support for type="search" by modern browsers, from https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input : Feature Chrome Firefox (Gecko) IE Opera Safari type=search 5.0 4.0 (2.0) 10 11.01 (Yes)
upvote count: 5

http://stackoverflow.com/comment/44931984
has text: @JamieDixon - I had thought that was the issue, so I removed any calling of `$scope.editJob` aside from that. I could possibly change it to $timeout, but my complaint is that I shouldn't have to do the timeout, because I would assume Angular would pick up the correct model value and make the select have that value selected.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28281648

http://stackoverflow.com/comment/45363252
comment on: http://stackoverflow.com/a/28435415
type: AnswerComment
type: Comment
score: 0
has text: `Waypoint.refreshAll()` will recalculate trigger points on all waypoints, assuming you're using 3.x. On 2.x (which this answer seems to be using) it was `$.waypoints('refresh')`. But beware, you aren't checking for if the direction is "down". A refresh will end up triggering your footer waypoint in the "up" direction and causing another page to load.

http://stackoverflow.com/comment/45196304
type: Comment
comment on: http://stackoverflow.com/a/28432512
type: AnswerComment
has text: @Halcyon promisifcation is not magic. It goes over the properties of an object (and its prototype) and does what most answers here (including yours) do, while not touching the object's original properties (notice `connectAsync`, `queryAsync`, etc). There's no "half-half" situation here.
score: 0

jsp
tags question: http://stackoverflow.com/q/28433165
tags question: http://stackoverflow.com/q/28293863
tags question: http://stackoverflow.com/q/28424785
tags question: http://stackoverflow.com/q/28363783
tags question: http://stackoverflow.com/q/28286260
tags question: http://stackoverflow.com/q/28348586
tags question: http://stackoverflow.com/q/28293200
tags question: http://stackoverflow.com/q/28288322
tags question: http://stackoverflow.com/q/28299277
tags question: http://stackoverflow.com/q/28280286
tags question: http://stackoverflow.com/q/28430444
tags question: http://stackoverflow.com/q/28345395
tags question: http://stackoverflow.com/q/28359521
type: Tag
tags question: http://stackoverflow.com/q/28382355
tags question: http://stackoverflow.com/q/28340190
tags question: http://stackoverflow.com/q/28285795
tags question: http://stackoverflow.com/q/28425036
tags question: http://stackoverflow.com/q/28285776
tags question: http://stackoverflow.com/q/28293450
tag name: jsp
tags question: http://stackoverflow.com/q/28337425
tags question: http://stackoverflow.com/q/28404239
tags question: http://stackoverflow.com/q/28350701
tags question: http://stackoverflow.com/q/28332768
tags question: http://stackoverflow.com/q/28292608
tags question: http://stackoverflow.com/q/28428746
tags question: http://stackoverflow.com/q/28405804
tags question: http://stackoverflow.com/q/28398151
tags question: http://stackoverflow.com/q/28426028
tags question: http://stackoverflow.com/q/28398515
tags question: http://stackoverflow.com/q/28363711
tags question: http://stackoverflow.com/q/28346203
tags question: http://stackoverflow.com/q/28307770

http://stackoverflow.com/comment/45049009
score: 0
comment on: http://stackoverflow.com/a/28352154
type: Comment
has text: Now, how can i make the fields required?
type: AnswerComment

http://stackoverflow.com/q/28409022
tagged with: angularjs
upvote count: 2
tagged with: internationalization
accepted answer: http://stackoverflow.com/a/28409357
score: 2
type: AnsweredQuestion
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
has title: AngularJS: How to use translation (i18n) in controller for popup?
has answer: http://stackoverflow.com/a/28409357
has body: I', writing an app in angularjs and have to do the i18n. Everything's fine but i did the errorhandling and there's the problem: i don't know how to use the translation in controller for popups. My controller looks like this: function showErrorPopup($ionicPopup, $ionicHistory, $location, $translate, error) { if (error.status == 404) { errorId = ... $ionicPopup.show({ title: '&gt;&lt;/span&gt;', template: '', buttons: [{ text: 'OK' }] }); } else if (error.data.ExceptionMessage != null || error.data.ExceptionMessage != "" || error.data.ExceptionMessage != undefined) { errorId = ... $ionicPopup.show({ title: '&gt;&lt;/span&gt;', template: '', buttons: [{ text: 'OK' }] }); } else { errorId = ... $ionicPopup.show({ title: '&gt;&lt;/span&gt;', template: '', buttons: [{ text: 'OK' }] }); } } This is my controller. It depends what's the result, but i always want to show a popup with the error (title of the error = ERROR.TITLE, text of the error = ERROR.errorId). The ERROR and his TITLE or his ID (like 100, 200...) are defined in a json file. Can you help me to resolve this? If you have to know something more, just ask.
favorite count: 0

http://stackoverflow.com/comment/45155278
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28410898
score: 1
has text: Where did you define the variable foo? I am not seeing it in your code.

http://stackoverflow.com/q/28376642
score: 0
type: AnsweredQuestion
has body: HTML: JS: sidemenu.on('postclose', function() { $scope.show_y = false; $scope.show_x = true; }); the postclose function is not triggered when user swipes menu closed, clicks work fine though.... advise please? UPDATE --- $scope.$watch(function($scope) { return $scope.sidemenu.isMenuOpened(); }, function() { alert('hi'); }); not even isMenuOpened() is fired with swipe events on the sidemenu. I started a new project with a bare bones side-menu and angular directive, no change, no errors logged.
has answer: http://stackoverflow.com/a/28439355
possible better answer: http://stackoverflow.com/a/28402028
type: Question
has answer: http://stackoverflow.com/a/28402028
has title: onsen-ui postclose not triggered with swiping
answer count: 2
accepted answer: http://stackoverflow.com/a/28439355
has comment: http://stackoverflow.com/comment/45177155
tagged with: javascript
tagged with: onsen-ui

http://stackoverflow.com/comment/45002582
type: QuestionComment
has text: base64 encoding is needed for data uri(and are automatically decoded by the browser) but not for blobs.
score: 0
comment on: http://stackoverflow.com/q/28311185
type: Comment

http://stackoverflow.com/q/28290055
has comment: http://stackoverflow.com/comment/45008081
has title: How can I check that a date is not in the past without including the current day?
type: Question
tagged with: datetime
answer count: 1
has comment: http://stackoverflow.com/comment/44933790
linked to: http://stackoverflow.com/q/2698725
has comment: http://stackoverflow.com/comment/44933810
score: 0
has answer: http://stackoverflow.com/a/28290414
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
tagged with: date
has body: So I have a checkDate() function that I use to verify the date entered on a web form is not in the past before submitting. The problem is, this function also returns an error if the date entered is today's date. I'm assuming this has something to do with how datetimes are formatted as DD:MM:YYYY HH:MM:SS.sss and then converted to their epoch value, but I'm not sure how to go about validating that the entered date is NOT today while still checking that it's not a past date. I've posted my checkDate() function in its entirety below: Please note: the textbox with the date string we are checking against is named txtNeededBy. function checkDate() { var date = new Date($("#txtNeededBy").val()); ValidateDate = false; if (Date.parse(date) < Date.now()) { sb.append(" Needed by date must not be in the past. "); $("#txtNeededBy").addClass("input_error"); ValidateDate = true; if (sb.toString().length > 0) { $(".Errors").html(sb.toString()); $(".Errors").show(); return false; } } else { $("#txtNeededBy").removeClass("input_error"); } if (ValidateDate === true) { return false; } }

http://stackoverflow.com/comment/45021368
score: 0
comment on: http://stackoverflow.com/q/28337807
type: QuestionComment
type: Comment
has text: holy crap, thank you changed it lol.

http://stackoverflow.com/comment/45014939
type: AnswerComment
score: 0
type: Comment
has text: `$('f_images' + [i] + '.DOM')` makes no sense here. A jQuery selector cannot be used to read local variables like what `f_images` seems to be.
comment on: http://stackoverflow.com/a/28334047

http://stackoverflow.com/q/28361852
score: 0
has answer: http://stackoverflow.com/a/28362265
has answer: http://stackoverflow.com/a/28362116
upvote count: 1
accepted answer: http://stackoverflow.com/a/28362104
tagged with: jquery
favorite count: 0
has title: Jquery :first selector give second element instead of first
has body: I want select first row from any cell so I just wrote javascript like. var curcontrol = $("#cellno_111"); var firsttd= $(curcontrol).parents("table tbody tr:first"); alert($(firsttd).text()); And my table is below 0 0 1 1 when I use find() it giving me correct result var curcontrol = $("#cellno_111"); var firsttd= $(curcontrol).parents("table tbody").find("tr:first"); But I just want to know why the above code return second tr instead of first tr HERE IS MY JSBIN http://jsbin.com/lisozuvade/1/watch?html,js,output
possible better answer: http://stackoverflow.com/a/28361893
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28362104
answer count: 4
type: AnsweredQuestion
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28361893
tagged with: javascript

http://stackoverflow.com/comment/45187949
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28428037
has text: @mplungjan sorry i only aim it to make it understandable by a javascript beginner. I will try to change. Thank you for the feedback.
score: 0

http://stackoverflow.com/comment/45118669
type: Comment
has text: @OreDroids go through codeacademy link I provided. It'll explain why some things won't work and give basic bug testing. Right now, it's hard to know what's wrong without looking the code :)
comment on: http://stackoverflow.com/a/28390432
type: AnswerComment
score: 0

http://stackoverflow.com/q/28392960
score: 0
answer count: 1
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28392999
type: Question
has body: Wondering if there's an 'angular specific' way to try and achieve this. I have a page with some views. When a user clicks an anchor, the views change, simple enough. What I'm curious is, if when the user clicks, is it possible to store a variable (say the span) then pass it to the $routeProvider to load the content a bit more dynamically? so for anchor tag #name1, when that view is displayed, I can pass "name1" into nameHolder as a variable to load some files with same name. HTML name1 JS var nameHolder = []; var sampleApp = angular.module('sampleApp', ['ngRoute']); sampleApp.config(['$routeProvider', function($routeProvider) { $routeProvider. when('/' + nameHolder, { templateUrl: 'templates/individkcd.html', controller: 'individ', nameofuser: nameHolder }). when('/', { templateUrl: 'templates/home.html' }); }]); sampleApp.controller('individ', function($scope, $route) { $scope.img = $route.current.nameHolder; }); Thanks for any info. UPDATED: Solution at new thread. angular js - passing a variable into $routeProvider
tagged with: javascript
has title: pass a variable into $routeProvider in angular between views? - angularjs
linked to: http://stackoverflow.com/q/28416802

http://stackoverflow.com/comment/45134591
score: 0
type: AnswerComment
has text: how would you write it in jade? I am not using HTML syntax. I am getting an error saying Unexpected Identifier
comment on: http://stackoverflow.com/a/28399329
type: Comment

http://stackoverflow.com/comment/45106685
comment on: http://stackoverflow.com/a/28379103
score: 0
type: AnswerComment
type: Comment
has text: It definitely should be on gitHub README, instead of inside the code. Comment this, and I will +1. Show me the code based on my question example and I will accept your answer.

http://stackoverflow.com/comment/95233970
type: QuestionComment
has text: `$(this).toggle("fast");` why?
type: Comment
comment on: http://stackoverflow.com/q/28387810
score: 0

http://stackoverflow.com/comment/45189426
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28428616
has text: I implemented your changes. I am still unsure how to get the results I want when clicking the "type" options though.
type: Comment

http://stackoverflow.com/comment/45007078
comment on: http://stackoverflow.com/q/28329837
has text: Why cant you just use radio buttons?
type: Comment
type: QuestionComment
score: 3

http://stackoverflow.com/q/28416536
tagged with: jasmine
favorite count: 0
has body: I used to be able to use ddescribe and iit to have jasmine/karma run just a specific test or set of tests. However, now it no longer works, and I get this error: (or a similar one for iit). INFO [karma]: Karma v0.12.31 server started at http://localhost:8081/ INFO [launcher]: Starting browser PhantomJS INFO [PhantomJS 1.9.8 (Windows 7)]: Connected on socket jIMgciNEN5VXBdZOhDz2 with id 78471739 PhantomJS 1.9.8 (Windows 7) ERROR ReferenceError: Can't find variable: ddescribe at /.../test.js:146 I am running: karma 0.12.28, jasmine 2.2.0, karma-jasmine: 0.3.5, karma-phantomjs-launcher: 0.1.4 Here is what the test file basically looks like: 'use strict'; ddescribe('MyController', function() { it('should do xyz', function() { ... }); }); Any ideas at all? Is there some definition or configuration change that I have missed so that now ddescribe is no longer defined?
tagged with: karma-runner
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28417190
score: 40
type: Question
upvote count: 40
has title: No longer able to use ddescribe or iit
has answer: http://stackoverflow.com/a/28417190
downvote count: 0
tagged with: javascript
answer count: 1

http://stackoverflow.com/a/28359710
upvote count: 0
answers question: http://stackoverflow.com/q/28359614
has comment: http://stackoverflow.com/comment/45067326
has body: Check this &lt;?php $a = 5; $a = ($a==5) ? 'yes' : 'no'; echo 'the result is '.$a; // the result is yes ?&gt;
score: -1
has comment: http://stackoverflow.com/comment/58103017
downvote count: 1
has comment: http://stackoverflow.com/comment/45062679
type: Answer

http://stackoverflow.com/comment/45111405
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28386674
type: Comment
has text: Focus testing on firefox, because it has the worst support of all browsers.

http://stackoverflow.com/comment/45045727
score: 0
comment on: http://stackoverflow.com/q/28350939
has text: It might help if you post a fiddle of what you have.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28408984
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45257496
tagged with: javascript
tagged with: jquery
has body: As my plugin does not use the selector call(not sure how this is called) I wanted to remove this. // my plugin wrapper ;(function (root, factory) { if (typeof define === 'function' &amp;&amp; define.amd) { define(['jquery'], factory); } else { factory(root.jQuery); } }(this, function ($) { //"use strict"; // jshint ;_; var pluginName = 'myCustomPlugin'; function Plugin(element, options) { this.obj = $(element); this.o = $.extend({}, $.fn[pluginName].defaults, options); this.init(); }; Plugin.prototype = { init: function () { }, show: function (text) { alert(text); }, destroy: function () { this.obj.removeData(pluginName); } }; $.fn[pluginName] = function (option, param) { return this.each(function () { var $this = $(this); var data = $this.data(pluginName); var options = typeof option == 'object' &amp;&amp; option; if (!data) { $this.data(pluginName, (data = new Plugin(this, options))) } if (typeof option == 'string') { data[option](param); } }); }; $.fn[pluginName].defaults = { option1: '', option2: '' }; })); Currently I instantiate the plugin like this: $('body').myCustomPlugin(); $('body').myCustomPlugin('show', 'Hello world'); I would like to change this to use this format: $.myCustomPlugin(); $.myCustomPlugin('show', 'Hello world');
possible better answer: http://stackoverflow.com/a/28584555
score: 0
has answer: http://stackoverflow.com/a/28460795
accepted answer: http://stackoverflow.com/a/28460795
has comment: http://stackoverflow.com/comment/45256901
has answer: http://stackoverflow.com/a/28584555
has comment: http://stackoverflow.com/comment/45247428
has title: Need help modifing my jQuery plugin
type: AnsweredQuestion

http://stackoverflow.com/comment/136640345
has text: And you definitely want next() call outside of the if statement.
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/53522513

http://stackoverflow.com/comment/44928726
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28286864
has text: sparky- that you just made is counting how many times a select box is touched and clicked, and it is live. i need mine to be live just like that, however my page deals with 100's of dropdown boxes, and my code counts how many times "mercedes" was selected, or audi, etc.
score: 0

http://stackoverflow.com/comment/44917297
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28281531
has text: @rekoDolph Edited with just that, misread the question initially.

http://stackoverflow.com/a/28397941
has body: function change(path, amount){ var key = Object.keys(path)[0]; path[key] += amount; } // calling function change (stock.table,-2); console.log(stock.table.apple); you can send only part for update
score: 0
has comment: http://stackoverflow.com/comment/45131717
type: Answer
answers question: http://stackoverflow.com/q/28397783

settimeout
tags question: http://stackoverflow.com/q/28385426
tags question: http://stackoverflow.com/q/28409663
tags question: http://stackoverflow.com/q/28404626
tags question: http://stackoverflow.com/q/28421156
tags question: http://stackoverflow.com/q/28349445
tags question: http://stackoverflow.com/q/28417282
tags question: http://stackoverflow.com/q/28325172
tags question: http://stackoverflow.com/q/28374002
tags question: http://stackoverflow.com/q/28403462
tags question: http://stackoverflow.com/q/28397470
tags question: http://stackoverflow.com/q/28329951
tags question: http://stackoverflow.com/q/28406978
type: Tag
tag name: settimeout
tags question: http://stackoverflow.com/q/28435991
tags question: http://stackoverflow.com/q/28310575

http://stackoverflow.com/comment/45154557
has text: @urbaindepuce You can declare the `WeakMap` inside the IIFE if you want, there's no difference, but not inside the constructor. Every instance will have it's own privates. If you want to make privates immutable once set you can either use `Object.freeze` or `Object.defineProperty` with `writable: false`.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28400703

http://stackoverflow.com/a/28361169
score: 1
downvote count: 0
has body: Just make a similar Ajax request to showFilteredResult.php I would have them in a separate function. function showFilteredResult($result){ $.ajax({ url:"http://localhost/showFilteredResult.php", data: { result:$result }, type:"POST", dataType: "json", complete:function(response){ $rtndata=response.responseText; var dat1a=jQuery.parseJSON($rtndata); var result=dat1a.OrderID; console.log(result[0]);// do something with the data returned from showFilteredResult.php } }); } and from the request that you have just call that funciton like ... $rtndata=response.responseText; var dat1a=jQuery.parseJSON($rtndata); var result=dat1a.OrderID; console.log(result[0]);// send this result showFilteredResult(result[0]); } });
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28361098

http://stackoverflow.com/a/28467852
has body: The first issue I see is that your are placing your video as (hidden) inline content. Most dynamic inline or multimedia content, as is the case of audio, videos and iframes, causes other problems like audio/video still playing in the background after fancybox is closed, etc... not mentioning they may also affect your page load and performance. I wouldn't advice you to use static HTML inline content as you have it but to take another approach and build the HTML content to show in fancybox on-the-fly. First, target your MP4 media file directly in your link's href like : Notice that with this approach, you could have different links to several videos (using classes instead of ID in your selector) and you only need to set the corresponding href without having to create a new hidden inline content for each new video. Then, in your fancybox custom initialization script, use callbacks to : pre-build the content and insert the href from the link (beforeLoad) initialize video.js (beforeShow) remove the video.js instance after you are done (afterClose). Here is the code: var player = {}; // global object (so we don't have to initialize several variables) jQuery(document).ready(function ($) { $("#btnForm").fancybox({ fitToView : false, // keeps fixed video dimensions regardless screen size width : 640, // matches size in tag height : 264, type : "html", // this is important autoSize: false, // fixes intermediate state beforeLoad : function () { // create a random ID : player.id = "video-player" + new Date().getTime(); // pre-build HTML video content : player.content = ' ' + ' To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video ' + ' '; // load video.js flash fallback : videojs.options.flash.swf = "{path}/video-js.swf"; // set fancybox content : this.content = player.content; }, beforeShow : function () { player.js = videojs(player.id); // initialize video.js }, afterClose : function () { $(player.js).remove(); // remov…
accepted answer of: http://stackoverflow.com/q/28400370
score: 0
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/28400370

http://stackoverflow.com/comment/45057404
type: QuestionComment
type: Comment
score: 0
has text: And it worked again Musa... You are my life savior...
comment on: http://stackoverflow.com/q/28355830

http://stackoverflow.com/comment/45203724
score: 0
comment on: http://stackoverflow.com/q/28434618
has text: Do you save the user's actions so that they're repeated each time you re-draw the canvas?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45010126
score: 0
type: AnswerComment
type: Comment
has text: `3 * { valueOf: function(){ return 5} }.valueOf()` also works, I think valueOf is automatically invoked in `3 * { valueOf: function(){ return 5} }` ???
comment on: http://stackoverflow.com/a/28331210

http://stackoverflow.com/q/28368472
score: 1
has answer: http://stackoverflow.com/a/28371830
has comment: http://stackoverflow.com/comment/45081427
has title: How to change underline border in paper input Polymer
has body: I want to change an underline border in paper input in Polymer but I don't know how to do it. Any idea? If I inspect the component, what I want to change is the back color, but is indexed inside a classes of the component. Should I make a queryselector? How I call that class? Thanks.
type: Question
tagged with: polymer
tagged with: javascript
has comment: http://stackoverflow.com/comment/45078739
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/28371830
tagged with: css
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/comment/47482884
type: Comment
type: QuestionComment
has text: On method to solve the problem is to repeat the read 'threads = GmailApp.search(search, 0, 5);' read until 'threads == 0' due to certain limitations & the quantity of emails you may have, a time event may be needed for each read
score: 0
comment on: http://stackoverflow.com/q/28382105

http://stackoverflow.com/comment/46082169
score: 2
type: Comment
has text: That wiki is outdated. Firefox *does* support constraints. See my answer.
type: AnswerComment
comment on: http://stackoverflow.com/a/28294360

http://stackoverflow.com/q/28410898
has comment: http://stackoverflow.com/comment/45155508
tagged with: pushstate
has title: How do I use the popstate function with javascript + ajax, not jQuery?
has comment: http://stackoverflow.com/comment/45155567
type: Question
has comment: http://stackoverflow.com/comment/45155289
tagged with: javascript
has comment: http://stackoverflow.com/comment/45274440
has comment: http://stackoverflow.com/comment/45155411
tagged with: ajax
has comment: http://stackoverflow.com/comment/45155278
has comment: http://stackoverflow.com/comment/45155509
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: popstate
has body: Sorry for newbie question here, I am missing something, probably easy, but vital about javascript I guess.. I have an ajax-website, with four html pages, index.php, food_and_health.php, enlightenment.php, and about_us.php. I have ajax functions in the three, not index. And I do understand I need to add the popstate function, for using back and forward, and I am looking into a tutorial at this moment, as u see, I only have console log. I get the console message, 'foo is not defined', and I tried making it a global variable, with no luck, as I don't quite know if that is the problem either. I have no anchor, or anything in my html, that has the id of 'foo', but I tried changing from foo, to 'text', and to 'cssmenu', in my js.file, and tried adding id='foo' to one of my anchor tags, in my html, but still same message. So I guess, that it is a local variable, inside my ajax function. Actually, the page works, except back and forward, and if I try to navigate directly to an ajax-page/ state. I know this is, because I need to set some data in my popstate function, I am thinking that something like this.url will work there also, like in my pushstate-function.(conjunction between push-state and popstate is what I am missing.) But how do I add the popstate function? Do I need to specify for each page, or can I somehow say, take this.url, as it is done in the pushstate function, and have that state used, as it is saved in pushstate? I guess I need to link the popstate, in the ajaxfuntion also, somehow.. 2nd question, not that important thou. Why do my console log display some jQuery? Is that because of the 'google-apis', link I have for my font(tangerine)? As I do not use any jQuery, I was surpriced that my index-page is using jQuery, but I think that is the issue. In my console, I have jquery.1.8.2.min.js, and collectorjQuery.js Are these from 'googleapis'? :) I will add a jsfiddle also, this shows my food_and_health.php page, and my css and js. (Ignore the css mostly, just …
has comment: http://stackoverflow.com/comment/45155362
has comment: http://stackoverflow.com/comment/45155475
answer count: 0
has comment: http://stackoverflow.com/comment/45155383
has comment: http://stackoverflow.com/comment/45155363
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45155326
has comment: http://stackoverflow.com/comment/45155944

http://stackoverflow.com/q/28349522
has body: I am trying to insert the following: &lt;div class="modal fade" id="modalForwardMail" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt; &lt;h4 class="modal-title" id="myModalLabel"&gt;Forward this Mail&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt;&lt;center&gt; &lt;form name="contactform" method="post" action="forwardForm.php" class="form-horizontal" role="form"&gt; &lt;input type="email" class="form-control" placeholder="Receiver Email Address" name="forwardEmail"&gt; &lt;input class="form-control" placeholder="Full Name" type="text" value={{currentUser.get('fullName')}} name="fullName"&gt; &lt;input class="form-control" placeholder="Subject" type="text" name="subject"&gt; &lt;input class="form-control" placeholder="Sender Email Address" value={{currentUser.get('username')}} type="text" name="email"&gt; &lt;br&gt;&lt;textarea class="form-control" rows="5" placeholder="Notes" name="message" cols="30"&gt;&lt;/textarea&gt; &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Cancel&lt;/button&gt; &lt;input type="submit" class="btn btn-default" name="submit" value="Submit"&gt; &lt;/form&gt;&lt;/center&gt; &lt;h3&gt;&lt;/h3&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; Into: $('button.forward').click(function() { }); Below is the entire jquery code: var UploadMessage = Parse.Object.extend("Upload"); var querym = new Parse.Query(UploadMessage); querym.equalTo("user", currentUser); querym.equalTo("Type", "Letter"); querym.descending("createdAt"); querym.find({ success: function(querym) { //alert("Successfully retrieved " ); // Do something with the returned Parse.Object values for (var i = 0; i &lt; querym.length; i++) { var object = querym[i]; (function…
has title: Inserting html code within a jquery function
has comment: http://stackoverflow.com/comment/45043576
has comment: http://stackoverflow.com/comment/45044615
has comment: http://stackoverflow.com/comment/45044071
linked to: http://stackoverflow.com/q/28254670
has comment: http://stackoverflow.com/comment/45045806
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28350795
score: 0
has comment: http://stackoverflow.com/comment/45043060
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45042965
tagged with: parse-platform
has comment: http://stackoverflow.com/comment/45043995
type: UnansweredQuestion

http://stackoverflow.com/q/28406445
type: Question
has comment: http://stackoverflow.com/comment/45147422
has answer: http://stackoverflow.com/a/72445658
downvote count: 0
has answer: http://stackoverflow.com/a/28406530
tagged with: javascript
has answer: http://stackoverflow.com/a/28406626
has comment: http://stackoverflow.com/comment/45147232
has title: Add a fadeIn effect on toggleclass?
has answer: http://stackoverflow.com/a/28406962
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/28394678
tagged with: css
favorite count: 0
answer count: 5
type: UnansweredQuestion
upvote count: 3
has body: I want to add a fadeIn/Out effect on a toggle class when navigation is open and close. Somebody know how? I'm using the toggle class because of a responsive problem i had before when resizing part of the navigation disappeared. FIDDLE example nav ul.show { display: block; } And for the javascript $(function() { $('.nav-btn').click(function(event) { $('nav ul').toggleClass("show"); }); });
score: 3
has comment: http://stackoverflow.com/comment/45147389
tagged with: fade
has answer: http://stackoverflow.com/a/28406558

http://stackoverflow.com/q/28312326
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44975034
tagged with: jquery
has comment: http://stackoverflow.com/comment/44975064
has body: I have this javascript which has a banner showcased on home page. Somehow it stopped working even though i did not change anything in the script. Are the brackets wrong...please help. $( ".container" ).prepend( " " + " " + "or Watch our Video " ); If you need css or anything else I will provide. Please help, im trying to fix this problem tonight as i want the site to be up and running tomorrow. Thank you!
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/33641812
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/44975260
has answer: http://stackoverflow.com/a/28312452
has comment: http://stackoverflow.com/comment/44975123
has comment: http://stackoverflow.com/comment/44975298
has comment: http://stackoverflow.com/comment/44975114
has comment: http://stackoverflow.com/comment/44975088
has comment: http://stackoverflow.com/comment/44975509
has comment: http://stackoverflow.com/comment/44975143
has comment: http://stackoverflow.com/comment/44975168
has comment: http://stackoverflow.com/comment/44975076
type: Question
has title: Javascript code changed/main banner not working
has comment: http://stackoverflow.com/comment/44975019
has comment: http://stackoverflow.com/comment/44975028
has comment: http://stackoverflow.com/comment/44975275
tagged with: javascript
has comment: http://stackoverflow.com/comment/44975128

http://stackoverflow.com/q/28433178
has answer: http://stackoverflow.com/a/28433569
has body: I am using scrollIntoView() on an event target to ensure it is visible in its parent which has overflow: scroll, this is mainly for accessibility reasons. My problem is that I also have click events associated with this element and when a click event also fires the focus e.target.scrollIntoView() is preventing other events from firing. This is my current example: http://jsfiddle.net/omhuorpr/ require([ "dojo/query", "dojo/on" ], function(query, on){ var el = query('#someElement'); el.on('click', function(e){ e.preventDefault(); console.log("clicked"); }); el.on('focus', function(e){ console.log("focus"); e.target.scrollIntoView(); }); }); If you click on the element and check the console it will only fire the focus, if you re-click it then fires the click. Ideally I want to fire both at the same time or just the click. A simple fix that works is to move this process to the end of the execution stack via a timeout however ideally I want to find out why scrollIntoView() is preventing other events from firing.
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45197421
tagged with: dojo
accepted answer: http://stackoverflow.com/a/28433569
type: AnsweredQuestion
score: 3
upvote count: 3
has title: scrollIntoView() preventing other listeners from triggering
type: Question
downvote count: 0
tagged with: javascript
tagged with: dom-events

http://stackoverflow.com/q/28300882
favorite count: 0
accepted answer: http://stackoverflow.com/a/28352826
type: AnsweredQuestion
score: 3
tagged with: packery
upvote count: 3
has body: Can anyone help me how to save the order of a packery elements while dragging. and then reorder the packery items in the saved order.? here is the code I used before &lt;div class="g_container"&gt; &lt;?php foreach($_POST['old_img'] as $key=&gt;$val){ ?&gt; &lt;div class="item" tabindex="&lt;?php echo $key; ?&gt;"&gt; &lt;img src="../img/gallery/&lt;?php echo $val; ?&gt;"&gt; &lt;/div&gt; &lt;?php } ?&gt; &lt;/div&gt; here is the javascript code. &lt;script src="../js/packery.pkgd.min.js"&gt;&lt;/script&gt; &lt;script src="../js/draggabilly.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function(){ // Packery // var $container = $('.g_container').packery({ gutter:10 }); $container.find('.item').each( function( i, itemElem ) { // make element draggable with Draggabilly var draggie = new Draggabilly( itemElem ); // bind Draggabilly events to Packery $container.packery( 'bindDraggabillyEvents', draggie ); }); $("#save_gallery").on("click",function(){ var page_name=$("#pn").val(); var gallery=$(".gallery").html(); $.ajax({ data:"gallery="+gallery+"&amp;pn="+page_name, method:"POST", cache:false, url:"ajax/save-gallery.php", success:function(data){ alert(data); //location.href="page-galleries.php"; } }); }); }); &lt;/script&gt; Thanks in advance. :)
type: Question
has title: Packery Save order and reuse the order
downvote count: 0
tagged with: javascript
answer count: 1
has answer: http://stackoverflow.com/a/28352826

http://stackoverflow.com/comment/45154642
type: AnswerComment
comment on: http://stackoverflow.com/a/28409742
type: Comment
has text: Sorry. Don't really know much about jade. I'd recommend posting a new question as your question didn't even mention jade.
score: 0

http://stackoverflow.com/comment/45018047
type: QuestionComment
score: 2
has text: If you were loading it into an `Image` object you could use its `onerror` property to call a function. I'm not sure how you would do the equivalent with a style.
comment on: http://stackoverflow.com/q/28335961
type: Comment

http://stackoverflow.com/comment/45082659
has text: I changed my if statement in the php file to the one you provided and this worked. Thank You!
type: Comment
comment on: http://stackoverflow.com/a/28357424
score: 0
type: AnswerComment

http://stackoverflow.com/a/28410369
has comment: http://stackoverflow.com/comment/45154643
has comment: http://stackoverflow.com/comment/45154409
upvote count: 1
answers question: http://stackoverflow.com/q/28409927
has comment: http://stackoverflow.com/comment/45154821
has comment: http://stackoverflow.com/comment/45154546
type: Answer
has comment: http://stackoverflow.com/comment/45154268
has comment: http://stackoverflow.com/comment/45154442
downvote count: 0
has body: Check this code with out any plugin, we are first braking the number by comma.We get 2 parts in this. From one part we remove the dots and join them again. //input number var inputNumber = "1.123.355,50"; // splitting by comma var split = inputNumber.split(','); //getting the first part and replacing all dots with null var wholeNumber = split[0].replace(/\./gi, ''); //combining the splitted parts again var formattedNumber = wholeNumber + "." + split[1]; alert(formattedNumber) UPDATE: Above code returns a string if you need it as integer you can do: var formattedNumber = Number(wholeNumber + "." + split[1]); //or var formattedNumber = parseFloat(wholeNumber + "." + split[1]); //or this will preserve the last 2 decimal points also var formattedNumber = parseFloat(wholeNumber + "." + split[1]).toFixed(2);
score: 1

http://stackoverflow.com/comment/44917444
type: Comment
comment on: http://stackoverflow.com/q/28281616
has text: Possible duplicate - http://stackoverflow.com/questions/19827605/change-bootstrap-navbar-collapse-breakpoint-without-using-less
score: 3
type: QuestionComment

http://stackoverflow.com/q/28292480
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: There are 3 skills lines and i want them to be placed one next to another, in 3 columns, and i want to create the 4th column too! Originally, it's like this _ _ _ _ and i want like this __________ _________ ______________ ________________ __________ _________ ______________ ________________ _________ __________ ______________ _______________ /* About Us --------------------------------------------------------*/ } .teamSkill { margin-bottom: 40px; } p.skill { clear: left; font-size: 11px; letter-spacing: 0.04em; margin: 0; text-transform: uppercase; } .bar { background-color: #7b133c; border-radius: 11px; color: #FFFFFF; display: inline-block; float: left; height: 22px; line-height: 22px; margin: 0 0 2px; transition: all 0.6s ease-in-out 0s; width: 22px; } .teamSkill:hover .percent100 {width: 100%;} .teamSkill:hover .percent95 {width: 95%;} .teamSkill:hover .percent90 {width: 90%;} .teamSkill:hover .percent85 {width: 85%;} .teamSkill:hover .percent80 {width: 80%;} .teamSkill:hover .percent75 {width: 75%;} .teamSkill:hover .percent70 {width: 70%;} .teamSkill:hover .percent65 {width: 65%;} .teamSkill:hover .percent60 {width: 60%;} .teamSkill:hover .percent55 {width: 55%;} .teamSkill:hover .percent50 {width: 50%;} .teamSkill:hover .percent45 {width: 45%;} .teamSkill:hover .percent40 {width: 40%;} .teamSkill:hover .percent35 {width: 35%;} .teamSkill:hover .percent30 {width: 30%;} .teamSkill:hover .percent25 {width: 25%;} .teamSkill:hover .percent20 {width: 20%;} p.percent { float: right; margin-right: 6px; text-align: right; opacity: 0; transition: all 0.6s ease-in 0s; } .ie8 p.percent { display:none; } .teamSkill:hover p.percent { opacity: 1; } .ie8 .teamSkill:hover p.percent { display:block; } .statsWrap { width: 130px; margin: 10px; float: left; } .stats { display: inline-block; position: relative; width: 100%; transition: all 0.3s ease-in-out 0s; } .statDummy { margin-top: 100%; } .statInfo { position: absolute; top: 0; bottom: 0; left: 0; right: 0; background-color:…
has answer: http://stackoverflow.com/a/28307059
tagged with: widget
upvote count: 1
possible better answer: http://stackoverflow.com/a/28307059
has answer: http://stackoverflow.com/a/28292844
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/28292844
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
has title: Placing content in columns
favorite count: 0

http://stackoverflow.com/comment/45114024
comment on: http://stackoverflow.com/q/28388227
has text: what do you mean with won't pass? How do you get this URL? Is it a form submission URL or?
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/127729193
score: 1
comment on: http://stackoverflow.com/a/72247160
type: AnswerComment
type: Comment
has text: While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/31777672)

http://stackoverflow.com/comment/45147312
comment on: http://stackoverflow.com/q/28404780
type: Comment
has text: FYI: You are using `mysql_real_escape_string` _in combination_ with prepared statements here, which is of course nonsense. (And you should not be using the `mysql` functions any more in any case; use `mysqli` or PDO instead.)
score: 0
type: QuestionComment

http://stackoverflow.com/a/28417940
has body: complete is always called no matter its success or error. So you are running into error condition and complete gets called anyway after error is executed. You can add additional params (jqXHR jqXHR, String textStatus, String errorThrown) in error function to figure out what the error is.
has comment: http://stackoverflow.com/comment/45169448
answers question: http://stackoverflow.com/q/28417769
has comment: http://stackoverflow.com/comment/45169580
has comment: http://stackoverflow.com/comment/45170148
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45169973

http://stackoverflow.com/a/28321281
score: 5
upvote count: 5
has body: You are doing it incorrectly. The replace() method returns a new string with some or all matches of a pattern replaced by a replacement. This method does not change the String object it is called on. It simply returns a new string. Thus in your case you are always invoking this function on textElem which will not get affected and you end up getting the result of last replacement. var newText = textElem.replace("BROWN", "RED");//textElem is not changed newText = textElem.replace("FOX", "RABBIT");//textElem is not changed and hence you will not get the above replacement Therefore You should invoke the replace method on newText and assign to itself like below var newText = textElem.replace("BROWN", "RED"); newText = newText.replace("FOX", "RABBIT");//replace and assign to the same string
has comment: http://stackoverflow.com/comment/44990869
downvote count: 0
has comment: http://stackoverflow.com/comment/44990672
type: Answer
answers question: http://stackoverflow.com/q/28320971

http://stackoverflow.com/q/28353988
type: AnsweredQuestion
score: 4
has comment: http://stackoverflow.com/comment/45051890
has title: How does Feed.ly determine iFrame load progress?
accepted answer: http://stackoverflow.com/a/28354402
linked to: http://stackoverflow.com/q/10397486
type: Question
upvote count: 4
tagged with: javascript
has comment: http://stackoverflow.com/comment/45051987
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
tagged with: feedly
has answer: http://stackoverflow.com/a/28354402
favorite count: 0
tagged with: iframe
has comment: http://stackoverflow.com/comment/45051704
has body: If you read RSS items on Feed.ly, you have an option to "preview" the item, which opens up the corresponding URL in an iFrame. They have somehow gotten a load bar on top of the frame though, can't figure out how they got access to the load percentage. If they're faking it, they're doing a fantastic job. Anyone have any idea how to get load progress from an iframe?
has comment: http://stackoverflow.com/comment/45051832

http://stackoverflow.com/a/28398025
answers question: http://stackoverflow.com/q/28397983
score: 2
has comment: http://stackoverflow.com/comment/45132512
downvote count: 0
has comment: http://stackoverflow.com/comment/45133253
has body: One way; object literals within an array: var calendar = { months: [ { name : "Jan", days : 31 }, { name : "Feb", days : "28ish" } ] }; alert( calendar.months[0].days );
upvote count: 2
has comment: http://stackoverflow.com/comment/45132297
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45132495
accepted answer of: http://stackoverflow.com/q/28397983
type: Answer

http://stackoverflow.com/q/28285962
has comment: http://stackoverflow.com/comment/44926054
has comment: http://stackoverflow.com/comment/44926323
upvote count: 1
downvote count: 1
type: Question
tagged with: function
has comment: http://stackoverflow.com/comment/44926237
tagged with: javascript
tagged with: jquery
score: 0
tagged with: create-function
answer count: 1
accepted answer: http://stackoverflow.com/a/28286158
favorite count: 0
has comment: http://stackoverflow.com/comment/44926100
has title: Creating temporal functions with dynamically generated names in jQuery
has body: I have an external javascript file which is loaded dynamically, and it has an oncomplete= variable, which increases its value each time that it is called. For example: First time: external.js?oncomplete=sayHello1 Second time: external.js?oncomplete=sayHello2 Third time: external.js?oncomplete=sayHello3 Because of that I need to dynamically create functions to execute the oncomplete= callback each time. That means, that I need to create functions with these names: sayHello1(); sayHello2(); ...etc This is my current code, which creates a specific name function: var sayHello = function (){ console.log('hello'); }; sayHello(); The question is: How can I create temporal functions with dynamically generated names in jQuery?
has answer: http://stackoverflow.com/a/28286158
has comment: http://stackoverflow.com/comment/44926306
has comment: http://stackoverflow.com/comment/44927553
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44926185

http://stackoverflow.com/q/28326853
has comment: http://stackoverflow.com/comment/45001970
tagged with: javascript
tagged with: jquery
score: 0
tagged with: jquery-selectors
possible better answer: http://stackoverflow.com/a/28326903
has comment: http://stackoverflow.com/comment/45002050
accepted answer: http://stackoverflow.com/a/28393051
has comment: http://stackoverflow.com/comment/45002389
type: AnsweredQuestion
has body: Here's my html code: Not Published Published Unpublish Publish Now i want to select parent's sibling button using jQuery. If i click on any of li element then how can i perform some action on I am not so aware of jQuery selector. Thanks in advance for help. relevant Demo JsFiddle In above demo, If user clicks on NO button, it will become 'loading...' I want this like: User clicks on NO-2 from dropdown then also NO button should become 'loading'
has answer: http://stackoverflow.com/a/28393051
type: Question
has title: action on parent's sibling in jQuery
answer count: 2
has answer: http://stackoverflow.com/a/28326903

http://stackoverflow.com/comment/47699160
type: Comment
comment on: http://stackoverflow.com/a/28432087
score: 3
has text: Incredible answer! Thank you for taking time to write this.
type: AnswerComment

http://stackoverflow.com/q/28436029
has body: I am using a Colorbox modal for a image selection in one of my forms. Is there a way to dynamically pass the image selection outside of the Colorbox and then close the Colorbox? I have been searching here on StackOverflow but I cant find anyone else trying to achieve the same thing.
accepted answer: http://stackoverflow.com/a/28436707
tagged with: php
type: AnsweredQuestion
has title: Pass selection from Colorbox to parent
downvote count: 1
type: Question
tagged with: javascript
tagged with: jquery
score: -1
has answer: http://stackoverflow.com/a/28436707
upvote count: 0
answer count: 1
favorite count: 0
tagged with: colorbox

http://stackoverflow.com/a/28328674
type: Answer
has comment: http://stackoverflow.com/comment/45029048
score: 1
upvote count: 1
has body: Use push() to add the elements to the array in the loop. var arrayku = new Array(); for (var i = 0; i &lt; sURLVariables.length; i++) { var sParameterName = sURLVariables[i].split('='); if (sParameterName[0] == sParam) { arrayku.push( [i, sParameterName[0], sParameterName[1]]); //i is id, sParameterName[0] is first 2nd param, sParameterName[1] is third param } } console.log(arrayku);
answers question: http://stackoverflow.com/q/28328606
downvote count: 0
has comment: http://stackoverflow.com/comment/45035344

http://stackoverflow.com/comment/45058469
type: Comment
type: QuestionComment
has text: You should take advantage of the fact that `.each()` passes your callback both the DOM element *and* it's index. That way you'll have a local variable to use when setting the timeout instead of having all the timeout callbacks share the same (global!!) `i` variable.
score: 0
comment on: http://stackoverflow.com/q/28357579

http://stackoverflow.com/a/28386136
downvote count: 0
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/45110332
has body: The problem is that even though the object that comes from server which you set as $scope.trip.location looks similar to the one in $scope.locations array, they are different objects. At the same time, Angular checks for object equility in order to set selectbox option as selected, and two object are equal only if the are the same object. This is not your case. In your case you will have to loop though $scope.locations array, find proper object and set $scope.trip to found value. This should work for you: // trip object came from server var trip = {"location":{"text":"Foo","value":"f6a62517"}}; // use it to find similar object in $scope.locations array $scope.trip = { location: $scope.locations.filter(function(location) { return location.value === trip.location.value; })[0] };
answers question: http://stackoverflow.com/q/28386052

http://stackoverflow.com/comment/45171725
type: QuestionComment
has text: @phillip100 thank you but I'm not you. I like to learn so please
type: Comment
comment on: http://stackoverflow.com/q/28418782
score: 0

http://stackoverflow.com/q/28370847
has comment: http://stackoverflow.com/comment/45082602
tagged with: javascript
has comment: http://stackoverflow.com/comment/45083112
downvote count: 0
has comment: http://stackoverflow.com/comment/45083189
favorite count: 0
type: UnansweredQuestion
has body: I have searched many of the date questions on here, but I am still stumped: for (nn=3;nn&lt;datacommit.length;++nn){ var duedate1 = datacommit[nn][4] var duedate = Utilities.formatDate(duedate1,'GMT+0200','yyyy:MM:dd'); var sevendaysfromnow1 = datacommit[nn][9] var sevendaysfromnow = Utilities.formatDate(sevendaysfromnow1,'GMT+0200','yyyy:MM:dd'); if (+duedate==+sevendaysfromnow) { do my thing}}; Does not find a match when the same date is in those two separate columns. What am I doing wrong?
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/45083511
upvote count: 1
linked to: http://stackoverflow.com/q/7606798
tagged with: date
has comment: http://stackoverflow.com/comment/45083133
has comment: http://stackoverflow.com/comment/45082960
type: Question
tagged with: google-apps-script
has comment: http://stackoverflow.com/comment/45082836
has title: Comparing Dates Formated with: "Utilities.formatDate()" in Google script

http://stackoverflow.com/q/28321090
has comment: http://stackoverflow.com/comment/44990465
tagged with: area
tagged with: approximation
has body: I have a rotated rectangle that is represented by the coordinates of its 4 vertices (Actually represented by 4 lat-lon). I want to divide the rectangle into equal area grids. I need this to find the approx area of intersection of 2 rotated rectangles, (using sampling approach). How do I divide the rectangle into equal area grid ? I just want the center points of the grids. This is because I will check how many of these center points lie inside a 2nd rectangle and find the approx intersection area. I tried searching, but most of the solution do not work for rotated rectangles. Note : I am using JavaScript for implementation. Code will be helpful :) Edit : This code is will NOT work for rotated rectangle. var numDivide = 7; var i = (region1[1].x - region1[0].x) / numDivide; var j = (region1[2].y - region1[0].y) / numDivide; var xPos = region1[0].x; var yPos = region1[0].y; var gridCenters = []; for(var k = 0; k &lt; numDivide; ++k) { var newPosX = (xPos + (i / 2)); for(var l = 0; l &lt; numDivide; ++l) { var newPosY = (yPos + (j / 2)); gridCenters.push({x: newPosX, y: newPosY}); yPos = yPos + j; } xPos = xPos + i; yPos = region1[0].y; }
answer count: 0
type: UnansweredQuestion
has title: Dividing rotated rectangle into equal area grid
type: Question
has comment: http://stackoverflow.com/comment/44991721
has comment: http://stackoverflow.com/comment/44991959
score: 0
tagged with: javascript

http://stackoverflow.com/comment/45012095
comment on: http://stackoverflow.com/q/28332480
score: 0
type: QuestionComment
has text: Nothing loads in the div. I get no images at all.
type: Comment

http://stackoverflow.com/comment/45039610
type: Comment
has text: @Pointy, huh! I can't believe I oversaw this. That's what was under my nose for days. :) Why don't you post it as an answer so I can accept? :)
comment on: http://stackoverflow.com/q/28347636
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45004201
type: QuestionComment
comment on: http://stackoverflow.com/q/28328044
score: 0
has text: Sorry, I updated the end of my question so it's explaining exactly what I want to get done.
type: Comment

http://stackoverflow.com/comment/45068655
type: AnswerComment
score: 0
has text: Well, this is how I am also using it.. except using findOne but I wanted to reduce my callback hell by avoiding more nested logic. Thanks anyway.
comment on: http://stackoverflow.com/a/28348264
type: Comment

http://stackoverflow.com/comment/44925314
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28285655
has text: http://blog.slaks.net/2015-01-04/async-method-patterns/
score: 0

http://stackoverflow.com/q/28343098
tagged with: javascript
tagged with: base64
score: 0
has comment: http://stackoverflow.com/comment/45040326
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45033437
has body: I am using trying to send an ajax post request with some text &amp; files. However the accepted file format is base64binary (it is specified by the api to accept the post request) Am using the below javascript function to convert the image file to a base64: function encodeImageFileAsURL(){ var filesSelected = document.getElementById("image").files; if (filesSelected.length &gt; 0) { var fileToLoad = filesSelected[0]; var fileReader = new FileReader(); fileReader.onload = function(fileLoadedEvent) { var srcData = fileLoadedEvent.target.result; // &lt;--- data: base64 var newImage = document.createElement('img'); newImage.src = srcData; convertedimage = srcData; document.getElementById("imgTest").innerHTML = newImage.outerHTML; //alert("Converted Base64 version is "+document.getElementById("imgTest").innerHTML); console.log("Converted Base64 version is "+document.getElementById("imgTest").innerHTML); } fileReader.readAsDataURL(fileToLoad); } } And using a simple ajax call to send the data. This is the response I am getting from the api: Cannot convert [binary]... to System.Byte. Parameter name: type ---> Input string was not in a correct format. Would anyone tell me about the way or approach to fix this? Thank you in advance.
type: Question
has title: Cannot convert to System.Byte
has comment: http://stackoverflow.com/comment/45034693

http://stackoverflow.com/comment/45161973
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28413935
has text: @DRX: Posted the answer, Thanks
type: QuestionComment

http://stackoverflow.com/comment/44962544
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28305512
type: Comment
has text: Thanks. I was trying to compare this to other algorithms. All of them (see the first reference) seem to have similar constraints. A quick check with v=1000000 t=1 yields exactly the same results as the first one. Faster. I'll have to look at the second. Is there a set of known test cases somewhere that'll highlight the issue specifically (I get that in general) Also you have a suggestion for a more preferred algorithm?

http://stackoverflow.com/a/28386235
type: Answer
has body: As I mentioned jQuery's .proxy, I thought it best to give an example. function hide(name) { $(name).remove(); } $('.addtimer div').click(function () { $(this).toggleClass('remove'); setTimeout($.proxy(function () { hide(this); }, this), 2000); }); Hello And with native bind function hide(name) { $(name).remove(); } $('.addtimer div').click(function () { $(this).toggleClass('remove'); setTimeout(function () { hide(this); }.bind(this), 2000); }); Hello And with a closure. function hide(name) { $(name).remove(); } $('.addtimer div').click(function () { $(this).toggleClass('remove'); setTimeout((function (element) { return function () { hide(element); }; }(this)), 2000); }); Hello But of course none of this is necessary if you dropped the this and used the event argument of the callback. function hide(name) { $(name).remove(); } $('.addtimer div').click(function (e) { $(e.target).toggleClass('remove'); setTimeout(function () { hide(e.target); }, 2000); }); Hello And in modern ECMA5 function hide(name) { name.parentNode.removeChild(name); } [].forEach.call(document.querySelectorAll('.addtimer div'), function (item) { item.addEventListener('click', function (e) { e.target.classList.toggle('remove'); setTimeout(function () { hide(e.target); }, 2000); }, false); }); Hello
answers question: http://stackoverflow.com/q/28385426
score: 0

http://stackoverflow.com/a/28363686
has body: So basically, you want to do this? var divs = document.getElementsByClassName('classname'); function setZIndex(div) { div.style.zIndex = window.getComputedStyle(div).zIndex - 1; } function handler(e) { [].forEach.call(divs, setZIndex); e.target.style.zIndex = 100; } [].forEach.call(divs, function(div) { div.addEventListener('click', handler, false); }); .classname { width: 20px; height: 20px; border-style: solid; border-width: 1px; } #one { position: absolute; top: 0px; left: 0px; background-color: red; z-index: -1; } #two { position: absolute; top: 15px; left: 10px; background-color: blue; z-index: -1; } #three { position: absolute; top: 30px; left: 20px; background-color: yellow; z-index: -1; } #four { position: absolute; top: 45px; left: 30px; background-color: green; z-index: -1; } #five { position: absolute; top: 60px; left: 40px; background-color: white; z-index: -1; }
answers question: http://stackoverflow.com/q/28361171
type: Answer
upvote count: 1
score: 1
downvote count: 0

http://stackoverflow.com/comment/44944929
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28296252
type: Comment
has text: Sounds line a server size setting, not a sender problem. What are the sizes that fail vs works?

http://stackoverflow.com/a/28371114
answers question: http://stackoverflow.com/q/28371068
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28371068
has comment: http://stackoverflow.com/comment/45082854
has comment: http://stackoverflow.com/comment/45082875
has body: Assuming you only care about whether the value is falsy instead of identical to null, use ||: var x = a1 || a2 || null; The "and" and "or" operators short-circuit in any C-influenced language. Combined with Javascript's notion of truthiness, this is a powerful feature. Use it.
has comment: http://stackoverflow.com/comment/45082822
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45082996
has comment: http://stackoverflow.com/comment/45083043
score: 4
has comment: http://stackoverflow.com/comment/45083110
type: Answer
has comment: http://stackoverflow.com/comment/45083028
upvote count: 4

http://stackoverflow.com/q/28309282
has title: Save HTML as an image
favorite count: 0
has comment: http://stackoverflow.com/comment/44969615
has answer: http://stackoverflow.com/a/28309315
upvote count: 2
type: UnansweredQuestion
has body: Is there any way I could turn HTML into an image? Let's say I made a barcode with HTML and CSS, is there a way I could save it as an image using JavaScript? For example: Save anything inside #saveImage as an image. Save this text as an image
score: -3
tagged with: image
type: Question
downvote count: 5
tagged with: javascript
linked to: http://stackoverflow.com/q/4912092
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/comment/55088214
type: Comment
type: AnswerComment
has text: www.urbandogex.com, don't know where to slow it down. As of now, the transition too fast, there i noway, visitors are able to read them.
comment on: http://stackoverflow.com/a/28312452
score: 0

http://stackoverflow.com/comment/45012238
type: QuestionComment
comment on: http://stackoverflow.com/q/28332564
has text: ` ` seems like you are trying to create angularjs :)
score: 0
type: Comment

http://stackoverflow.com/comment/45106899
score: 0
comment on: http://stackoverflow.com/q/28384508
type: Comment
type: QuestionComment
has text: Why are you binding an `onreadystatechange` handler inside a `click` handler?

http://stackoverflow.com/q/28331858
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45011101
type: Question
tagged with: phaser-framework
tagged with: javascript
has body: I am trying to move one sprite to the center of another sprite, which is a child of a Group object, using game.physics.arcade.moveToPointer(sprite,speed,pointer,maxTime). Here is an example: game.physics.arcade.moveToPointer(ball,100,cups.children[0].body.center, 1000); I am calling this in the create function, after creating my sprite called ball, a group called cups, and the children of that group. I am also enabling physics on all of them, so that they can be moved. I also tried moving it to the update function, but my ball still does not move towards the center of cups.children[0] What am I doing wrong? UPDATE: Using ball.rotation = game.physics.arcade.moveToPointer(ball,100,game.input.activePointer,1000; In my update() function will move the ball to the mouse, yet cups.children[index].body.center does not work, even though it is also a Pointer object, like game.input.activePointer. I have verified with console.log(cups.children[0].body.center) that it is not null....
has title: Phaser - Game.Physics.Arcade.moveToPointer not working?
has answer: http://stackoverflow.com/a/28332550
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45010817
type: UnansweredQuestion

http://stackoverflow.com/comment/45093546
has text: 2 things. First, good observation, a simple upload control was not working. I did not have `enctype="multipart/form-data"` in my ` ` tag. Second, I commented these two lines, I just left `var fileInput = $('#<%=fuPicture.ClientID%>')` so that `fileInput` is known. And I could upload my file. So I just need to work a bit on my css to hide the real upload control. I check your answer even if you did not mention `enctype="multipart/form-data"`, I needed your comment. Thanks
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28336858
score: 0

http://stackoverflow.com/a/28423847
type: Answer
has comment: http://stackoverflow.com/comment/45183393
has body: I have refactored your code. **Note : ** You should not have a static id when adding elements dynamically. Ids are supposed to be unique and as it is, your inputs will all have the same id input_0. Instead, since you have only one input per row, get the index of the row to create ids dynamically (input0, input1,..., inputN). See the code below, it's commented. Another thing, your table2 was not updated because you are adding rows dynamically and the $(selector).each() is only running once. if you put it inside a function to be invoked every time a row is added everything will work fine. //----------adding a row $(document).on("click", '.tdAdd', function () { var table = $(this).parents("#table1"); // get the row var currentRow = $(this).closest("tr"); // get the current value of the input // in order to duplicate it var currentVal = currentRow.children().find("input[type='text']").val(); // one way to create a cell var buttonCell = '&lt;td&gt;&lt;input type="button" value="Add Row" class="tdAdd"/&gt;&lt;/td&gt;'; // but I'd rather do it like this // because I can assign any value as an attribute - dynamic var inputCell = $("&lt;td&gt;").append($('&lt;input type="text"/&gt;').attr({ id : "input" + (currentRow.index() + 1), value : currentVal, class : "ttt" })); table.append( $("&lt;tr&gt;").append(buttonCell, inputCell) ); // invoking this function in order to update $(selector).each() updateEachFn(); }); and the wrapper function // wrap $(selector).each() inside a function to be invoked // every time a row is added to keep everything up to date function updateEachFn() { $("input:text").each(function () { var elem = $(this), oldValue; $('input:text').trigger('focus'); // do not use document, because it will unnecessarily go through // every single input -- bad for performance // also you are already on an input:text ie each() above elem.bind('focus', function () { elem.data('oldVal', elem.val()); elem.data('oldLen', elem.data('oldVal').length); }); elem.bind('input',…
has comment: http://stackoverflow.com/comment/45193237
score: 1
answers question: http://stackoverflow.com/q/28422338
upvote count: 1
downvote count: 0

http://stackoverflow.com/a/28435552
upvote count: 3
has comment: http://stackoverflow.com/comment/45205274
downvote count: 0
answers question: http://stackoverflow.com/q/28435439
type: Answer
has body: JQuery has a .last() function. http://api.jquery.com/last/
has comment: http://stackoverflow.com/comment/45201351
score: 3

http://stackoverflow.com/a/28390363
type: Answer
accepted answer of: http://stackoverflow.com/q/28390118
answers question: http://stackoverflow.com/q/28390118
score: 0
type: AcceptedAnswer
has body: something like the following should work better because it ensures a delay between the response and on-screen action, instead of just a delay based on the last previously scheduled view update. i'm still not sure if this will stop your missing cards (your code actually looks ok), but it will make the delays more consistent. // interval var responseQueue = []; function next() { var response = responseQueue.shift(); if (response !== undefined) { processResponse(response); } if(responseQueue.length) next.timer=setTimeout(next, 2000); } // websocket response SocketFactory.subscribe("/user/queue/game.gameResponse", function (response) { var res = JSON.parse(response.body); // the current player moved, refreshing view if ($scope.username === res.currentPlayerId) { processResponse(res); } else { // the opponent moved (the ai in this case) clearTimeout(next.timer); responseQueue.push(res); next.timer=setTimeout(next, 2000); } }); now, nothing will happen until 2 seconds after something else.

http://stackoverflow.com/q/28375619
linked to: http://stackoverflow.com/q/24398699
linked to: http://stackoverflow.com/q/28227480
type: Question
score: 3
has comment: http://stackoverflow.com/comment/45092531
tagged with: javascript
has answer: http://stackoverflow.com/a/28376318
has body: I am writing a constructor in JavaScript that has the following properties: function WhizBang() { var promise; this.publicMethod_One = function publicMethod_One() { ... }; this.publicMethod_Two = function publicMethod_Two() { ... }; promise = asyncInit(); } So, calling new WhizBang() will start the asyncInit() process. What isn't obvious from the code above is that none of the public methods in the interface should run until this call to asyncInit() has closed. So, the definition of publicMethod_One() might look something like this: function publicMethod_One() { promise .then( doStuff ) .catch( reportInitFailure ) ; function doStuff() { ... } function reportInitFailure() { ... } } Some of the things that happen in doStuff() are asynchronous; some of them aren't. So, if an end user of my class did something like this: function main() { var whizBang = new WhizBang(); whizBang .publicMethod_One() .publicMethod_Two() ; } The call to publicMethod_One() musn't be made until asyncInit() has closed. And the call to publicMethod_Two() musn't be made until both asyncInit() and publicMethod_One() have closed. How can I define my class methods so that they are chainable? What I think I need to do is define a class whose public methods are all equivalent to calling then() on a promise, followed by class specific, implementation stuff. Internets, halp! ( Bonus points for using the Bluebird Promise Library in your answer. )
upvote count: 3
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45092715
tagged with: chainable
tagged with: promise
linked to: http://stackoverflow.com/q/23803743
has comment: http://stackoverflow.com/comment/45110551
type: UnansweredQuestion
tagged with: interface
has title: Chainable, Promise-based Class Interfaces in JavaScript
tagged with: constructor
downvote count: 0

http://stackoverflow.com/q/28416108
has body: I'm not sure what's happening here. I've hit a wall while trying to debug this. I have the below xmlhttp request and have set it up to do a recursive call every 3 seconds to a public API. The problem I'm having is every call returns the exact same object, but if I refresh the page each time the object changes. In other words, my xmlhttp variable is basically holding the first object it gets and never updating. I've tried nulling it before the recursive call but that didn't work. Not really sure what to do now. var pullEvents = function(url){ var xmlhttp; if(window.XMLHttpRequest){ xmlhttp = new XMLHttpRequest(); } else { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function(){ if(xmlhttp.readyState === 4 &amp;&amp; xmlhttp.status === 200){ var res = JSON.parse(xmlhttp.responseText); console.log(res); setTimeout(function(){ pullEvents(url); }, 3000); } } xmlhttp.open("GET", url, true); xmlhttp.send(); };
tagged with: ajax
type: Question
has comment: http://stackoverflow.com/comment/45165922
tagged with: xmlhttprequest
answer count: 0
score: 0
tagged with: recursion
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45166109
has title: Recursive xmlhttp Request Not Changing
has comment: http://stackoverflow.com/comment/45165562

http://stackoverflow.com/a/28408498
downvote count: 0
type: Answer
has body: $('#button').attr('disabled', true); $('input:text').keyup(function () { var disable = false; $('input:text').each(function(){ if($(this).val()==""){ disable = true; } }); $('#button').prop('disabled', disable); }); Demo
answers question: http://stackoverflow.com/q/28408357
score: 7
upvote count: 7
accepted answer of: http://stackoverflow.com/q/28408357
type: AcceptedAnswer

http://stackoverflow.com/comment/44981935
has text: @ArinCool He's opening a popup. Presumably, there is no additional navigation inside the popup, and new windows start out with a clean History, so the back button doesn't work. Your point still stands when it comes to refreshing though.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28315937

http://stackoverflow.com/q/28394485
has comment: http://stackoverflow.com/comment/45125495
tagged with: css
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28394701
downvote count: 1
type: Question
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/45125588
upvote count: 0
has title: Highlight active menu item on scroll
answer count: 1
has body: I am working on an one page navigation with jQuery. What I want is when the user is scrolling, the highlighted menu will be changed. I came up with the following code: HTML &lt;body class="index m-scene" id="main"&gt; &lt;!-- // Start HTML \\ --&gt; &lt;header id="header" class="fixed"&gt; &lt;div class="container_12"&gt; &lt;h1 class="grid_4"&gt; &lt;a href="#" class="logo backtotop"&gt; &lt;img src="images/logo.png" alt=""&gt; &lt;span&gt;Maurice Draait&lt;/span&gt; &lt;/a&gt; &lt;/h1&gt;&lt;!-- End h1.grid_4 --&gt; &lt;div class="grid_8"&gt; &lt;a href="#" class="toggle-menu"&gt;&lt;span&gt;Menu&lt;/span&gt;&lt;/a&gt; &lt;nav id="primary-navwrapper" class="pushy-right"&gt; &lt;ul id="listnav"&gt; &lt;li&gt;&lt;a href="#" class="current"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#aboutus"&gt;About us&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#events"&gt;Agenda&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#gallery"&gt;Galerij&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#organisation"&gt;Organisatie&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#contact"&gt;Contact&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;&lt;!-- End ul#listnav --&gt; &lt;/nav&gt;&lt;!-- End nav#primary-navwrapper .pushy-right --&gt; &lt;/div&gt;&lt;!-- End div.grid_8 --&gt; &lt;div class="clear"&gt;&lt;/div&gt;&lt;!-- End div.clear --&gt; &lt;/div&gt;&lt;!-- End div.container_12 --&gt; &lt;/header&gt;&lt;!-- End header#header .fixed --&gt; &lt;div class="m-page scene_element scene_element--fadeinup"&gt; &lt;main class="container"&gt; &lt;section id="hero"&gt; &lt;figure&gt; &lt;figcaption&gt; &lt;div class="container_12"&gt; &lt;hgroup class="grid_12"&gt; &lt;h1&gt; Headline 1 &lt;/h1&gt; &lt;h2&gt; Headline 2 &lt;/h2&gt; &lt;h3&gt; Donec sed odio dui. Nulla vitae elit libero, a pharetra augue. &lt;br&gt; Nullam id dolor id nibh ultricies vehicula ut id elit. &lt;/h3&gt; &lt;/hgroup&gt;&lt;!-- End hgroup.grid_12 --&gt; &lt;div class="clear"&gt;&lt;/div&gt;&lt;!-- End div.clear --&gt; &lt;/div&gt;&lt;!--…
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28394701

http://stackoverflow.com/q/28399137
has answer: http://stackoverflow.com/a/28399619
has comment: http://stackoverflow.com/comment/45134123
has title: How to get angular app to access backend-API
has comment: http://stackoverflow.com/comment/45134211
tagged with: angularjs
type: Question
answer count: 2
tagged with: node.js
score: 0
has body: So, Ive made a backend API for a todo-app Im working on, I know that http://localhost:3000/api/todo/done is working and returns two objects, looking like this: [{"_id":"54d6485357a52fc640bb3814","text":"Hämta tårta","completed":true},{"_id":"54d648ae57a52fc640bb3815","text":"Köpa dricka till Antons kalas","completed":true}] Ive now written a first attempt at a frontend in angular. It all runs well in node, with no errors but I do not get any todos listed in my todo-list div. Can you please advise on this? HTML: I'm a Todo-aholic {{ todos.length }} {{ todo.text }} ANGULAR CODE: var nodeTodo = angular.module('node-todo', []); function mainController($scope, $http) { $scope.formData = {}; // when landing on the page, get all todos and show them $http.get('/api/todo/done') .success(function(data) { $scope.todos = data; console.log(data); }) .error(function(data) { console.log('Error: ' + data); }); } I dont even get anything printed in the console and I dont understand why...
has answer: http://stackoverflow.com/a/28399767
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/comment/45079857
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28369313
has text: Do you mean to do that : http://jsfiddle.net/m6zdubhk/1/?
score: 0

http://stackoverflow.com/comment/45040851
score: 0
has text: There's no way it'll generate a 10. The return value of `Math.random()` is strictly less than 1. This will result in a value between 1 and 9.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28348082

http://stackoverflow.com/a/28371700
has body: Let me preface this by saying that I don't think it's a good idea, but you can use transformers to control how objects are serialized. However, if you use generated client libraries, you will lose all information--they will only see things as lists of strings. Endpoints should automatically gzip things for you, which should help save a lot of bandwidth. You should do measurements comparing the two full lists of 5000 and seeing how much bandwidth exactly is being saved. Keep in mind that Endpoints won't transmit empty properties either, so if the many properties aren't all set, you save bandwidth automatically. See this page for details on how to use transformers. Basically, you want a class ItemTransformer implements Transformer&lt;Item, List&lt;String&gt;&gt; with the relevant annotations.
accepted answer of: http://stackoverflow.com/q/28322902
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28322902

http://stackoverflow.com/q/28392555
score: 0
answer count: 1
has title: Bootstrap Popover Trouble
tagged with: javascript
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: HTML: Logged in as Username Javascript: $(function () { $('[data-toggle="popover"]').popover() }) I've tried various things to fix, but unfortunately, nothing seems to be helping; the popover does not work when clicked. Would there be any way to get around this?
type: Question
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/28392615

http://stackoverflow.com/comment/45023901
score: 0
type: AnswerComment
type: Comment
has text: in same controller, changed to this.tosum = function(d1, d2) {..... {{timesheetsCtrl.tosum(timesheet.startDate,timesheet.endDate )}} but still same error
comment on: http://stackoverflow.com/a/28338771

http://stackoverflow.com/comment/45021339
has text: I updated my answer. This is a more robust solution and you won't run into similar issues in future anymore.
comment on: http://stackoverflow.com/a/28330481
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44988470
comment on: http://stackoverflow.com/a/28318915
type: Comment
has text: When I set AutoPostBack="False" nothing happens when I check/uncheck the Items
score: 0
type: AnswerComment

http://stackoverflow.com/a/28408975
has comment: http://stackoverflow.com/comment/45151882
has body: js or jquery won't work on html that is generated by the jquery .. so if you are performing any operation on selectmenu class like $(".selectmenu").select(function (){ // code here }); change to this . $('.selectmenu').on('select', function () { // code here }
has comment: http://stackoverflow.com/comment/45151886
answers question: http://stackoverflow.com/q/28408736
score: 0
type: Answer

http://stackoverflow.com/comment/45134593
has text: @AlminIslamovic Of course you can use angular controllers to fetch data from any available API you have, either this API is written in ASP.NET MVC or not. This is a decision you have to take alone based on what you want to build. However, an application -I am talking about web applications with dynamic pages, not static files- has a part leaving in the server and a part leaving in the client. Saying leaving, I mean that you have to write a some server side code, in C#, PHP, JAVA , Python etc that at the end of the day it will end up to an HTTP response, containing html, json whatever.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28399330
score: 0

http://stackoverflow.com/a/28365954
has body: You're using jQuery so use: nav.addClass("navbar-fixed-top") and nav.removeClass("navbar-fixed-top") I think this maybe what you want: var nav; function yScroll(){ nav = $('#nav'); yPos = window.pageYOffset; nav.removeClass("navbar-fixed-top"); if(yPos &gt; 150){ nav.addClass("navbar-fixed-top"); } } window.addEventListener("scroll", yScroll);
accepted answer of: http://stackoverflow.com/q/28365867
upvote count: 2
answers question: http://stackoverflow.com/q/28365867
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/45073000
has comment: http://stackoverflow.com/comment/45073070
has comment: http://stackoverflow.com/comment/45073210
has comment: http://stackoverflow.com/comment/45073113
score: 2
downvote count: 0

http://stackoverflow.com/comment/45154643
comment on: http://stackoverflow.com/a/28410369
score: 0
type: AnswerComment
has text: That's better. That should probably be a part of your answer, since OP didn't say whether he needs a string or a number.
type: Comment

http://stackoverflow.com/comment/101461358
score: 1
has text: Welcome to SO! Answers are only permitted in English on stackoverflow.com. For more information, read [this post](https://meta.stackexchange.com/a/13684/555599)
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/57495593

http://stackoverflow.com/comment/45151209
comment on: http://stackoverflow.com/q/28408655
score: 0
has text: "it looks like the .each is looping twice" - is the list of matched elements in the selector definitely correct, and the duplication isn't there because e.g. you've got both the input and an element surrounding the input with your-income class?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44974790
type: Comment
has text: @w3d Yeah No wrap - in .. confusing stuff.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28312085

http://stackoverflow.com/a/28387041
has comment: http://stackoverflow.com/comment/45111830
type: Answer
has body: I think this might give you some insight into what you need to do. I've put together a filter that will make the HTML safe to use in an ng-bind-html directive. Here's a Plunk showing it working. app.controller('MyController', function($scope, $sce) { $scope.someHtmlContent = "Label: "; $scope.h = function(html) { return $sce.trustAsHtml(html); }; }); app.filter('trustAsHtml', function($sce) { return $sce.trustAsHtml; }); This is a non-Ionic version of the view showing it: Basically I created a filter ('trustAsHtml') that tells AngularJS to trust your HTML by making use of the $sce service's trustAsHTML() method (part of the ngSanitize module). You have to be careful that the HTML you are supplying truly is safe against attack code coming from users and such, though.
answers question: http://stackoverflow.com/q/28385961
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28385961
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45065807
type: Comment
comment on: http://stackoverflow.com/a/28361756
has text: This is exactly what I want!! I hate to wait 8 mins to accept this anwser!
score: 1
type: AnswerComment

http://stackoverflow.com/q/28280170
has comment: http://stackoverflow.com/comment/44914427
tagged with: forms
has title: Conflict between input form and select form when key enter is pressed
score: 0
answer count: 1
tagged with: jquery
tagged with: backbone.js
accepted answer: http://stackoverflow.com/a/28280375
has comment: http://stackoverflow.com/comment/44914627
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has body: I have a search box with some inputs forms and a select form with some options. One of the inputs forms is a place autocomplete from google maps, and it works fine if no exist any select form. If in my search box I have a select form with some options, when I use the input form with place autocomplete and when the key enter is pressed, my page is reload and on the final of url shows an ?, like this http://www.lasige.di.fc.ul.pt/webtools/ondequemvaiver/agora/? You can test this problem here: my app In form Onde type Lisboa and then press key enter. HTML: Pesquise Quando Onde Género 1 2 3 4 My code: ev.views.Home = Backbone.View.extend({ // construtor initialize: function(map, p, firstEntry){ var that = this; that.template = _.template(ev.templateLoader.get('home')); // evento que e disparado quando o router atual muda ev.router.on("route", function(route, params) { that.deleteMarkers(); }); that.map = map; // variavel com o mapa that.firstEntry = firstEntry; // valor do firstEntry quando entra no router pagesearch that.p = p; // valor da pagina that.icons = []; that.render(that.map, that.p, that.firstEntry); }, // funcao que representa a funcionaliade de pesquisar por localidade local: function(map){ var that = this; that.map = map; var input = (that.$el.find('#pac-input')[0]); var options = { types: ['geocode'], componentRestrictions: {country: "pt"} }; var autocomplete = new google.maps.places.Autocomplete(input, options); autocomplete.bindTo('bounds', that.map); var infowindow = new google.maps.InfoWindow(); google.maps.event.addListener(autocomplete, 'place_changed', function() { infowindow.close(); var place = autocomplete.getPlace(); if (!place.geometry) { return; } // If the place has a geometry, then present it on a map. if (place.geometry.viewport) { that.map.fitBounds(place.geometry.viewport); that.map.setZoom(12); that.map.setCenter(place.geometry.location); } else { that.map.setCenter(place.geometry.location); that.map.setZoom(12); // Why 17? Because it l…
has comment: http://stackoverflow.com/comment/44914451
type: Question
has answer: http://stackoverflow.com/a/28280375
tagged with: javascript

http://stackoverflow.com/a/28318795
has comment: http://stackoverflow.com/comment/44986828
answers question: http://stackoverflow.com/q/28318768
score: 0
has comment: http://stackoverflow.com/comment/44986652
has comment: http://stackoverflow.com/comment/44986733
has body: In HTML, the ID attribute must be unique. JavaScript will only look for the very first matching ID, then stop searching. In your HTML, change all instances of id="data" to class="data", then modify your JavaScript to: $(this).closest('.data').remove();
has comment: http://stackoverflow.com/comment/44986406
type: Answer
has comment: http://stackoverflow.com/comment/44986447

http://stackoverflow.com/comment/45065000
comment on: http://stackoverflow.com/a/28360630
has text: @DelightedD0D good to know that i helped you, i edited my answer with your correction
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28280950
has answer: http://stackoverflow.com/a/28281249
tagged with: javascript
tagged with: security
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/28281249
tagged with: wcf
tagged with: encryption
has body: I am looking for a good way to encrypt data between a JavaScript package and a WCF Service. I describe one solution at the bottom, but would like something better. Is there a way to do this without purchasing a SSL certificate, I want the SSL data transfer, but don't need the CA? Background I have a WCF web service that many web app tools are going to connect to. All tools will be approved and registered with the service code before being able to access the service. We are writing a basic JavaScript package for communication to the service for the tools to use. Data going to the service needs to be encrypted and we can't trust that even other users of the same tool won't try to listen to data. I don't want to have to purchase an SSL certificate and keep it valid, and I am hoping since I only allow certain tools access and they use my package, I can get around it. One solution I found, but don't think it is good enough Hard code a key on the Server given to the approved tools during development. When each tool starts up, it creates a new key and sends it to the server for that user and session of the tool. All data going back and forth will be done on this new key. Problem - What if someone is listening when the tool first sends its encrypted new key, they could just get the hard coded from one of the tools and figure out the new key.
has title: JavaScript to WCF Service encryption
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/55089548
comment on: http://stackoverflow.com/a/28312452
has text: Sorry I think Im the wrong threat, but maybe you can help me anyway. Here is my original question. Please help me. http://stackoverflow.com/questions/33641812/slider-revolution-slider-can-anybody-help-me-please
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/28314724
tagged with: ajax
has comment: http://stackoverflow.com/comment/44979115
has comment: http://stackoverflow.com/comment/44979521
answer count: 1
tagged with: setinterval
has comment: http://stackoverflow.com/comment/44979687
favorite count: 0
has title: how to call function ever 1 mint when page direct also
has comment: http://stackoverflow.com/comment/44979743
tagged with: cordova
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28314840
has comment: http://stackoverflow.com/comment/44980285
has body: We developing phone-Gap app.We have 4 pages.We need ever 1 mint Post Current latitude and longitude.We know how to Post values to server.We know how to get latitude and longitude ever 1 mint Using this navigator.geolocation.watchPosition(showPosition, showError, options); Now we need ever 1 mint call to ajax call So We tried like this window.setInterval(function(){ call(); }, 5000); function call(){ //ajax call for server posting } We have 3 pages.Above code place page1,code working nice.But When go to second page ajax call not working .Please any one guide me.How to When page redirect also Page1 Call function call ever 1 mint
has comment: http://stackoverflow.com/comment/44979358
has comment: http://stackoverflow.com/comment/44979402
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44979580
upvote count: 0
tagged with: javascript
tagged with: jquery
score: -1

http://stackoverflow.com/comment/45144669
type: Comment
comment on: http://stackoverflow.com/a/28381603
type: AnswerComment
has text: Meaning, that after you enabled CSS media print, everything still looked fine?
score: 0

http://stackoverflow.com/comment/45192052
has text: If an object is smaller than the zombie, couldn't it sneak in, in between corners?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28430410
type: Comment

http://stackoverflow.com/a/28437093
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28436999
type: Answer
has body: You can use &amp;lt; instead for a less than symbol.
downvote count: 0

http://stackoverflow.com/comment/45100213
comment on: http://stackoverflow.com/a/28380515
has text: True, but I thought that wouldn't matter since I run the $watch before setting the ref. But then again, when the $watch is first being run the authencation is false so I guess that explains it. It works now anyway. Cheers :)
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45238644
has text: Which sails.js and waterline version you use?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28436089
type: Comment

http://stackoverflow.com/comment/45050429
type: Comment
has text: thank you i know that works but then the output isn dynamic. If i have a document with 800 objectsIDs and i want to calculate objectID 345 und 678 that will be a problem
comment on: http://stackoverflow.com/a/28353327
type: AnswerComment
score: 0

http://stackoverflow.com/q/28281080
has comment: http://stackoverflow.com/comment/44916573
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44916373
has title: Overriding innerHTML property access
tagged with: dom
type: Question
upvote count: 4
has answer: http://stackoverflow.com/a/40769088
downvote count: 0
answer count: 1
tagged with: javascript
score: 4
favorite count: 0
has body: I am looking for a way to enable setter method on a DOM element. So basically I want to intercept all calls to this specific property. I've tried with defining get/set properties on a specific DOM element, but it isn't of much help: (function(object, property) { var __value; Object.defineProperty(object, property, { // Create a new getter for the property get: function () { console.log('access gettter'); return __value; }, // Create a new setter for the property set: function (val) { __value = val; } }) })(document.body, 'innerHTML'); The result of this is that calling: document.body.innerHTML = 'testValue'; is: document.body.innerHTML access gettter "testValue" However this doesn't have any impact on the page, I mean body of the page isn't changed, just the value of a private variable inside the closure is returned. Is there a way to achieve this functionality in JavaScript ?

file
type: Tag
tags question: http://stackoverflow.com/q/28310185
tags question: http://stackoverflow.com/q/28424268
tags question: http://stackoverflow.com/q/28293399
tag name: file
tags question: http://stackoverflow.com/q/28341694
tags question: http://stackoverflow.com/q/28317219
tags question: http://stackoverflow.com/q/28426229
tags question: http://stackoverflow.com/q/28335961
tags question: http://stackoverflow.com/q/28386186
tags question: http://stackoverflow.com/q/28409317
tags question: http://stackoverflow.com/q/28340237

http://stackoverflow.com/comment/44939151
type: Comment
has text: this error occurred when i am using this method: Uncaught TypeError: Failed to execute 'serializeToString' on 'XMLSerializer': Invalid node value.
type: AnswerComment
comment on: http://stackoverflow.com/a/28292861
score: 0

http://stackoverflow.com/comment/45031590
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28343549
has text: Ok so with your example, am I then able to access Tabs.render() like I did previously?? Is this the best way for me to do it?
type: AnswerComment

http://stackoverflow.com/comment/45176075
type: QuestionComment
comment on: http://stackoverflow.com/q/28420832
has text: Any ideas, I am still getting the permission denied?
score: 0
type: Comment

http://stackoverflow.com/comment/87321430
type: AnswerComment
comment on: http://stackoverflow.com/a/33915986
has text: @eugene but if you do that you have to also edit the return : not add 1. am I correct?
type: Comment
score: 0

http://stackoverflow.com/comment/45050194
comment on: http://stackoverflow.com/a/28352309
type: Comment
has text: jQuery it's the better solution.
score: 0
type: AnswerComment

http://stackoverflow.com/a/28430410
has comment: http://stackoverflow.com/comment/45192526
has comment: http://stackoverflow.com/comment/45192445
upvote count: 2
has comment: http://stackoverflow.com/comment/45259965
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45192321
answers question: http://stackoverflow.com/q/28430047
has comment: http://stackoverflow.com/comment/45192140
accepted answer of: http://stackoverflow.com/q/28430047
has comment: http://stackoverflow.com/comment/45192052
has body: a quick, down and dirty solution (there are more complex algorithms) would be to use: document.elementFromPoint(x, y); It gets the element at the position specified. The full spec can be found here. Assuming your 'zombies' are rectangular, you could call this for each corner, and if you get a hit, that isn't the background or the element you're checking, you've got a collision... EDIT: An alternate method, even 'downer and dirtier' than above, but stupidly quick, would be to get the centre points of the two objects to check, then find their absolute displacements in X and Y. If the differences are less than the sum of half their widths and heights then they are overlapping. It's by no means pix perfect, but it should be able to handle a large number objects really quickly. EDIT 2: First off, we need to get the centres of each object (to check) // Values for main object // pop these in vars as we'll need them again in a sec... hw = object.style.width &gt;&gt; 1; // half width of object hh = object.style.height &gt;&gt; 1; // (bit shift is faster than / 2) cx = object.style.left + hw; // centre point in x cy = object.style.top + hh; // and in y // repeat for secondary object If you don't know / store the width and height you can use: object.getBoundingClientRect(); which returns a 'rect' object with the fields left, top, right and bottom. Now we check proximity... xDif = Math.abs(cx - cx1); // where cx1 is centre of object to check against if(xDif &gt; hw + hw1) return false; // there is no possibility of a collision! // if we get here, there's a possible collision, so... yDif = Math.abs(cy - cy1); if(yDif &gt; hh + hh1) return false; // no collision - bug out. else { // handle collision here... } Danny
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/45192349

http://stackoverflow.com/a/28430222
score: 3
answers question: http://stackoverflow.com/q/28430159
downvote count: 0
has body: You want to access the checked property (which is a boolean) of the checkbox, not the value: var isChecked = document.forms["form1"]["person"].checked; if (empt == "" &amp;&amp; empt1 == "" &amp;&amp; !isChecked) { alert("Please input a Value"); return false; }
type: Answer
has comment: http://stackoverflow.com/comment/45191516
upvote count: 3

http://stackoverflow.com/comment/45107190
comment on: http://stackoverflow.com/a/28384724
has text: can i ask you something ?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44930019
score: 1
comment on: http://stackoverflow.com/q/28288040
type: QuestionComment
type: Comment
has text: how many records are in your collections? do you have an index on the user_id field?

http://stackoverflow.com/comment/45160487
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28409477
has text: Im sure its documented, tho it would be redundant as that's the whole point storage exists. Otherwise what would be the point if its the same as storing in memory? Look up my chrome extension code (github plus for trello) and see how im using chrome.storage both from the content script and background. Both work.
type: AnswerComment

http://stackoverflow.com/a/28297893
answers question: http://stackoverflow.com/q/28286335
accepted answer of: http://stackoverflow.com/q/28286335
has body: There is a method on SVGSVGElement (&lt;svg&gt;) called getIntersectionList() which will return all elements that intersect with a given rectangle. As an example, here is a code snippet which will give every SVG shape under the click a random colour. var mysvg = document.getElementById("mysvg"); mysvg.addEventListener('click', function(evt) { var hitRect = mysvg.createSVGRect(); hitRect.x = evt.clientX; hitRect.y = evt.clientY; // (leave width &amp; height as 0) var elems = mysvg.getIntersectionList(hitRect, null); for (i=0; i&lt;elems.length; i++) { // Give each element under the mouse a random fill colour elems.item(i).setAttribute('fill', "rgb("+rnd()+","+rnd()+","+rnd()+")"); } }); function rnd() { return Math.floor(Math.random() * 255.99); } &lt;svg id="mysvg"&gt; &lt;rect width="150" height="100" fill="#393"/&gt; &lt;rect x="120" y="20" width="140" height="130" fill="orange"/&gt; &lt;rect x="220" y="0" width="80" height="130" fill="red"/&gt; &lt;/svg&gt; Unfortunately, this currently only works in Chrome (maybe Safari also?). Supposedly FF implemented partial support for this, but it currently seems to have been removed.
type: Answer
has comment: http://stackoverflow.com/comment/44948234
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/44973282
upvote count: 2
has comment: http://stackoverflow.com/comment/44948580
type: AcceptedAnswer

http://stackoverflow.com/comment/45115424
comment on: http://stackoverflow.com/a/28387526
type: AnswerComment
score: 0
has text: Thanks - I am building a bootstrap website with an admin panel that will let users customize the them using the customizer. They will be able to change the colors etc and the just click apply to make changes to the theme. The theme will be a Joomla based template. The customizer will be available onto to admins for development work so it is ok to do some lifting and when less is compiled to css, only the css will be read by the forntend.
type: Comment

http://stackoverflow.com/q/28399407
type: Question
tagged with: javascript
score: -1
accepted answer: http://stackoverflow.com/a/28400008
tagged with: html-escape
upvote count: 0
answer count: 1
favorite count: 0
has body: I am using handlebars for JavaScript templating. I want to add around the word "success". I would hopefully want to escape any other html or scripts in the text.
has title: Adding "" to a certain word using handlebars.js
tagged with: handlebars.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28400008
downvote count: 1

http://stackoverflow.com/q/28436535
has comment: http://stackoverflow.com/comment/45204832
has comment: http://stackoverflow.com/comment/45207388
has comment: http://stackoverflow.com/comment/45204741
has comment: http://stackoverflow.com/comment/45203114
tagged with: internet-explorer
answer count: 0
downvote count: 0
has comment: http://stackoverflow.com/comment/45203378
score: 1
type: Question
has body: I'm loading content via JSON/JSONP from another (parent) site and displaying it locally. The following function hijacks link click events, checks to see if the link points to the parent site, strips the parent site URL from the link, and runs a function to load a news article based on the link URL. This works fine in all but IE. The issue is with this line: if(regex.test(href)) { If I comment that out, everything works just fine. However, that conditional check is necessary to ensure that we don't hijack links to external sites, i.e., nytimes.com. I'm stuck as to how to proceed here and am unable to figure out whether this is actually an IE bug or if there's a problem with the regex, or perhaps with how the HREF is being collected? Any insight would be helpful. Full function below. function hijackURLs() { // hijack link click events $("#news-archive, #news-story").on("click", "a", function(evt) { var regex = /http:\/\/parent-site.com\// , href = $(this).attr("href"); // make sure the link matches our regex // this isn't working in IE for some reason if(regex.test(href)) { evt.preventDefault(); // replace the href with hashtag href = href.replace( regex, '#' ).split( '\/#more-' )[0]; // change the url without a page refresh and add a history entry. history.pushState(null, null, href); // load the content showArticle( href, _news ); } }); } EDIT: I'm rephrasing here. The line mentioned above does not throw an error in IE; it just does not work in IE. The href does not pass the regex.test(), thus the string does not get replaced, and the function to load the article content in place does not get called.
has comment: http://stackoverflow.com/comment/45206373
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45769583
has comment: http://stackoverflow.com/comment/45204691
has comment: http://stackoverflow.com/comment/45205889
upvote count: 1
has comment: http://stackoverflow.com/comment/45206101
tagged with: regex
favorite count: 0
has title: regEx.test(string) does not work in IE but works fine in Chrome, Safari, FireFox
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45207810

http://stackoverflow.com/a/28286984
answers question: http://stackoverflow.com/q/28286825
score: 0
type: AcceptedAnswer
has body: The easiest way would be for you to send the row's ID value into the onClick method. That way you're only having to make the service call in the method, not also look up the value (and you know the value you're getting will be correct.) echo '&lt;td&gt;&lt;label class="checkbox-inline"&gt;&lt;input type="checkbox" id="check" value="'.$row["id"].'" onClick="aa('.$row["id"].')"&gt;&lt;/label&gt;&lt;/td&gt;'; Also, make sure your input ID attribute value is unique for every row, as that'll cause problems with doing ID lookups.
accepted answer of: http://stackoverflow.com/q/28286825
type: Answer

http://stackoverflow.com/comment/45066084
type: AnswerComment
type: Comment
score: 2
comment on: http://stackoverflow.com/a/28361893
has text: This answer in incomplete (and slightly ambiguous). Please provide an example of how they should do it :)

http://stackoverflow.com/comment/45137012
type: QuestionComment
has text: Can you show a snippet of the HTML code?
comment on: http://stackoverflow.com/q/28400685
score: 0
type: Comment

http://stackoverflow.com/q/28377352
has comment: http://stackoverflow.com/comment/45095005
score: 0
has answer: http://stackoverflow.com/a/28377600
answer count: 2
tagged with: parent
possible better answer: http://stackoverflow.com/a/29399568
has answer: http://stackoverflow.com/a/29399568
tagged with: unordered
has body: My page has an unordered list containing 4 list items, represented in my demo by 4 green boxes. There should be a maximum of 3 list items (boxes) per line, but since my demo has 4 list items, the 4th item is pushed to a new line. This causes the 4th item to expand the entire width of the parent container. This happens because list_item_inner is filling 100% of the width of its parent (list_item), which is suppose to be 32% (like the others), but it's clearly not the same size as the green boxes above it. I simply need all list items to have the same width, regardless if there's only 1 on a line or not. Here's my demo site and here's the html code for the list items: Test Test Test All CSS code is within the html document. Any solution? Thank you! If relevant, the page uses FlexWrap webkit, with the script: Here's a screenshot showing list item 4 not being the same size as the others.
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28377600
type: AnsweredQuestion
tagged with: list
has comment: http://stackoverflow.com/comment/45095300
type: Question
has title: How do I make a list item same width as others, within an unordered list?
tagged with: javascript

http://stackoverflow.com/q/28406826
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/45147952
has comment: http://stackoverflow.com/comment/45148204
accepted answer: http://stackoverflow.com/a/28407246
has comment: http://stackoverflow.com/comment/45147927
has comment: http://stackoverflow.com/comment/45149412
has title: .html doesn't take stylesheets class
has comment: http://stackoverflow.com/comment/45147897
has body: I have scouted the net, and maybe I am asking or searching the wrong way, but I can't seem to find a solution to this. When I either do .html() or .append() I don't seem to get the stylesheets styles into the new html? Here is what i am doing: $.post( "updatepassword.php", { new_pass: true, password1: $(form).find('#password1').val(), password2: $(form).find('#password2').val() }).done(function( data ) { if(data == "success"){ show_loading_bar({ delay: .5, pct: 100, finish: function(){ $(".modal-header").append('&lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt;'); $(".modal-body").html("Yes..."); $(".modal-footer").html('&lt;button type="button" class="btn btn-white" data-dismiss="modal"&gt;Luk&lt;/button&gt;'); } }); } else { toastr.error("Error!", opts); $(form).find('#password1').select(); } }); All the classes is not taking into the new html?!? is this an bug or am I missing something here? Hoping for help and thanks in advance :-)
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45148745
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45149573
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28407246
has comment: http://stackoverflow.com/comment/45148005

http://stackoverflow.com/a/28372972
has body: Try somthing like this. var app = express(); var bodyParser = require('body-parser'); app.use(bodyParser.json({limit:1024*1024, verify: function(req, res, buf){ try { JSON.parse(buf); } catch(e) { res.send({ error: 'BROKEN_JSON' }); } }}));
downvote count: 0
answers question: http://stackoverflow.com/q/28372285
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/a/28376023
type: Answer
has comment: http://stackoverflow.com/comment/116497962
score: 5
upvote count: 5
accepted answer of: http://stackoverflow.com/q/28372569
answers question: http://stackoverflow.com/q/28372569
type: AcceptedAnswer
downvote count: 0
has body: There are couple of mistakes in the way you have written the algorithm. Below code should work. function karatSuba(x,y) { var x1,x0,y1,y0,base,m; base = 10; if((x&lt;base)||(y&lt;base)){ console.log( " X - y = " , x,y, x*y) return x * y; } var dummy_x = x.toString(); var dummy_y = y.toString(); var n = (dummy_x.length &gt; dummy_y.length) ? dummy_y.length : dummy_x.length; m = Math.round(n/2); var high1 = parseInt(dummy_x.substring(0,dummy_x.length-m)); var low1 = parseInt(dummy_x.substring(dummy_x.length-m,dummy_x.length )) ; var high2 = parseInt(dummy_y.substring(0,dummy_y.length-m)); var low2 = parseInt(dummy_y.substring(dummy_y.length-m,dummy_y.length)); var z0 = karatSuba( low1, low2); var z1 = karatSuba(low1+high1, low2+high2); var z2 = karatSuba(high1,high2); var res = (z2 * Math.pow(10, 2 * m ) ) + ( (z1-z2-z0) * Math.pow(10, m )) + z0; return res; } var a = 12345; var b = 6789; console.log(karatSuba(a,b)); console.log(a * b);

http://stackoverflow.com/a/28414889
accepted answer of: http://stackoverflow.com/q/28414530
answers question: http://stackoverflow.com/q/28414530
has comment: http://stackoverflow.com/comment/45166664
score: 0
has body: You have no guarantee that your interval actually fires every 1000ms, so of course over time there will accumulate error, because you have no way of "catching up" with previous delays. I would recommend to you to base the hand rotation on a function that uses the current time as input. That way it doesn't matter when your interval / trigger / callback executes, but whenever it does it will show the correct result. The math isn't too complicated, a clock has obviously 360 degrees, so from the top of my head that would mean (Date.now()/1000)%60 * 6 would be your secondHand rotation in degrees (assuming 0° is top), likewise (Date.now()/60000)%60 * 6 should be the minute rotation and (Date.now()/3600000)%24 * 15 your hourHand. Update silly me, set up this formula for a 24h rotation. You'd want this to be 12h for a normal clock, so this would become: (Date.now()/3600000)%12 * 30 take those calculations with a grain of salt, didn't take the time to verify this.
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/45189088
has comment: http://stackoverflow.com/comment/45203528
has comment: http://stackoverflow.com/comment/45480877
has comment: http://stackoverflow.com/comment/45203396
has comment: http://stackoverflow.com/comment/45203022

http://stackoverflow.com/comment/44956147
type: Comment
comment on: http://stackoverflow.com/a/28302307
has text: Unfortunately, under localhost it's still not working. There are no such route http://api.exline.systems/regions/origin.json. Only http://api.exline.systems/public/v1/regions/origin.json Maybe I should fix smth in my browser to allow localhost requests?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44924590
comment on: http://stackoverflow.com/q/28284758
has text: Kindly do voteup or mark answer as correct. Thanks.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45004005
type: AnswerComment
has text: Do you know what kind of format is behind your date string?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28327971

http://stackoverflow.com/q/28353893
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/28353968
has title: Dynamically change header names when Iframe content changes from a button
type: AnsweredQuestion
has body: I have an html master page template. That page consists of a header, body, and footer. In the body, there is an Iframe. The footer has picture button icons that load different html form pages in the iframe. When I click on a different icon, the iframe content changes to that page. My question, is how to change the header title when I click the icon? The Master Page has a header called "Metrics Entry Form". When I click the icons at the footer, the header should dynamically change(e.g. Safety Entry Form, Waste Entry Form, etc). Can this be done with CSS? Or is Javascript or PHP needed. Thanks My code is pasted below. Any help is most appreciated. html: &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="UTF-8" content="HTML,CSS,XML,JavaScript"&gt; &lt;script src="Scripts/jquery.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="Scripts/Global.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="Scripts/modernizr.custom.86080.js"&gt;&lt;/script&gt; &lt;link rel="stylesheet" type="text/css" href="Styles/Design.css"&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="header"&gt; &lt;h1 id="h1"&gt;Metrics Entry Form&lt;/h1&gt; &lt;/div&gt; &lt;div id="iFrameHeight"&gt; &lt;iframe name="iframe" src="MetricsEntryForm.html" scrolling="auto" id="GlobalFrame"&gt;&lt;/iframe&gt; &lt;/div&gt; &lt;div id="footer"&gt;&amp;nbsp; &lt;input title="Previous Page" type="previousbutton" onclick="PreviousPage()"&gt;&lt;/input&gt; &lt;input title="Waste Entry Page" type="wastebutton" onclick="WastePage()"&gt;&lt;/input&gt; &lt;input title="Metrics Initializer" type="gearbutton" onclick="MetricsPage()"&gt;&lt;/input&gt; &lt;input title="Safety Entry" type="safetybutton" onclick="SafetyEntryPage()"&gt;&lt;/input&gt; &lt;input title="Trending" type="trendbutton" onclick="Trending()"&gt;&lt;/input&gt; &lt;input title="Alarm and Events" type="alarmbutton" onclick="Alarm()"&gt;&lt;/input&gt; &lt;input title="Report Expert" type="expertbutton" onc…
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/28353968
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
tagged with: iframe

http://stackoverflow.com/comment/45050855
type: Comment
has text: Sorry, I was unclear. Instead of `$get('<%=divScrollable.ClientID%>')`, use `$get('divScrollable')`. And remove the `runat="server"` attribute from `divScrollable`: you don't need it.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28351299

http://stackoverflow.com/comment/44939471
comment on: http://stackoverflow.com/q/28293331
has text: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45186264
type: AnswerComment
has text: as to why it works in one browser and not in another: I don't have a clue
type: Comment
comment on: http://stackoverflow.com/a/28427260
score: 0

http://stackoverflow.com/a/28377244
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28376710
type: Answer
has body: Use something like below. This will add a class to each row. You can then add some CSS to style the row based on its class. getRowClass: function(record) { return record.get('parameter_1') === 'value1' ? 'class-1' : 'class-2'; } },
answers question: http://stackoverflow.com/q/28376710

http://stackoverflow.com/q/28362982
has answer: http://stackoverflow.com/a/28364031
has title: Regular-Expression capture word in html tag
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/28364031
has body: I try to replace some HTML-Tags in a code snippet. E.g. a span-element is to replace when it has no id, but it isn't to replace when it has an id. Here is my approach: var sHTML = 'Text abc &lt;span&gt; text def '; sHTML = sHTML.replace(/&lt;\s*\/*\s*span(.[^(id\=)]*){0,1}?&gt;/ig, ''); alert(sHTML); It works wrong! Because it must not replace when "id=" occurs, but in case of occur of some single character like "i" or "d" or "=" it shouldn't make any difference, and it has to replace. In other words, I expect for: var sHTML = 'Text abc &lt;span id=MyId &gt; text def '; Nothing is to replace, because the span-element has an id, so it should be remain as it is as follows: Text abc &lt;span id=MyId &gt; text def. But for var sHTML = 'Text abc &lt;span style="color:#00ff00;" &gt; text def '; it has to replace, because the span-element has no id as follows: Text abc text def. Any idea? Thanks in advance.
tagged with: javascript
tagged with: jquery
type: Question
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: regex

http://stackoverflow.com/q/28366199
tagged with: bluebird
score: 0
has comment: http://stackoverflow.com/comment/45073964
accepted answer: http://stackoverflow.com/a/28366518
answer count: 1
has comment: http://stackoverflow.com/comment/45073858
has comment: http://stackoverflow.com/comment/45074351
has body: It should be entirely possible to run something like the following: function someMiddleware (req, res, next) { someAsyncBluebirdOperation().then(res.json); } But if you pass any methods of a res objects directly as a reference in a resolve handler, you will get the following, unhelpful error: [TypeError: Cannot call method 'get' of undefined] __stackCleaned__: true If you wrap the call to res.json in another function, everything seems fine: function someMiddleware (req, res, next) { function wrapper(result) { res.json(result); } someAsyncBluebirdOperation().then(wrapper); } I can only assume there is some issue with binding/scope happening, but having to wrap the call in another function feels completely unnecessary.
tagged with: javascript
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/18014403
has answer: http://stackoverflow.com/a/28366518
tagged with: promise
has title: Why can't I pass Node request methods directly to Bluebird promises?
type: Question
duplicate of: http://stackoverflow.com/q/18014403
tagged with: node.js

http://stackoverflow.com/comment/45036582
type: QuestionComment
has text: @SargisAndreyan — You can try to identify what you actual problem is, but looking at what the values are, considering timing, and providing more code.
comment on: http://stackoverflow.com/q/28345862
score: 0
type: Comment

http://stackoverflow.com/comment/45134255
comment on: http://stackoverflow.com/q/28398550
type: QuestionComment
type: Comment
score: 1
has text: You really made your code worse.. I'll explain the root problem, but your previous version was more correct.

http://stackoverflow.com/a/28298329
type: Answer
answers question: http://stackoverflow.com/q/28298201
score: 0
has body: I came across needing to the same in my own app very recently and ended up using an interceptor on the $httpProvider. This sort of thing: angular.module('notesApp', []) .controller('MainCtrl', ['$http', function($http) { ... }]).factory('MyLoggingInterceptor', ['$q', function($q) { return { request: function(config) { console.log('Request made with ', config); return config; // If an error, or not allowed, or my custom condition // return $q.reject('Not allowed'); }, requestError: function(rejection) { console.log('Request error due to ', rejection); // Continue to ensure that the next promise chain // sees an error return $q.reject(rejection); // Or handled successfully? // return someValue; }, response: function(response) { console.log('Response from server', response); // Return a promise return response || $q.when(response); }, responseError: function(rejection) { console.log('Error in response ', rejection); // Continue to ensure that the next promise chain // sees an error // Can check auth status code here if need to // if (rejection.status === 403) { // Show a login dialog // return a value to tell controllers it has // been handled // } // Or return a rejection to continue the // promise failure chain return $q.reject(rejection); } }; }]) .config(['$httpProvider', function($httpProvider) { $httpProvider.interceptors.push('MyLoggingInterceptor'); }]);

http://stackoverflow.com/q/28423197
has body: When I create a new link dynamically, I can't catch the click event $("#div").html("new link); $("#new").click(function(e) { //doesn't catch e.preventDefault(); alert('click'); } How can I bind handlers to dynamic elements?
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28423221
has answer: http://stackoverflow.com/a/28423233
has title: Binding click handler to dynamic element
possible better answer: http://stackoverflow.com/a/28423230
upvote count: 0
has answer: http://stackoverflow.com/a/28423230
tagged with: javascript
tagged with: jquery
score: -1
answer count: 3
linked to: http://stackoverflow.com/q/11686905
favorite count: 0
accepted answer: http://stackoverflow.com/a/28423221
type: AnsweredQuestion
tagged with: onclick

http://stackoverflow.com/comment/45132513
score: 0
has text: So weird, it wouldn't work on Firefox but it works on Chrome. Is it just me?
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28398262

http://stackoverflow.com/comment/45123628
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28391969
has text: You're welcome, by the way, I've edited your question adding the jsfiddle link. It's better for everyone to understand the problem. If you want you can accept it.

http://stackoverflow.com/q/28428945
type: Question
possible better answer: http://stackoverflow.com/a/28429503
has comment: http://stackoverflow.com/comment/45190563
has comment: http://stackoverflow.com/comment/45189422
has answer: http://stackoverflow.com/a/28429503
has comment: http://stackoverflow.com/comment/45189121
has comment: http://stackoverflow.com/comment/45189917
tagged with: javascript
answer count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/45189316
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28430420
tagged with: click
favorite count: 0
has body: I am trying to associate several click actions to several buttons, in jQuery. I am using a for loop to browse all the buttons. I tried something like that : var realThis = $(this); // ... for (var i = 0; i &lt; buttons.length; i++) { if (typeof(buttons[i].callback) !== 'undefined') $('#' + buttons[i].id).click(function(){ buttons[i].callback(realThis.getFormValues()); }); } I got a warning from my editing software : Mutable variable is accessible from closure I tried several things without any success. Any help here ?
has comment: http://stackoverflow.com/comment/45190924
has answer: http://stackoverflow.com/a/28430420
has comment: http://stackoverflow.com/comment/45189181
type: AnsweredQuestion
downvote count: 0
has title: Associate buttons and click actions in a loop
score: 1
tagged with: mutable

http://stackoverflow.com/a/28301579
score: 0
has body: Try this way to catch your json encoded data, var a=county_med_month[c].county; For more info. about json array and object access :JSON
type: Answer
has comment: http://stackoverflow.com/comment/44955917
has comment: http://stackoverflow.com/comment/44954846
has comment: http://stackoverflow.com/comment/44955126
has comment: http://stackoverflow.com/comment/44955021
answers question: http://stackoverflow.com/q/28301428

http://stackoverflow.com/a/34704585
upvote count: 1
has body: I think this is a glitch/bug or else we can say this is how browser work since we are doing the DOM manipulations which may lead to repaint the entire DOM again,manipuating DOM in the dragStart event is causing this problem,shift DOM manipulation to dragEnter may solve the issue. The other solution could be setting the setTimeout which you already mentioned.
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28408720
type: Answer

http://stackoverflow.com/q/28386580
has comment: http://stackoverflow.com/comment/45111086
has comment: http://stackoverflow.com/comment/45111472
score: 0
has body: This function worked previously (the last time I opened this project over a week ago), but now I can't seem to get it to work at all and I have no idea how to figure out what's going wrong! First, I'll diagram my file architecture in case my file paths are incorrect and causing my php to not even be called: ~/Sites proj1 htdocs index.html ajax.php scripts java_script.js styles style_sheet.css includes scrapedImages . . . Here's the JS function that uses AJAX to call a .php script: function requestServer() { $.getJSON('/Users/aweeeezy/Sites/proj1/htdocs/ajax.php', function(data) { $.each(data, function(key, val) { var html = "&lt;img src='/Users/aweeeezy/Sites/proj1/includes/scrapedImages/"+val+"' style='display:block;max-width:20px;max-height:20px;width:auto;height:auto' alt=null /&gt;" $('#puppy-box').prepend(html); }); }); } The line setting var html was &lt;img src='...'+images[i]+"... when I first opened the project this morning, but I'm not sure why...I think because I was testing the site out, it was faster to only load a fraction of the images and used a for loop to cycle through only the first 10 or so pictures, hence the i index. Anyway, shouldn't it be data[i], or val[i]...or data[val]? I have no idea what's going on here. Here's the ajax.php file that the JS function is trying to call: &lt;?php $images = scandir('/Users/aweeeezy/Sites/proj1/includes/scrapedImages/'); /*foreach ($images as $key =&gt; $image) { if ($image == '.' || $image == '..') { unset($images[$key]); } }*/ echo json_encode($images); ?&gt; I commented out the middle part because I wasn't sure if this was causing a complication. I tried putting both echo and print lines in here to see if the script is being called, but even if they are working, I can't really see them because they're being returned as data (I think) to the JS function that calls the script. How do I even go about debugging this mess and get my girlfriend's valentine's day project back on track!
has comment: http://stackoverflow.com/comment/45111769
has comment: http://stackoverflow.com/comment/45111140
has comment: http://stackoverflow.com/comment/45111509
tagged with: ajax
has comment: http://stackoverflow.com/comment/45110998
has comment: http://stackoverflow.com/comment/45111349
has comment: http://stackoverflow.com/comment/45111078
type: UnansweredQuestion
tagged with: getjson
tagged with: php
has comment: http://stackoverflow.com/comment/45111085
has comment: http://stackoverflow.com/comment/45111604
answer count: 0
has comment: http://stackoverflow.com/comment/45111173
has comment: http://stackoverflow.com/comment/45111697
has title: Can't populate with elements of a json_encoded php array
type: Question
has comment: http://stackoverflow.com/comment/45111096
has comment: http://stackoverflow.com/comment/45110950
has comment: http://stackoverflow.com/comment/45110904
has comment: http://stackoverflow.com/comment/45111245
tagged with: javascript
has comment: http://stackoverflow.com/comment/45111014
has comment: http://stackoverflow.com/comment/45110921

http://stackoverflow.com/comment/45179184
has text: No. I submit the form in a general way.
type: Comment
comment on: http://stackoverflow.com/q/28422995
score: 0
type: QuestionComment

ember.js
tags question: http://stackoverflow.com/q/28398430
tags question: http://stackoverflow.com/q/28430713
tags question: http://stackoverflow.com/q/28370503
tags question: http://stackoverflow.com/q/28395114
tags question: http://stackoverflow.com/q/28436955
tags question: http://stackoverflow.com/q/28397953
tags question: http://stackoverflow.com/q/28400797
tags question: http://stackoverflow.com/q/28421075
tags question: http://stackoverflow.com/q/28364463
tags question: http://stackoverflow.com/q/28412001
tags question: http://stackoverflow.com/q/28336801
tags question: http://stackoverflow.com/q/28388947
tags question: http://stackoverflow.com/q/28386100
tags question: http://stackoverflow.com/q/28372904
tags question: http://stackoverflow.com/q/28433942
tags question: http://stackoverflow.com/q/28353424
type: Tag
tags question: http://stackoverflow.com/q/28314432
tag name: ember.js
tags question: http://stackoverflow.com/q/28317716
tags question: http://stackoverflow.com/q/28372064
tags question: http://stackoverflow.com/q/28384275
tags question: http://stackoverflow.com/q/28375282
tags question: http://stackoverflow.com/q/28310640
tags question: http://stackoverflow.com/q/28387452
tags question: http://stackoverflow.com/q/28280161
tags question: http://stackoverflow.com/q/28372454
tags question: http://stackoverflow.com/q/28325061
tags question: http://stackoverflow.com/q/28304358
tags question: http://stackoverflow.com/q/28288445
tags question: http://stackoverflow.com/q/28300302
tags question: http://stackoverflow.com/q/28347542
tags question: http://stackoverflow.com/q/28295582
tags question: http://stackoverflow.com/q/28306254
tags question: http://stackoverflow.com/q/28337413
tags question: http://stackoverflow.com/q/28369525
tags question: http://stackoverflow.com/q/28402944
tags question: http://stackoverflow.com/q/28346660
tags question: http://stackoverflow.com/q/28297617
tags question: http://stackoverflow.com/q/28386853
tags question: http://stackoverflow.com/q/28411379
tags question: http://stackoverflow.com/q/28308403
tags question: http://stackoverflow.com/q/28436142

http://stackoverflow.com/comment/45093050
has text: I am going to accept this answer because of all the good information, but I am still having issues.
comment on: http://stackoverflow.com/a/28376150
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45084670
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28371493
has text: At least right now, it looks like [pre-allocation is faster](http://jsperf.com/pre-allocate-vs-resize/2)
type: AnswerComment

http://stackoverflow.com/comment/44975168
type: Comment
type: QuestionComment
score: 0
has text: kidkamek, what do you mean?
comment on: http://stackoverflow.com/q/28312326

http://stackoverflow.com/comment/44966879
comment on: http://stackoverflow.com/a/28290944
score: 0
type: AnswerComment
type: Comment
has text: Thank you, I have found a solution, I simply show the parent before getting the values and then hide it again.

mobile
tags question: http://stackoverflow.com/q/28359159
tags question: http://stackoverflow.com/q/28401339
type: Tag
tags question: http://stackoverflow.com/q/28307686
tags question: http://stackoverflow.com/q/28327182
tags question: http://stackoverflow.com/q/28417252
tags question: http://stackoverflow.com/q/28402748
tags question: http://stackoverflow.com/q/28349760
tags question: http://stackoverflow.com/q/28425924
tags question: http://stackoverflow.com/q/28414052
tags question: http://stackoverflow.com/q/28434344
tags question: http://stackoverflow.com/q/28386369
tag name: mobile
tags question: http://stackoverflow.com/q/28426605

http://stackoverflow.com/comment/45162808
has text: @Teemu He's not using the bubble phase, he's using capture.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28414602
score: 0

http://stackoverflow.com/a/29772795
answers question: http://stackoverflow.com/q/28365859
accepted answer of: http://stackoverflow.com/q/28365859
type: AcceptedAnswer
score: 0
type: Answer
has body: I wrote the content of the dialog (div) in another file and used $("#div").load("content.php", {x:parameter_1, y:parameter_2, ......}); instead of $.ajax({ type: "POST", url: "show_lecturer.php", data: { x: names, y: surname} }) This did the trick. Now the div is initially invisible and empty, but once the button is clicked, it requests the content.php page to load. Since I'm passing the search parameters when I request the content, I get the data that I wanted. The problem from before was that when the page loaded, the div was created with the data (even though I hadn't clicked any button). Therefore, when I 'd click a button, it would show me the div with the content from the last page load (last refresh). There were also other minor changes I had to do to make it work, but this is the main idea.

http://stackoverflow.com/comment/45122093
score: 0
type: Comment
has text: The index will always change when the data changes. Why not just pass the object itself?
comment on: http://stackoverflow.com/a/28392573
type: AnswerComment

http://stackoverflow.com/comment/45031503
type: Comment
comment on: http://stackoverflow.com/q/28342402
score: 0
type: QuestionComment
has text: Some words of advice: You will not be successful in web development unless you take the time to *thoroughly* learn the basics - take your time on [MDN](https://developer.mozilla.org/en/), [html5rocks](http://www.html5rocks.com/en/) and possibly some other sites (this includes the w3c standards and recommendations !).

http://stackoverflow.com/comment/45077861
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28360869
has text: This is exactly what I need! Thank you. What if I eant some text to be link? Is it possible?
type: AnswerComment

http://stackoverflow.com/a/28434283
upvote count: 1
answers question: http://stackoverflow.com/q/28433989
score: 1
downvote count: 0
has body: It is possible to use operations before the parenthesis of a function call. Not quite so, console.log|('Hello world!'); is equivalent to console.log | 'Hello world!'; which has a different meaning than you intended :) ('Hello world!') is the same as 'Hello world!' and | is the bitwise OR operator in JavaScript (left | right will match the left operand with the right operand bit by bit). In your example, console.log without parenthesis returns the function itself (as opposed to console.log() which returns undefined), so you are basically [Function] | 'Hello world!'.
type: Answer

http://stackoverflow.com/a/28284482
type: Answer
has body: Change your PHP code to make sure item is given a class, instead of an id (because id's must be unique or they will not be handled correctly) - <?php $x = $NumberofItems; while ($x > 0) : ?> On <?php echo htmlspecialchars($date_Quest[$x])?>: <?php echo htmlspecialchars($desc_Quest[$x])?> <input type="hidden" name="QuestID" value="<?php echo $id_Quest[$x]; ?>"/> Complete <?php $x--; endwhile; ?> Then change your jQuery to handle the clicks appropriately (you do not have a submit, so eliminate the last function you show)- $(".subQuestComplete").click( function(e) { // handle the button click e.preventDefault(); // prevent the click's default action var thisForm = $(this).parent('form'); // get this form var thisData = $(this).parent('form').find('input').val(); $.post( $(thisForm).attr("action"), {QuestID: thisData}, // no need to serialize for a one value form function(info){ $("#result").html(info); }); }); Since the elements are now identified by class with can traverse the DOM tree to find the form value(s) for each form respctively - regardless of how many there may be in the page.
accepted answer of: http://stackoverflow.com/q/28283958
answers question: http://stackoverflow.com/q/28283958
type: AcceptedAnswer
score: 0
has comment: http://stackoverflow.com/comment/44925947

http://stackoverflow.com/q/28293245
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28344618
tagged with: extjs3
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: extjs
has body: Suppose I have some Ext JS code that attaches an event handler to all elements with class "myclass". For example: Ext.onReady(function(){ Ext.select('a[class*=myclass]').on('click', function(event, elm){ // do something }); }); And my html might be as follows: test1 test2 test3 That works with no problem. However, consider if the "myclass" elements were written to the page at some future time. For example: create link dynamically Ext.onReady(function(){ Ext.select('a[id*=anchor1]').on('click', function(event, elm){ Ext.get('panel').update('test4'); }); }); In this case, the "test4" link is created when a user clicks on a#anchor1. The "test4" link does not have the click() handler associated with it, even though it has class="myclass". Any idea how I can fix this? Basically, I would like to write the click() handler once and have it apply to both content present at page load, and content brought in later via Ajax/DHTML.
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28294709
score: 2
has title: In Ext JS, how to attach events to dynamic html elements?

http://stackoverflow.com/comment/45115022
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28388526
type: Comment
has text: It could very well be working correctly even if it's the same code but the data is not populated correctly to return any results in the 2nd dropdown. You may be looking for a code issue which doesn't exist due to data not being populated.

pointer-events
tags question: http://stackoverflow.com/q/28282811
tags question: http://stackoverflow.com/q/28402026
tag name: pointer-events
type: Tag

http://stackoverflow.com/comment/45179275
has text: I have found the path to forever but I am still not linking to the path of server.js correctly, I dont know why because it looks like its the right path. I have used `/usr/local/lib/node_modules/forever/bin/forever restart /var/www/example.io/public_html/server.js`
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28419747
type: AnswerComment

http://stackoverflow.com/a/28297050
has comment: http://stackoverflow.com/comment/44947350
downvote count: 0
has body: The aside element doesn't have an onload attribute (or load event). Only elements that load external content (e.g. &lt;img&gt;) and the document itself (where the attribute lives on the &lt;body&gt; element) do. Use a &lt;script&gt; element instead. &lt;aside&gt; Last submitted: &lt;/br&gt; &lt;input type="date" id="dateShow" readonly&gt; &lt;/aside&gt; &lt;script&gt; submitDate(); &lt;/script&gt; Additionally, you say that the file lives at "javascript/submitDate.js" but you are loading src="Javascript/submitDate.js". The function won't be available to call if you are using a case-sensitive file system (as the URL will 404).
type: Answer
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/28297004

http://stackoverflow.com/a/28333468
has body: $(document).ready(function() { $("#login").click(function() { var a = 3; var b = 2; var dataString:={a:a,b:b}; $.ajax({ url: "ajax.php", type: "post", data: dataString, success:function(result) { result=jQuery.parseJSON(result); console.log("OurResult:"+result ); } }); }); }); now the php part: &lt;?php $a = $_POST['a']; $b = $_POST['b']; $table=array($a,$b); echo json_encode($table); ?&gt;
type: Answer
answers question: http://stackoverflow.com/q/28331027
score: 0

http://stackoverflow.com/q/28429748
type: Question
accepted answer: http://stackoverflow.com/a/28430177
answer count: 2
downvote count: 0
tagged with: javascript
has body: I have a field in a postgres database like this: BACHILLER - Ciencias y Tecnología. - Humanidades y Ciencias Sociales. - Idiomas: inglés y francés. PROYECTOS Y SERVICIOS PEDAGÓGICOS - Aula abierta de apoyo (PROA). - Departamento de Orientación con dos orientadoras: atención individualizada y colectiva de alumnado y familias. - Tutoría coordinada por niveles. - Plan de Normalización Lingüística del Euskera. - AULATICE. INNOVACIÓN Y PROYECTOS DE FORMACIÓN - Página web del centro, dinámica y de apoyo a la enseñanza. - Blogs: Orientación, Psicología, AGENDA 21 ESCOLAR (A21e), Matemáticas, Física, PARADISE, Números, Asociación de Padres y Madres… - AGENDA 21 ESCOLAR (A21e). Participación en la agenda municipal. Certificado de Escuela Sostenible. - Proyecto plurilingüe: ENGLISH PROJECT. - Proyecto del Aula de Aprendizaje de Tareas (AAT): cocina. - Participación activa en los proyectos convocados por el Dpto. de Educación. SERVICIOS - Transporte escolar subvencionado en ESO. - Comedor escolar (ESO). - Acceso a Internet para el alumnado (WI-FI) e Intranet. INSTALACIONES - Enfermería. - Dos bibliotecas informatizadas (ESO y Bachiller). - TV y DVD en aulas. - Cuatro aulas de Informática. - Salón de actos. - Laboratorios de: Física, Química, Ciencias Naturales y Fotografía. - Talleres de: Plástica, Tecnología y Electrotecnia. - Aulas especializadas de: música, arte, euskera, castellano, inglés, AULATICE… - Amplias instalaciones deportivas, cubiertas y al aire libre. Frontón. I want to use javascript to convert this text into: BACHILLER - Ciencias y Tecnología. - Humanidades y Ciencias Sociales. - Idiomas: inglés y francés. PROYECTOS Y SERVICIOS PEDAGÓGICOS - Aula abierta de apoyo (PROA). - Departamento de Orientación con dos orientadoras: atención individualizada y colectiva de alumnado y familias. - Tutoría coordinada por niveles. - Plan de Normalización Lingüística del Euskera. - AULATICE. INNOVACIÓN Y PROYECTOS DE FORMACIÓN - Página web del centro, dinámica y de apoyo a la …
possible better answer: http://stackoverflow.com/a/28430362
has answer: http://stackoverflow.com/a/28430362
favorite count: 0
has answer: http://stackoverflow.com/a/28430177
has title: Javascript Adding line break before "-" and after "."
upvote count: 1
tagged with: text
type: AnsweredQuestion
score: 1

http://stackoverflow.com/comment/111974140
score: 0
comment on: http://stackoverflow.com/q/28399616
has text: @RahulVerma I think they want to simply disable it yes. If you know how to pass that `pfilter` param through the Web API, then that would make a good answer. (the `serviceURI` parameter that moka talked about [has been disabled in Chrome](https://bugs.chromium.org/p/chromium/issues/detail?id=480516), so not sure how you'd pass it...)
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28336640
upvote count: 2
answers question: http://stackoverflow.com/q/28336104
score: 2
has body: Although I think a regex expert would be able to do something like this in a one-liner, personally I would do something like this. function humanize(str) { return str.trim().split(/\s+/).map(function(str) { return str.replace(/_/g, ' ').replace(/\s+/, ' ').trim(); }).join(' ').toLowerCase().replace(/^./, function(m) { return m.toUpperCase(); }); } Tests: [ ' this is a test', 'foo Bar Baz', 'foo_bar', 'foo-bar', 'fooBarBaz', '_fooBarBaz____', '_alpha', 'hello_ _world, how are________you? ' ].map(humanize); /* Result: [ "This is a test", "Foo bar baz", "Foo bar", "Foo-bar", "Foobarbaz", "Foobarbaz", "Alpha", "Hello world, how are you?" ] */
downvote count: 0
type: Answer

http://stackoverflow.com/comment/45102571
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28381825
type: Comment
has text: no. it works only after first click, after second it's never working again. look: http://take.ms/6p6c2

http://stackoverflow.com/comment/45157554
type: QuestionComment
type: Comment
has text: woah? really? What is wrong with the json?
comment on: http://stackoverflow.com/q/28411966
score: 0

http://stackoverflow.com/comment/45154457
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/70567/discussion-between-user3699998-and-jai).
comment on: http://stackoverflow.com/a/28409616
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45068141
type: QuestionComment
has text: No, this is not how event handlers work in Javascript. When you call `ask()`, it installs two event handlers and then it returns. Those event handlers will be called sometime far into the future. Meanwhile the `ask()` function has already returned its value. There is simply no way for one of those event handlers to contribute to the return value of `ask()`.
comment on: http://stackoverflow.com/q/28363110
score: 0
type: Comment

http://stackoverflow.com/comment/45102209
comment on: http://stackoverflow.com/a/28381727
type: Comment
has text: It works.. And much thanks for your explanation. I just started understanding how it's working..
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45148118
has text: Yes i do understand that. My question regards how to implement timing as you have done. i do not understand how you initiated the landing and takeoff sequence and enabling the landing to take priority when both landing and takeoff times are the same. Is my question clear sir?
score: 0
comment on: http://stackoverflow.com/a/28323989
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/45093632
type: QuestionComment
score: 0
has text: I got it you are missing an echo...
comment on: http://stackoverflow.com/q/28376477
type: Comment

http://stackoverflow.com/comment/44953808
comment on: http://stackoverflow.com/q/28300165
score: 1
has text: They're not compatible in any way - the have different interfaces, different events, etc. How do you imagine this should work? That's like expecting for one, hmm, chart library to be interchangeable with another, just because they both deal with charts?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44968523
has text: I didn't know about that. It's specific to ` ` elements.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28307735
type: QuestionComment

http://stackoverflow.com/a/28431031
has comment: http://stackoverflow.com/comment/45192893
score: 0
answers question: http://stackoverflow.com/q/28430876
type: Answer
has body: Try using display:table-* it will make your elements behavior like a table. .row { margin: 0 auto; display: table-row; } .col-md-6 { position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px; display: table-cell; text-align: center; vertical-align: middle; }
has comment: http://stackoverflow.com/comment/45192953

http://stackoverflow.com/comment/44925901
score: 1
comment on: http://stackoverflow.com/q/28285793
type: Comment
type: QuestionComment
has text: You have a syntax error in the JavaScript. `Math.ceil(seconds) "s to mine."` should be `Math.ceil(seconds) + "s to mine."`

http://stackoverflow.com/comment/45136052
type: QuestionComment
has text: Not exactly.. that example loads a data file "population909500.json" via ajax, but this data file has 3 datasets (one for each year) within it. Loading a new set of data and re-executing the call to globe.addData would cause the new data to stack on top of the old data
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28390019

http://stackoverflow.com/a/28364404
score: 1
has body: add an id to your form and append the div to the form &lt;form id="myform"&gt; var myDiv = $(".avail"); $("#myform").append(myDiv);
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/28364312
downvote count: 0

http://stackoverflow.com/comment/45123911
comment on: http://stackoverflow.com/q/28393576
has text: Thanks for both advices. Alert will be replaced by another notification (in the DOM itself). Anyway I'll check the use of the timeout function in this case!
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45179840
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28423190
score: 1
has text: `document` is the top level object, so its just a little more efficient to restrict to to the closest ancestor, so if you have (say) ` in the main view in which you render the partial(s), then it would be `$('#container').on('click', 'a[data-modal]'...`

http://stackoverflow.com/comment/44977092
comment on: http://stackoverflow.com/a/28313520
score: 0
type: AnswerComment
type: Comment
has text: Hey thanks for taking the time to answer, I'm wanting to make a header like the one in the link where if you were to stop halfway through scrolling, the size change would stop before resuming when you do

http://stackoverflow.com/q/28408532
has comment: http://stackoverflow.com/comment/45151612
has answer: http://stackoverflow.com/a/28408735
has comment: http://stackoverflow.com/comment/45151075
has title: get value of string before and after / in javascript
has comment: http://stackoverflow.com/comment/45151017
upvote count: 1
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45151594
type: Question
has answer: http://stackoverflow.com/a/28408667
has answer: http://stackoverflow.com/a/28408988
tagged with: javascript
has body: suppose i have 10 localstorage like blow: localStorage.setItem("item01","this is a value/100"); localStorage.setItem("item02","this new is a value/110"); localStorage.setItem("item03","this is a good value/120"); localStorage.setItem("item04","this is a nice value/130"); I need a java script code to check if the key of for example item01 is not 0 then put the data of item01 before / to xyz and the data after / to rfv variable.
accepted answer: http://stackoverflow.com/a/28408667
has comment: http://stackoverflow.com/comment/45151128
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28408735
favorite count: 0

http://stackoverflow.com/comment/45077089
has text: that returns the entire document
type: Comment
comment on: http://stackoverflow.com/a/28368122
score: 1
type: AnswerComment

http://stackoverflow.com/q/28434972
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45285375
favorite count: 0
downvote count: 2
tagged with: web-applications
has body: I am having problems with the Intel AppFramework. I can not seem to get the sidemenu working. It is working fine on the demo you can download from the AppFramework website, but no matter how well I am trying to mimic it - I can't get the sidemenu to work on my project. Everything is working fine until I add tags as that is how you make a sidemenu. When those tags are added the whole app will render blank / white and an error pops up into console saying "Uncaught TypeError: Cannot read property 'hideScrollbars' of undefined". It has something to do with appframework.ui.js' line 1100 that saysthis.scrollingDivs.menu_scroller.hideScrollbars(); So it seems like this menu_scroller is undefined for some reason. This is as much code as I can give you, it is the index.html of my AppFramework / Phonegap app: http://pastebin.com/dXtTeiKx Console does not say about any missing files (except cordova.js which is fine because PC) nor does it throw any other JavaScript errors other than the one I told you, so I would assume there is no need for me to post the code in every other file. I have tried the tags with AppFramework version 3.0. I have also tried switching the JavaScript includes around a bit, including appframework.ui before appframework and putting some includes to the bottom of the index.html, but none if these have resolved the issue so far. I also tried removing all excess css and js includes but that did not work either. This has lead me to believe there is some kind of bug within the AppFramework itself or I am just doing something horribly wrong or have overseen something. Here is the documentation for the AppFrameworks sidemenu: http://app-framework-software.intel.com/documentation.php#afui/afui_side and as you can see, it should not require anything else than including that nav thing to the source, hell I even tried copying the whole Left Menu This is the left menu ...but that changed nothing.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45324514
score: -2
has answer: http://stackoverflow.com/a/28502670
has comment: http://stackoverflow.com/comment/45285014
type: Question
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Intel AppFramework - sidemenu not working
tagged with: appframework
has comment: http://stackoverflow.com/comment/45285205
accepted answer: http://stackoverflow.com/a/28502670

http://stackoverflow.com/q/28382847
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28382940
type: AnsweredQuestion
score: 2
has title: Change header background on scroll
downvote count: 0
tagged with: header
favorite count: 0
type: Question
has body: I'm trying to change the header background of a page on scroll. I'm using the code below. The JS is working, when scrolling greater than 100px I can see the class .not-transparent being added to the element in HMTL. The problem is, that class isn't being subsequently being called in the CSS. Here's the HTML: logo nav Here's the CSS header { width:100%; position:fixed; top:0px; z-index:3; } header.not-transparent { background: #252525; }
has answer: http://stackoverflow.com/a/28382940
upvote count: 2
has comment: http://stackoverflow.com/comment/45104107
tagged with: scroll
answer count: 1
has comment: http://stackoverflow.com/comment/45104091

http://stackoverflow.com/q/28392726
has comment: http://stackoverflow.com/comment/45122258
upvote count: 1
has answer: http://stackoverflow.com/a/28393391
has comment: http://stackoverflow.com/comment/45122997
has comment: http://stackoverflow.com/comment/45122315
type: Question
has answer: http://stackoverflow.com/a/28392868
has answer: http://stackoverflow.com/a/28393063
has comment: http://stackoverflow.com/comment/45122545
has comment: http://stackoverflow.com/comment/45122212
has answer: http://stackoverflow.com/a/28392789
tagged with: javascript
tagged with: variables
has comment: http://stackoverflow.com/comment/45122791
has comment: http://stackoverflow.com/comment/45122221
has comment: http://stackoverflow.com/comment/45131206
favorite count: 0
score: -1
type: UnansweredQuestion
has body: it is possible to set value for the local variable when you call it ? it is my code var myvar={ F:function(){ var x; return x;} } my problem is when I call the x variable and set value like myvar.F().x="hello"; . then recall it console.log(myvar.F().x) x don't contain that value only return undefined ? how i can fix it but please don't suggest me to set the value inside F function AND Using Parameters from F function ! other way because I want make a dynamic variable not static value Thanks for help
downvote count: 2
tagged with: local-variables
answer count: 4
has comment: http://stackoverflow.com/comment/45122226
has comment: http://stackoverflow.com/comment/45122591
has title: Javascript: how to set value for local variable
has comment: http://stackoverflow.com/comment/45122504
has comment: http://stackoverflow.com/comment/45122281

http://stackoverflow.com/a/40941554
answers question: http://stackoverflow.com/q/28343748
type: Answer
has comment: http://stackoverflow.com/comment/83547196
score: 5
upvote count: 5
has body: This worked for me (as well as implementing Anand's observed IE 10+ requirements): function Popup() { var _window = window.open(''); _window.document.write(data); // required for IE &gt;= 10 _window.document.close(); _window.focus(); _window.document.body.onload = function() { // continue to print _window.print(); _window.close(); }; return true; } Instead of waiting for the window to load and attempting to print it prematurely, this just waits for the entire document.body to load.
downvote count: 0

http://stackoverflow.com/q/28383136
has body: Hi i need to make flipping cards effect in different browsers but it correctly works only in chrome and opera...in different browsers it doesn't change image or change image but doesn't flipp... can you help me?? this is my CSS code: .flip-container { perspective: 1000; } /* flip the pane when hovered */ .flip-container:hover .flipper, .flip-container.hover .flipper { -webkit-transform: rotateY(180deg); -moz-transform: rotateY(180deg); transform: rotateY(180deg); } .flip-container, .front, .back { width: 400px; height: 200px; } /* flip speed goes here */ .flipper { transition: 0.4s; -webkit-transform-style: preserve-3d; -moz-transform-style: preserve-3d; transform-style: preserve-3d; position: relative; } /* hide back of pane during swap */ .front, .back { -webkit-backface-visibility: hidden; -moz-backface-visibility: hidden; backface-visibility: hidden; position: absolute; top: 0; left: 0; } /* front pane, placed above back */ .front { z-index: 2; } /* back, initially hidden pane */ .back { -webkit-transform: rotateY(180deg); -moz-transform: rotateY(180deg); transform: rotateY(180deg); } textarea { resize: none; } and this is my Html code: <a href="http://<?echo $_SERVER['SERVER_NAME'];?>/sk/hudba"> <img src="http://<?echo $_SERVER['SERVER_NAME'];?>/images/titulna/hudba.png"> <img src="http://<?echo $_SERVER['SERVER_NAME'];?>/images/titulna/hudba1.png">
has title: css flipping cards in different browsers
score: 0
tagged with: php
has answer: http://stackoverflow.com/a/28383258
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28383258
type: Question
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: css

http://stackoverflow.com/q/28346414
answer count: 4
upvote count: 0
has answer: http://stackoverflow.com/a/28346630
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28346601
score: -4
has answer: http://stackoverflow.com/a/28346502
has comment: http://stackoverflow.com/comment/45037036
downvote count: 4
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28346502
has answer: http://stackoverflow.com/a/28346597
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/45037107
tagged with: css
has body: I'm just beginning to learn Javascript and Jquery but I've been having a lot of issues lately. I've found similar topics but nothing that is exactly what I'm looking for. Essentially, I want to hover over a text link, and have an image fade in on a different place of the page. I'm not sure if this can be done with CSS, because I am not familiar with newer CSS codes unfortunately. Any help would be greatly appreciated!
has title: Hover Over Text, Image Fades In
accepted answer: http://stackoverflow.com/a/28346597
has comment: http://stackoverflow.com/comment/45036970

http://stackoverflow.com/q/28335559
answer count: 1
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28337251
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45065832
tagged with: css
has title: Google Bar Chart Unable Show Float Numbers
upvote count: 1
has body: I have some issue that my bar chart from google chart not showing float numbers, while im using others type of bar chart that google chart provide it works. But only this type of chart wont show the float numbers. Here's the code I write : http://jsfiddle.net/2nf8x41g/1/ I hope that the solution is not change the type of declaration var data such as : var data = new google.visualization.DataTable(); data.addColumn("Unit", "February", "Previous Month", "Previous 2 months"); Thanks in advance
type: Question
tagged with: charts
has comment: http://stackoverflow.com/comment/45020072

http://stackoverflow.com/a/28295273
answers question: http://stackoverflow.com/q/28294937
downvote count: 1
score: -1
upvote count: 0
type: Answer
has body: Try this, it will select all elements with userNote and having highlight class $('body').find('[class*=userNote].highlight').length I hope this is exactly what you need

http://stackoverflow.com/comment/45149124
type: AnswerComment
comment on: http://stackoverflow.com/a/28406962
has text: But someone told me javascript approach was better.
type: Comment
score: 0

http://stackoverflow.com/a/36658067
has body: ok so this is how we do it in javascript... google have their own functions for this.... link: https://developers.google.com/maps/documentation/javascript/places#place_search_requests var map; var service; var infowindow; function initialize() { var pyrmont = new google.maps.LatLng(-33.8665433,151.1956316); map = new google.maps.Map(document.getElementById('map'), { center: pyrmont, zoom: 15 }); var request = { location: pyrmont, radius: '500', types: ['store'] }; service = new google.maps.places.PlacesService(map); service.nearbySearch(request, callback); } function callback(results, status) { if (status == google.maps.places.PlacesServiceStatus.OK) { for (var i = 0; i &lt; results.length; i++) { var place = results[i]; createMarker(results[i]); } } } anyone wants to gain access to the place Id and stuff this is how we do it.... In the call back function we have the JSONArray of places returned by google... In the call back function inside the for loop after the line var place = results[i]; u can get wat u want like console.log(place.name); console.log(place.place_id); var types = String(place.types); types=types.split(","); console.log(types[0]);
downvote count: 3
upvote count: 7
type: Answer
answers question: http://stackoverflow.com/q/28359730
score: 4

http://stackoverflow.com/q/28303647
linked to: http://stackoverflow.com/q/15339312
tagged with: http://stackoverflow.com/tag/html
answer count: 4
accepted answer: http://stackoverflow.com/a/28303801
has answer: http://stackoverflow.com/a/28303859
has comment: http://stackoverflow.com/comment/44959008
has answer: http://stackoverflow.com/a/28303901
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28303801
has comment: http://stackoverflow.com/comment/44958608
has title: Make part of div clickable
possible better answer: http://stackoverflow.com/a/28303901
type: Question
linked to: http://stackoverflow.com/q/2329816
has comment: http://stackoverflow.com/comment/44958707
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44958745
has answer: http://stackoverflow.com/a/28305570
score: 0
tagged with: jquery-events
has body: I'm having trouble with a popup window that, when visible, needs to close when a user clicks on the underlying gray area (the area behind the popup window), and not on the popup window itself. Is there any way I can achieve this? HTML Text in Popup Hide popup CSS *{ font-family: Areal; } .b-container{ width:200px; height:150px; background-color: #ccc; margin:0px auto; padding:10px; font-size:30px; color: #fff; } .b-popup{ width:100%; min-height:100%; background-color: rgba(0,0,0,0.5); overflow:hidden; position:fixed; top:0px; } .b-popup .b-popup-content{ margin:40px auto 0px auto; width:600px; height: 600px; padding:10px; background-color: #c5c5c5; border-radius:5px; box-shadow: 0px 0px 10px #000; } JavaScript - jQuery $('div.b-popup').click(function () { PopUpHide(); }); Sample is here: http://jsfiddle.net/p7NbX/15/ I've tried to set function call on div click, but it closes popup if I click on popup content div.

http://stackoverflow.com/comment/45086651
has text: This probably doesn't even matter, but I just have to say it.. You're comparing for characters greater than 50 and returning an error message saying it's over 75? :)
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28373054

http://stackoverflow.com/comment/44980289
has text: @user3741790, where did `destination ` came from?
comment on: http://stackoverflow.com/q/28314789
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28342548
downvote count: 1
has comment: http://stackoverflow.com/comment/45029534
type: Answer
has comment: http://stackoverflow.com/comment/45029603
score: 2
upvote count: 3
answers question: http://stackoverflow.com/q/28342244
has body: var res={"data":[{"language":{"190":"english","191":"gujarati"}}]}; console.log( Object.keys(res['data'][0].language).length); JS Fiddle
has comment: http://stackoverflow.com/comment/45029690

wikipedia-api
tag name: wikipedia-api
type: Tag
tags question: http://stackoverflow.com/q/28432980

http://stackoverflow.com/comment/45062684
type: Comment
type: QuestionComment
has text: It may be possible to communicate with the flash object using Javascript in your page, but that would totally depend upon how the flash object is written and whether it allows that. As far as I know, there is no generic way to click buttons in a flash object using Javascript that is running outside the Flash object.
score: 0
comment on: http://stackoverflow.com/q/28359998

http://stackoverflow.com/comment/44956763
type: Comment
has text: Ok thank you. I thought just reusing the cloned object, changing the property and appending the value would save different instances of the cloned one.
type: QuestionComment
comment on: http://stackoverflow.com/q/28302469
score: 0

http://stackoverflow.com/comment/45188014
has text: NO if you use angular `$http` service as #neilhem mentioned in the last comment, but if you use like jquery ajax you need to use `$apply()` there to tell the angular to there is something out side the scope and need to bind to the scope.
score: 1
comment on: http://stackoverflow.com/a/28427611
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45076673
type: Comment
has text: Oke, fair enough. Then there are two other options: call AJAX and instruct it to return HTML instead of JSON. Then add the received data using jquery. Other option is to just return the new data using JSON and create the HTML in JQuery as instructed in my previous comment. This is the recommended way. Calling a PHP file just to setup some HTML is not a common solution. I could adapt the answer to reflect this. I know you cannot write PHP in jquery, but learning to build HTML in JQuery isn't very different from PHP.
comment on: http://stackoverflow.com/a/28366141
type: AnswerComment
score: 0

http://stackoverflow.com/q/28404210
has answer: http://stackoverflow.com/a/28404309
upvote count: 2
has comment: http://stackoverflow.com/comment/45143083
answer count: 3
has comment: http://stackoverflow.com/comment/45143111
has body: I've working on a javascript regex that I intend to use with the jquery validate plugin (I'll add this as an additional method). It must (among other rules): test if at least one of the following special characters is entered: !, ", #, $, %, &amp;, ', (, ), *, +,-, .,/, :, ;, &lt;, =, &gt;, ?, @, [, \, ], ^, _, `, {, |, }, ~ not allow 3 consecutive identical characters: passed: aa 99 ++ not passed: aaa 999 +++ The problem with my regex is that is having problem with these mentioned rules: I think the issue is related to escaping and I've tried escaping + and - to no avail. Can anyone help! This is my regex: http://regexr.com/3ack3
has answer: http://stackoverflow.com/a/28404271
score: 2
has comment: http://stackoverflow.com/comment/45142984
tagged with: validation
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45143031
tagged with: regex
has title: Regex to allow certain special characters - escape issue
favorite count: 0
has answer: http://stackoverflow.com/a/28404409

http://stackoverflow.com/comment/45012992
type: Comment
score: 1
type: AnswerComment
has text: @dsg - added a note about that.
comment on: http://stackoverflow.com/a/28332606

http://stackoverflow.com/comment/45045858
has text: Thank you! The `$('.toggle.active')` was the key that I needed. With that and a function I found `var selected = document.querySelectorAll('.toggle.active');` made it work.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28336780
score: 0

http://stackoverflow.com/q/28426145
has comment: http://stackoverflow.com/comment/45184347
tagged with: http://stackoverflow.com/tag/json
has body: I am new in jQuery. But what I found is it is very easy to use with any Javascript functions. What I am trying is to achieve - http://www.w3schools.com/jquery/demo_ajax_json.js this or this https://www.googleapis.com/calendar/v3/calendars/mnjusq8qt3kh847kge772s9fmk%40group.calendar.google.com/events?singleEvents=true&key=AIzaSyD28KypP-wTD-AKZVECKL0WsxoXhJiYbys address's JSON data in my page with Javascript with help of jQUery. Page Content is simple JSON data- { "firstName": "John", "lastName": "Doe", "age": 25 } What I have done in jQuery is- And What I am getting in every time is - In Chrome- Uncaught SyntaxError: Unexpected token : In Firefox- SyntaxError: missing ; before statement "firstName": "John", I have tried many times and searced everywhere for its solutions. But I can't get a proper solution. Can anyone please help me? Thanks in advance for helping.
type: Question
has title: Find JSON value with CORS in jQuery from another domain (cross site)
has comment: http://stackoverflow.com/comment/45184324
tagged with: javascript
tagged with: jquery
tagged with: xmlhttprequest-level2
score: 0
answer count: 0
type: UnansweredQuestion
tagged with: xmlhttprequest
has comment: http://stackoverflow.com/comment/45184367

http://stackoverflow.com/comment/45042874
score: 1
comment on: http://stackoverflow.com/q/28349513
type: Comment
type: QuestionComment
has text: Consider making the title of this question more descriptive.

http://stackoverflow.com/comment/45083028
comment on: http://stackoverflow.com/a/28371114
type: Comment
score: 0
has text: @BhojendraNepal if a1 and a2 are truthy, that returns `null`. In fact it always returns something falsy.
type: AnswerComment

fade
tags question: http://stackoverflow.com/q/28424118
tags question: http://stackoverflow.com/q/28406445
type: Tag
tag name: fade

http://stackoverflow.com/q/28399616
has answer: http://stackoverflow.com/a/63356890
has comment: http://stackoverflow.com/comment/69790997
type: Question
has comment: http://stackoverflow.com/comment/111974140
score: 26
has comment: http://stackoverflow.com/comment/111971352
upvote count: 26
answer count: 1
downvote count: 0
tagged with: javascript
has body: I am using webkitSpeechRecognition instance to access the native speech recognition in Chrome. The problem is that the Web Speech API specification does not cover the topic of profanity filtering, yet Google's Speech API, by default, has the profanity filter enabled. It is not a major problem - luckily the default filter for Web Speech API shows the first letter and hides the rest under the asterisks. However there are cases when a word starting with a certain letter and having a certain length be derived from different cuss words and guessing what the person has said may not give an accurate result. The question here is: how can the profanity filtering level of Web Speech API in Chrome be controlled? The JavaScript instance does not expose any additional (platform specific) variables to play around with. The actual Speech API had the pfilter URL parameter which can be set to 0 (no filtering), 1 (filtering and replacing words with ####) or 2 (filtering and replacing all but the first letter with asterisks). This parameter is also exposed for Chrome Extension developers, it is located in SpeechInputStartOptions (however it is a boolean variable). P.S. The SpeechInputStartOptions documentation talks about default Chrome filtering settings. I could not find the setting for this or any information about where it is located. Even though ideally, the solution should not involve user having to do something, finding the in-Chrome setting for it would still be a breakthrough.
favorite count: 0
tagged with: webspeech-api
has title: Disable profanity filter for recognition via Web Speech API
type: UnansweredQuestion
tagged with: google-chrome

http://stackoverflow.com/a/28364105
has comment: http://stackoverflow.com/comment/45070570
has comment: http://stackoverflow.com/comment/45070415
score: 0
has body: You need to add this lines in ur config.xml to get your plugin worked... (in app/res/xml/config.xml) &lt;feature name="Media"&gt; &lt;param name="android-package" value="org.apache.cordova.media.AudioHandler" /&gt; &lt;/feature&gt; "Uncaught ReferenceError: Media is not defined" mean your code couldn't able to recognize it... meaning "not configured"
answers question: http://stackoverflow.com/q/28363666
type: Answer

http://stackoverflow.com/a/28356294
downvote count: 0
has comment: http://stackoverflow.com/comment/45058799
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/45079675
answers question: http://stackoverflow.com/q/28356156
has body: An element in d.data array has the following structure: ["2015-02-28", 67.53, 68.67, 67.05, 67.68, 0.0, 67.68 ] I am not sure why this is not a JSON object (with field-value pair) but in order to access it you need to do something as below: function(error, d) { var data = d.data; data.forEach(function(d) { var date = parseDate(d[0]); var open = d[1]; var high = d[2]; .. var close= d[6]; }); }

http://stackoverflow.com/comment/45101280
type: Comment
type: AnswerComment
has text: To make Global a var inside a function, I should nor use 'var', is that the rule?
comment on: http://stackoverflow.com/a/28380908
score: 0

jquery-ui
tags question: http://stackoverflow.com/q/28387080
tags question: http://stackoverflow.com/q/28377138
tags question: http://stackoverflow.com/q/28414653
tags question: http://stackoverflow.com/q/28341375
tags question: http://stackoverflow.com/q/28423666
tags question: http://stackoverflow.com/q/28300073
tags question: http://stackoverflow.com/q/28337455
tags question: http://stackoverflow.com/q/28435650
tags question: http://stackoverflow.com/q/28363869
tags question: http://stackoverflow.com/q/28352052
tags question: http://stackoverflow.com/q/28370225
tags question: http://stackoverflow.com/q/28433061
tags question: http://stackoverflow.com/q/28302190
tags question: http://stackoverflow.com/q/28330563
tags question: http://stackoverflow.com/q/28335039
tags question: http://stackoverflow.com/q/28313092
tags question: http://stackoverflow.com/q/28305869
tags question: http://stackoverflow.com/q/28421388
tags question: http://stackoverflow.com/q/28362894
tags question: http://stackoverflow.com/q/28280713
tags question: http://stackoverflow.com/q/28301027
tags question: http://stackoverflow.com/q/28392301
tags question: http://stackoverflow.com/q/28403698
tags question: http://stackoverflow.com/q/28425013
tags question: http://stackoverflow.com/q/28302053
tags question: http://stackoverflow.com/q/28359376
tags question: http://stackoverflow.com/q/28319554
type: Tag
tags question: http://stackoverflow.com/q/28329361
tag name: jquery-ui
tags question: http://stackoverflow.com/q/28404624
tags question: http://stackoverflow.com/q/28320693
tags question: http://stackoverflow.com/q/28325461
tags question: http://stackoverflow.com/q/28351934

http://stackoverflow.com/a/28370067
has comment: http://stackoverflow.com/comment/45081127
has body: Keyframes is massive overkill here. You can simply use transition and then change the opacity value as needed: img { opacity: 0; transition: opacity 5s; } a:hover +img { opacity: 1; } Example Fiddle Note that I sped up the transition in the Fiddle as 5 seconds is a little excessive for a fade-in effect in my experience.
upvote count: 7
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45080767
has comment: http://stackoverflow.com/comment/45080943
type: Answer
has comment: http://stackoverflow.com/comment/45080790
has comment: http://stackoverflow.com/comment/45081148
has comment: http://stackoverflow.com/comment/45080912
accepted answer of: http://stackoverflow.com/q/28369962
downvote count: 0
score: 7
answers question: http://stackoverflow.com/q/28369962

http://stackoverflow.com/q/28280732
linked to: http://stackoverflow.com/q/11124777
favorite count: 0
type: Question
tagged with: twitter-bootstrap
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28280936
has comment: http://stackoverflow.com/comment/44915772
answer count: 3
has answer: http://stackoverflow.com/a/28280919
upvote count: 1
has body: I'd like to use a menu bar with Bootstrap that always stays on top of the page. Therefore I used the class navbar-fixed-top. I used the code from the very end of this post and ran into a problem with visibility of my content The main content is partly overlapped by the menue. On http://getbootstrap.com/examples/starter-template/ the problem is "solved" by adding padding-top: 50px; to the body. But this does not work, when the menu is wrapping and becomes larger than 50px: Is there a class in bootstrap that covers this problem? Or do I have to add a JavaScript that listens to changes of the window-size and adjusts the padding-top? I have no idea how to do that, but that's the only thing that came to my mind,... CODE: Bootstrap Toggle navigation Project name Home About Contact Item01 Item02 Item03 Item04 Item05 Item06 Item07 Item08 Item09 Item10 Item11 My first template Dummy content, dummy content, dummy content, dummy content, dummy content, dummy content, dummy content, dummy content. Dummy content, dummy content, dummy content, dummy content, dummy content, dummy content, dummy content, dummy content. Dummy content, dummy content, dummy content, dummy content, dummy content, dummy content, dummy content, dummy content. Contact us
has answer: http://stackoverflow.com/a/28281115
tagged with: javascript
type: UnansweredQuestion
has title: Bootstrap menu covering page content
has comment: http://stackoverflow.com/comment/44915828
downvote count: 0
score: 1
tagged with: jquery

http://stackoverflow.com/q/28313153
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has body: While I have successfully created a simple project using the table object and the function onAfterRendering, I realized that just implementing the onAfterRendering function changes the appearance and disables some functions of the table object. The header becomes misaligned with the columns, the left row selectors are bunched up and the scrollbar does not work. I have seen this happen on any table object that I have tried. As an example, I took SAP's Fixed Columns Example from the SDK, added the onAfterRendering function with no contents and see the problem. I changed the column width to 50px or 100px which causes the problem to be more obvious. I'm implementing the function following the placeAt statement. I'm using Eclipse Luna with SAPUI5 1.24.4. //Bring the table onto the UI oTable2.placeAt("sample2"); oTable2.onAfterRendering = function(){ };
score: 1
tagged with: sapui5
upvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28316280
has title: sapui5 table onAfterRendering causes problems

http://stackoverflow.com/comment/45872496
comment on: http://stackoverflow.com/q/28329585
score: 0
has text: i have similar example but same result.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28366178
answers question: http://stackoverflow.com/q/28364586
score: 0
has body: Try using jQuery's compatibility mode, e.g. replace $ with jQuery. If your theme utilizes Velocity or Freemarker, these $ terms might be interpreted by the templating engine. Alternatively, you might want to try escaping the $ sign, some tipps in this SO question
type: Answer

http://stackoverflow.com/comment/45050330
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28349548
has text: That's rubbish. Your stack would not blow, as your function [runs asynchronously](http://stackoverflow.com/a/17090506/1048572). You're not using `fs.existsSync`!
score: 0

http://stackoverflow.com/comment/45092864
type: Comment
has text: I just want to use it for the header on my settings fly out. Are you saying this is absolutely not possible?
type: AnswerComment
comment on: http://stackoverflow.com/a/28375435
score: 0

http://stackoverflow.com/a/28411251
type: Answer
has comment: http://stackoverflow.com/comment/45159114
has comment: http://stackoverflow.com/comment/45159019
has body: Indeed, chrome.browserAction.onClicked cannot reside in a content script. It must be listened to in the background script. That is the main purpose of a background script: the unified place to react to events. It's so prevalent that Chrome even introduced a special class of background pages, Event Pages, for background pages that only react to events. You need to decide whether you go manifest injection route or programmatic injection route. If you inject your code via manifest, your script will always be loaded and you can use chrome.tabs.sendMessage to trigger code in it. If you decide to inject code on click only, you should call chrome.tabs.executeScript from the listener, as you did in your code. Again, if you need to communicate between the two components, use Messaging. Have another look at the Architecture overview while you're at it.
score: 2
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/28409881
has comment: http://stackoverflow.com/comment/45161207

http://stackoverflow.com/a/28313090
answers question: http://stackoverflow.com/q/28312986
downvote count: 0
score: 1
has body: If you are in fact using Jquery. $(".lm_content").append(iframeDoc) http://jsfiddle.net/d98vmm15/
type: AcceptedAnswer
upvote count: 1
type: Answer
accepted answer of: http://stackoverflow.com/q/28312986

http://stackoverflow.com/comment/44983001
type: Comment
has text: That's it. Thanks very much! Thinking about it, I see the error in the logic I used. Apart from solving this specific issue, I've learned how to handle this in the future. Thanks again!
comment on: http://stackoverflow.com/a/28316819
score: 0
type: AnswerComment

http://stackoverflow.com/q/28369232
possible better answer: http://stackoverflow.com/a/28370532
score: 0
has body: My problem perhaps has a simple answer but I don't know of it. I have a select box which adapts its size to its possible values but I can't get it's size by something like $('#idSlect').attr('size') because it doesn't have a size attribute, it just adapts itself. How can I make my input text the same size as my select box? What I want is something like: $('#idInputText').size($('#idSelect').size()) Thanks for your answers.
answer count: 3
has answer: http://stackoverflow.com/a/28370532
has answer: http://stackoverflow.com/a/28369305
tagged with: css
has comment: http://stackoverflow.com/comment/45079229
has title: Add an input text who have the size of a select
has answer: http://stackoverflow.com/a/28369407
accepted answer: http://stackoverflow.com/a/28369305
has comment: http://stackoverflow.com/comment/45079289
tagged with: javascript
tagged with: jquery
type: Question
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45080851

http://stackoverflow.com/q/28296519
has title: Can't call function with button click (javascript)
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44945338
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/28296588
has answer: http://stackoverflow.com/a/28296986
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44945385
has answer: http://stackoverflow.com/a/28296978
answer count: 3
downvote count: 3
has comment: http://stackoverflow.com/comment/44952772
type: UnansweredQuestion
tagged with: forms
has body: I have a very strange issue. I have a button which currently prints a barcode label using the following code: &lt;button id="printButton"&gt; PRINT BARCODE LABEL &lt;/button&gt; This button then successfully calls: printButton.onclick = function() { CODE } The problem is that I wish to be able to print multiple barcode labels with a single button press. So, I changed the javascript function to: function print() { CODE } And added printButton.onclick = function() { print(); } With the idea being that I can ultimately call multiple print functions (print1() print2() etc) from the same button press. The problem is, when I rewrite the code as above, nothing happens, even though it seems to me that the exact same thing should happen as happened before? Any idea? I am happy to post the full code if anyone thinks that might help.
score: -3

http://stackoverflow.com/comment/45052770
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28354473
has text: The `g` modifier is missing. Without it will only return the first match and not all (both) as requested.
score: 1

http://stackoverflow.com/q/28432440
type: Question
has comment: http://stackoverflow.com/comment/45195279
has answer: http://stackoverflow.com/a/28432517
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28432517
score: 0
tagged with: google-maps
answer count: 1
favorite count: 0
type: AnsweredQuestion
has title: How to change color of google map
has body: I found something how to customize my googlemap enter link description here - but what I didnt find is -> you know for example option ROADMAP. here is map , on this mop is many colors like green, yellow etc. it is possible to make this map black and white or in Grayscale? Thanks
upvote count: 1
downvote count: 1

http://stackoverflow.com/q/28368764
accepted answer: http://stackoverflow.com/a/28369397
has body: I am using Google Place API to get suggestions of nearest position. I have managed to get the data from the server. I have a response from the server like this- { "predictions" : [ { "description" : "Australia", "id" : "3ba963f8de67dc16df0a8de60e46418338a3181a", "matched_substrings" : [ { "length" : 1, "offset" : 0 } ], "place_id" : "ChIJ38WHZwf9KysRUhNblaFnglM", "reference" : "CjQhAAAAlf04PlAgVJSzXXBUwZc0JGNjk5I9hsWHkvWwfuY_U4bkR3hm2lC4EN6fV4KOXr9PEhD5vhvmJOucMwDiwRaYJ0RAGhQofmdPwvnV4qHFefKAu0Anw110WQ", "terms" : [ { "offset" : 0, "value" : "Australia" } ], "types" : [ "country", "political", "geocode" ] }, { "description" : "Argentina", "id" : "dcaa0dffd352dfaaa3dc73dd1dbf3153708637ef", "matched_substrings" : [ { "length" : 1, "offset" : 0 } ], "place_id" : "ChIJZ8b99fXKvJURqA_wKpl3Lz0", "reference" : "CjQhAAAAO1RnJcq4Dky5uLQFHCULfP6VzbklXYCiR_DDuJMJxf5wFbTXVnHM7bn7ZSlxsR7IEhC_HlGxn8JeuC2h86S2EIpSGhRddclDM07Acre3NSiTWJoClMNtKQ", "terms" : [ { "offset" : 0, "value" : "Argentina" } ], "types" : [ "country", "political", "geocode" ] }, { "description" : "Austria", "id" : "e16f8e9f2a60f60a0881c41488ff3869e4f938a4", "matched_substrings" : [ { "length" : 1, "offset" : 0 } ], "place_id" : "ChIJfyqdJZsHbUcRr8Hk3XvUEhA", "reference" : "CiQfAAAAXX_lF6oxms4MgmajAkQabO3drGaCf04EHArvaGV3UTISEFulfBYy0rmrSxPIb1JLY_0aFJ2UqN170fR7OjOGAF3v3vZqO21i", "terms" : [ { "offset" : 0, "value" : "Austria" } ], "types" : [ "country", "political", "geocode" ] } ], "status" : "OK" } What I have done to get the data by parsing with jQuery is- $.ajax( { url: Auto_Complete_Link, type: "GET", dataType: 'jsonp', cache: false, crossDomain: true, /*data: JSON.stringify(somejson),*/ success: function (response) { $.each(response, function(i, field) { console.log(field + " &lt;=&gt; "+ i); }); }, error: function (xhr, status) { console.error("not connecting to google server"); } }); So the parsing part of the code is like it- $.each(response, function(i, field) { console.log(field + " &lt;=&gt; "+ i); …
tagged with: google-places-api
has comment: http://stackoverflow.com/comment/45078631
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45078840
has comment: http://stackoverflow.com/comment/45079168
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45078665
has comment: http://stackoverflow.com/comment/45079377
has title: Google Place API - jQuery JSON Persing of received Data
type: Question
tagged with: jsonp
has answer: http://stackoverflow.com/a/28369397
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45078901
score: 0
has comment: http://stackoverflow.com/comment/45078504

http://stackoverflow.com/a/28325055
answers question: http://stackoverflow.com/q/28324905
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/44997975
has comment: http://stackoverflow.com/comment/44998083
has body: You could use a setTimeout(); and clearTimeout();. I would suggest creating the timeout when you slide. var myTimeout = setTimeout(function(){ // Run your script here. }, 500 ); and then on your slide function, you would clear the timeout: clearTimeout( myTimeout ); This will basically cancel the ajax call if the slide action happens again within half a second (500 milliseconds). It would be best to not redeclare the timeout variable in the slide function. Maybe scope it to your object? https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers.clearTimeout http://www.w3schools.com/jsref/met_win_settimeout.asp //Hide the Tooltip at first tooltip.hide(); //Call the Slider slider.slider({ //Config range: "min", min: 1, value: 35, start: function(event,ui) { tooltip.fadeIn('fast'); }, //Slider Event slide: function(event, ui) { //When the slider is sliding var setVolume; clearTimeout( setVolume ); var value = slider.slider('value'), volume = $('.volume'); tooltip.css('left', value).text(ui.value); //Adjust the tooltip accordingly setVolume = setTimeout( function(){ $.ajax({ dataType: "text", type: "POST", url: '/setVolume/', data: { volume_to_set: ui.value}, success: function(data) { } }, 500 ); }); if(value &lt;= 5) { volume.css('background-position', '0 0'); } else if (value &lt;= 25) { volume.css('background-position', '0 -25px'); } else if (value &lt;= 75) { volume.css('background-position', '0 -50px'); } else { volume.css('background-position', '0 -75px'); }; }, stop: function(event,ui) { tooltip.fadeOut('fast'); }, });

http://stackoverflow.com/q/28379774
has title: Array, Get value and set in Variable
has body: I have a set of JavaScript arrays which are rendered dynamically. I want to get the data from the array one by one and want to assign that value to a variable. Here is my JavaScript code var count; for (count = 0; count &lt;= employee_yearly_sales.length; ++count) { var d2 = employee_yearly_sales[count]; console.log(d2); } var d1 = id, roundoff; // Here value come dynamically var d2 = id, roundoff; // Here value come dynamically var data1 = [ {label: created_by, data: d1} // Here value come dynamically for title {label: created_by, data: d2} // Here value come dynamically for title ]; Array Output [Object] 0: Object created_by: "1" id: "9" roundoff: "0.00" updated_at: "2014-11-13 10:33:46" [Object] 0: Object created_by: "2" id: "106" roundoff: "0.00" updated_at: "2014-11-13 10:33:46" How can I add values to a variable? Thanks. Here is PHP code, From where data come public function EmployeeYearlySales() { $data = array(); $res = $this-&gt;db-&gt;query("SELECT id, first_name, last_name FROM employees"); $result = $res-&gt;fetchAll(MDB2_FETCHMODE_ASSOC); foreach ($result as $item =&gt; $items) { $order = $this-&gt;db-&gt;query("SELECT distinct id, SUM(roundoff) AS roundoff,updated_at,created_by FROM orders WHERE created_by = " . $items['id']); $order_result = $order-&gt;fetchAll(MDB2_FETCHMODE_ASSOC); $data[] = $order_result; } var_dump($data); //exit; if ($result) { return $result; echo json_encode($result); } else return false; }
has comment: http://stackoverflow.com/comment/45099071
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/45099263
has answer: http://stackoverflow.com/a/28380053
type: Question
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/45099225
has comment: http://stackoverflow.com/comment/45099080
score: 0
has comment: http://stackoverflow.com/comment/45099270
answer count: 1

http://stackoverflow.com/comment/45143370
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28402944
has text: can I see the corresponding parts of code in `person-entry` controller and route?

http://stackoverflow.com/q/28398087
has answer: http://stackoverflow.com/a/28398262
possible better answer: http://stackoverflow.com/a/28398234
score: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: Turn the border color into the background color
has answer: http://stackoverflow.com/a/28398257
accepted answer: http://stackoverflow.com/a/28398257
has body: I've got a parent div with a background color. And inside that I've got a ul with lots of li's, each with a different color and each with a brighter border color. Now I want to copy the border color of the li, and use that as background for the parent div. I found this JQuery code, which copies the background color. It works, but I want the border color. $(document).ready(function(){ $("li.item").click(function(){ var bg = ['background-color',]; var $this = $(this); $.each(bg , function(item, value) { $("div.macbook-content").css(value, $this.css(value)); }); }); }); Does anybody know what to do?
has answer: http://stackoverflow.com/a/28398234
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28398492
tagged with: css
answer count: 4
type: AnsweredQuestion
upvote count: 1
downvote count: 1
type: Question

http://stackoverflow.com/comment/44962033
comment on: http://stackoverflow.com/q/28305242
score: 0
type: Comment
type: QuestionComment
has text: I'm stuck on this for 2 days! Still nothing.

http://stackoverflow.com/q/28297011
answer count: 1
tagged with: jquery
type: UnansweredQuestion
tagged with: php
type: Question
has title: my registration form captcha failed to stop when wrong captcha submitted
tagged with: javascript
tagged with: forms
score: 0
has answer: http://stackoverflow.com/a/28298190
has body: it is php register.php page <?php require_once 'config.php'; ?> <?php if(!empty($_POST)){ try { $user_obj = new Cl_User(); $data = $user_obj->registration( $_POST ); if($data)$success = USER_REGISTRATION_SUCCESS; } catch (Exception $e) { $error = $e->getMessage(); } } ?> Registration Form <!--[if lt IE 9]> <![endif]--> <?php require_once 'templates/header_content.php';?> <?php require_once 'templates/left_content.php';?> <?php require_once 'templates/message.php';?> Register <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" class="form-register" role="form" id="register-form"> Select Country Afghanistan Åland Islands Albania Algeria American Samoa Andorra Angola Anguilla Antarctica Antigua and Barbuda Argentina Armenia Aruba Australia Austria Azerbaijan Bahamas Bahrain Bangladesh Barbados Belarus Belgium Belize Benin Bermuda Bhutan Bolivia, Plurinational State of Bonaire, Sint Eustatius and Saba Bosnia and Herzegovina Botswana Bouvet Island Brazil British Indian Ocean Territory Brunei Darussalam Bulgaria Burkina Faso Burundi Cambodia Cameroon Canada Cape Verde Cayman Islands Central African Republic Chad Chile China Christmas Island Cocos (Keeling) Islands Colombia Comoros Congo Congo, the Democratic Republic of the Cook Islands Costa Rica Côte d'Ivoire Croatia Cuba Curaçao Cyprus Czech Republic Denmark Djibouti Dominica Dominican Republic Ecuador Egypt El Salvador Equatorial Guinea Eritrea Estonia Ethiopia Falkland Islands (Malvinas) Faroe Islands Fiji Finland France French Guiana French Polynesia French Southern Territories Gabon Gambia Georgia Germany Ghana Gibraltar Greece Greenland Grenada Guadeloupe Guam Guatemala Guernsey Guinea Guinea-Bissau Guyana Haiti Heard Island and McDonald Islands Holy See (Vatican City State) Honduras Hong Kong Hungary Iceland India Indonesia Iran, Islamic Republic of Iraq Ireland Isle of Man Israel Italy Jamaica Japan Jersey Jordan Kazakhstan Kenya Kiribati Korea, Democratic People's Republic of Korea, Republic of Kuw…

http://stackoverflow.com/comment/45114242
comment on: http://stackoverflow.com/q/28388268
has text: Changed the scroll to just 10px instead and still not working... The file is linked correctly as other stuff works.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28361644
has comment: http://stackoverflow.com/comment/45082278
score: 24
upvote count: 26
type: Answer
downvote count: 2
has body: Blobs appear to be limited to 500MiB in Chrome and are currently stored in memory, though a redesign is in progress: https://code.google.com/p/chromium/issues/detail?id=375297 Other browser implementations have slightly different limits: https://github.com/eligrey/FileSaver.js/#supported-browsers
has comment: http://stackoverflow.com/comment/88952269
answers question: http://stackoverflow.com/q/28307789

http://stackoverflow.com/a/28403858
has comment: http://stackoverflow.com/comment/45142645
score: 4
upvote count: 4
downvote count: 0
type: Answer
has body: Accessing Form Values for Radio Buttons You have to access the DOM and get the associated values for the corresponding form elements you're checking. Radio elements happen to require the most work, which is probably what's giving you trouble. Inside your getScore() function, you can cycle through each of the question elements to determine which answer is checked (this could be refactored to handle all of the questions and be more efficient, but I kept this basic form so you could see what's going on): var question0s = document.getElementsByName("question0"); for (var i = 0; i &lt; question0s.length; i++) { if (question0s[i].checked) { userInput[0] = question0s[i].value; } } Or, you could use the querySelector function for a more elegant approach: userInput[0] = document.querySelector('input[name="question0"]:checked').value; Here is a refactored version (which just means the code updated with improvements) of your getScore() function to handle all of the questions: function getScore(){ for (var i = 0; i &lt; answers.length; i++) { var currentQuestion = "question" + i; var questionAnswers = document.getElementsByName(currentQuestion); for (var j = 0; j &lt; questionResponses.length; j++) { if (questionResponses[i].checked) { userInput[i] = question0s[i].value; } } } // after this completes, you'll have the user input values // the rest of your code should now work for (var i=0;i&lt;numQuestions;i++){ if (userInput[i]==answers[i]){ score += 1; } else { score += 0; } } return score; } Improving (Refactoring) Your Code Now, what I've shown you should work, but it still has much room for improvement. Maybe you'll see some ways you save some steps and make it even better :) Have fun!
has comment: http://stackoverflow.com/comment/45142468
answers question: http://stackoverflow.com/q/28403558

http://stackoverflow.com/comment/45133735
comment on: http://stackoverflow.com/a/28399052
type: AnswerComment
score: 0
has text: And the options? Are the same for all scripts? Thanks!!
type: Comment

http://stackoverflow.com/comment/45037893
comment on: http://stackoverflow.com/a/28346597
type: AnswerComment
has text: Thanks so much! Is it possible to have it slowly fade out when your mouse goes off the link as well?
type: Comment
score: 0

http://stackoverflow.com/q/28293186
type: Question
has comment: http://stackoverflow.com/comment/44940331
score: 0
has comment: http://stackoverflow.com/comment/44939470
has comment: http://stackoverflow.com/comment/44939672
tagged with: asp.net-mvc-3
has comment: http://stackoverflow.com/comment/44941463
has comment: http://stackoverflow.com/comment/44941939
has comment: http://stackoverflow.com/comment/44939558
has comment: http://stackoverflow.com/comment/44939513
has comment: http://stackoverflow.com/comment/44939313
has comment: http://stackoverflow.com/comment/44939547
has comment: http://stackoverflow.com/comment/44941662
answer count: 0
has title: html code in javascript not getting the id to open to another window
tagged with: javascript
has comment: http://stackoverflow.com/comment/44940375
type: UnansweredQuestion
tagged with: jquery
has comment: http://stackoverflow.com/comment/44939413
has comment: http://stackoverflow.com/comment/44939239
has body: I have a html inside a javascript. My problem is I cant call the id in my html code. Can someone help me with this? My code: I'm using ttwnotificationmenu.js from www.codebasehero.com. So my problem is getting the id in the html code hope someone will help me with this.
has comment: http://stackoverflow.com/comment/44940891
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28331689
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28332482
has body: I have an advertiser website which I am trying to open inside an iframe. (unfortunately i cant provide you with the url) but instead of opening inside an iframe it loads up the url in the same tab. <script src="<?php echo site_url('public/scripts/core/jquery-1.11.0.min.js');?>"> <script src="<?php echo site_url("public/scripts/core/core.js");?>"> <?php echo $user_id." ".$offer_id;?> Any suggestions will be helpful Thank you in advance
score: 0
has comment: http://stackoverflow.com/comment/45010522
tagged with: iframe
answer count: 3
has answer: http://stackoverflow.com/a/28332543
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28332796
has comment: http://stackoverflow.com/comment/45010587
has comment: http://stackoverflow.com/comment/45011777
tagged with: jquery
has title: iframe url is opening in current window instead of iframe
type: Question

http://stackoverflow.com/comment/45121794
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28380301
has text: @Scar: If you're decoding something from a URI, you use `decodeURIComponent`, not `replace`.

http://stackoverflow.com/a/28345289
score: 2
downvote count: 0
has body: Just use @ViewBag.VideoUrl in file and .mp4 should be in videoUrl. Works fine for me, and dont forget to use securetoken for security :-) $(document).ready(function () { jwplayer('mediaplayer').setup({ 'file': 'rtmp://872083564.r.cdnsun.net/872083564/_definst_/ mp4:872083564/@ViewBag.VideoUrl', 'title': 'Title', 'description': 'Description', 'controlbar': 'bottom', rtmp: { securetoken: "some generated key" }, }); });
answers question: http://stackoverflow.com/q/28321105
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/45035692

http://stackoverflow.com/a/28315452
upvote count: 5
accepted answer of: http://stackoverflow.com/q/28315322
has comment: http://stackoverflow.com/comment/44980361
has comment: http://stackoverflow.com/comment/44980543
has comment: http://stackoverflow.com/comment/44980611
answers question: http://stackoverflow.com/q/28315322
has comment: http://stackoverflow.com/comment/44980388
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44980532
type: Answer
has comment: http://stackoverflow.com/comment/44983944
has body: Because you are returning your own objects from the constructor functions, you have to do a little more plumbing. //Call to super constructor this.parent.constructor.call(this, arguments); returns the public API of SuperClass but you are not doing anything with the result. You'd have to merge it into the child's public API: //Call to super constructor var parentAPI = this.parent.constructor.call(this, arguments); //Public function for childClass. return Object.assign(parentAPI, { childPublicFunction: function() { //function implementation } }); Assigning to childClass.prototype is actually irrelevant in your case, because the object you return from the constructors doesn't inherit from it anyway. I.e. childObj won't have any of the properties you assigned to the prototype (such as parent). There are even more things you miss out by returning your own object, such as being able to use instanceOf (childObj instanceOf childClass will be false). To make that all of that work you have to assign the methods to this inside the constructor (instead of returning an object). You can find more information about that style of OOP in the MDN documentation. Note: It is convention to start the names of constructor functions with a capital letter, i.e. ChildClass.
has comment: http://stackoverflow.com/comment/44995107
score: 5

http://stackoverflow.com/comment/74831198
score: 0
has text: This answer helped me solve a similar problem. I was using javascript's ondrag, ondragover and ondragstart. When I dropped draggable elements on top of other draggable elements the element just disappeared. The solution was to replace the inline event listeners as mentioned in the above answer. Thanks.
type: Comment
comment on: http://stackoverflow.com/a/28380886
type: AnswerComment

http://stackoverflow.com/a/28435718
has comment: http://stackoverflow.com/comment/45234207
score: -1
type: AcceptedAnswer
downvote count: 1
has comment: http://stackoverflow.com/comment/45237387
has comment: http://stackoverflow.com/comment/45228810
type: Answer
answers question: http://stackoverflow.com/q/28430553
upvote count: 0
has body: I don't believe that the Icon object has a fillColor property. I think you just have to provide a separate marker SVG for each colour variant you want to use. https://developers.google.com/maps/documentation/javascript/reference#Icon
accepted answer of: http://stackoverflow.com/q/28430553

http://stackoverflow.com/a/28911694
answers question: http://stackoverflow.com/q/28282385
has comment: http://stackoverflow.com/comment/99758391
downvote count: 0
has body: Firefox does support a subset of constraints with getUserMedia(), but not the outdated syntax that Chrome and Opera are using. The mandatory / optional syntax was deprecated years ago, and minWidth and minHeight the year before that. The MediaCapture specification According to the specification, which is now stable, your example should be written like this: var constraints = { audio: false, video: { width: { min: 1280 }, height: { min: 720 }, } }; This works in Firefox (and Chrome with adapter.js): https://jsfiddle.net/34qxx5w1 In the specification, the keywords min, max, and exact (a.k.a. min == max) are inherently mandatory, whereas plain values and ideal are not. Here's a fuller example: var constraints = { audio: false, video: { width: { min: 1024, ideal: 1280, max: 1920 }, height: { min: 576, ideal: 720, max: 1080 }, } }; This works in Firefox (and Chrome with the adapter.js polyfill in straightforward cases). An ideal value, when used, has gravity, which means that the browser will try to find the setting (and camera, if you have more than one), with the smallest fitness distance from the ideal values given. Plain values are inherently ideal, which means that: var constraints = { video: { width: 640, height: 480 } }; is the same as: var constraints = { video: { width: { ideal: 640 }, height: { ideal: 480 } } }; In other words, a preference that getUserMedia() will try to honor, but never fail over. If you must have a specific resolution, use this shorthand: var constraints = { video: { width: { exact: 640 }, height: { exact: 480 } } }; Firefox As of right now, width, height, frameRate and (on mobile) facingMode are supported in Firefox. Also, some caveats by version: FF32-37: Plain values and ideal are not supported. However, values are not mandatory unless you add a non-spec require keyword. FF38+: Implements the spec for the above constraints. Improved handling of Mac cameras (though frameRate has limitations on Mac). FF43+: Implements MediaStreamTrack.apply…
type: Answer
upvote count: 34
has comment: http://stackoverflow.com/comment/49483078
score: 34

http://stackoverflow.com/comment/44962319
has text: A quick guess would be that localStorage and cookies are not allowed while using private browsing, which are required for firebase auth.
type: AnswerComment
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28285514

http://stackoverflow.com/comment/45124285
score: 0
has text: Clicking the submit input submits the FORM, not clear what are you expecting here?!
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28393835

http://stackoverflow.com/comment/47579368
score: 0
has text: I just noticed that you can just use toGo += box.outerHeight(true), instead of the two lines adding the margin and then the height.
type: Comment
comment on: http://stackoverflow.com/a/29722505
type: AnswerComment

http://stackoverflow.com/comment/44927688
score: 0
type: AnswerComment
has text: I've included the following into the ViewModel: `var EditorViewModel = function () { var self = this; self.addData = function (_data) { var mapping = { key: function (i) { return ko.utils.unwrapObservable(i.id); } } ko.mapping.fromJS(_data, mapping, self); }; self.isUpdate = ko.computed(function () { return self.id() !== 0; }, self, { deferEvaluation: true }); };` The problem remains the same though - the view isn't being updated. :(
comment on: http://stackoverflow.com/a/28284778
type: Comment

http://stackoverflow.com/a/28342029
has body: The reason is you are using only one collection for the both the Views. initially app1 is created and in initialize you fetched collection and the trigger event is listened only by app1 Now the second view is created and the collection is fetched again, but now the reset event fired by collection is listened in both app1 and app2 and both are rendered To solve this problem you can fetch the collection only once after both the views are initialized. working fiddle
answers question: http://stackoverflow.com/q/28341608
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/45032331
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28341608

http://stackoverflow.com/a/28437360
has body: You need these 3 changes: 1) add $scope as a parameter in your controller function MyTempControllers.controller('tempController', ['$scope', function ($scope) { ... }]); 2. Change controller: 'controllers/tempController' to controller: 'tempController' FYI, the naming convention for a controller is to begin with a capital letter for Controller. 3. In addition, you should add a .otherwise({ template: templates/temp.html, controller: 'tempController' }); so that when no route matches, it goes to default-page-name.html. This is what's happening in your case, when you first load the page, no route matches. If you want to see temp.html, you have to 1) either click on a link that goes to #/Holdings, or 2) use '/Holdings' as the "otherwise" route, as indicated above.
answers question: http://stackoverflow.com/q/28436824
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/45204869
accepted answer of: http://stackoverflow.com/q/28436824
has comment: http://stackoverflow.com/comment/45205749
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28345745
answer count: 2
tagged with: google-maps
has answer: http://stackoverflow.com/a/28361089
accepted answer: http://stackoverflow.com/a/28345838
tagged with: javascript
tagged with: jquery
tagged with: google-maps-api-3
score: 0
has answer: http://stackoverflow.com/a/28345838
possible better answer: http://stackoverflow.com/a/28361089
has body: I have the following code setup to apply a map for a variety of areas var locations = [ ['Liver Office - Liverpool Office', 53.40529, -2.988801, 1], ['Lond office - London Office', 51.515026, -0.086811, 2], ]; function plotMap(loc) { var mapOptions = { zoom: 17, center: new google.maps.LatLng((locations[loc][1]), (locations[loc][2])), stylers: [ { saturation: -100 } // &lt;-- THIS ] }; var map = new google.maps.Map(document.getElementById('map'), mapOptions); var marker = new google.maps.Marker({ position: map.getCenter(), map: map, mapTypeControlOptions: { mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'tehgrayz'] }, icon: 'marketICO.png', title: (locations[loc][0]) }); var infowindow = new google.maps.InfoWindow(); google.maps.event.addListener(marker, 'click', (function(marker) { return function() { infowindow.setContent(locations[loc][0]); infowindow.open(map, marker); } })(marker, loc)); } $('.livLink').click(function(){ plotMap(0); }); $('.lonLink').click(function(){ plotMap(1); }); plotMap(0); Regarding reloading the map - at the moment the above script is triggered by 2 tab buttons - if a map is loaded and the second button is clicked the script re-runs and replaces the existing map - I'm just thinking of memory issues - should the initial map instance be stopped before loading a second?
type: AnsweredQuestion
has title: Google Maps - Map reload
has comment: http://stackoverflow.com/comment/54359006
linked to: http://stackoverflow.com/q/17264989
type: Question

loops
tags question: http://stackoverflow.com/q/28371079
tags question: http://stackoverflow.com/q/28303443
tags question: http://stackoverflow.com/q/28401100
type: Tag
tags question: http://stackoverflow.com/q/28375037
tags question: http://stackoverflow.com/q/28376903
tags question: http://stackoverflow.com/q/28388690
tags question: http://stackoverflow.com/q/28313251
tags question: http://stackoverflow.com/q/28399317
tags question: http://stackoverflow.com/q/28403085
tag name: loops
tags question: http://stackoverflow.com/q/28401119
tags question: http://stackoverflow.com/q/28398429
tags question: http://stackoverflow.com/q/28329491
tags question: http://stackoverflow.com/q/28286899
tags question: http://stackoverflow.com/q/28365567

http://stackoverflow.com/comment/45045420
type: Comment
has text: Thanks. I like the simplicity of it and this was somewhat close to mine. Question, why do you have to select an id? Why doesn't it work if you just use the DOM until you get to that element?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28335449

http://stackoverflow.com/comment/45175713
score: 0
has text: this is the correct answer, i bet there is a more elegant way to fix this but this works for now thnx :)
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28420496

http://stackoverflow.com/comment/44929598
type: Comment
comment on: http://stackoverflow.com/a/28287642
has text: I've updated question with empty jQuery result case.
type: AnswerComment
score: 0

http://stackoverflow.com/a/28289765
downvote count: 0
has body: You can use ref to access DOM node: var PlayerSelect = React.createClass({ getInitialState: function() { return { names: [] } }, getPlayers: function(event) { event.preventDefault(); var playerNames = [] for (var i = 0; i < this.props.numPlayers; i++) { var playerName = this.refs['player-' + i].getDOMNode().value.trim(); playerNames.push(playerName); } this.setState({ names: playerNames }); }, render: function() { var players = [] for (var i = 0; i < this.props.numPlayers; i++) { players.push( ); } return ( {players} Done { this.state.names.join(', ') } ); } }); JSFiddle Also remember: when you create array of elements every single one has to have unique key don't modify props of your component to communicate with outside modules. Use some other library which provides models to communicate between components, for example Backbone or Flux ( in my example for simplicity I just saved collected player names to components state ).
type: Answer
accepted answer of: http://stackoverflow.com/q/28289000
upvote count: 4
answers question: http://stackoverflow.com/q/28289000
type: AcceptedAnswer
score: 4

http://stackoverflow.com/q/28286864
has comment: http://stackoverflow.com/comment/44928796
type: UnansweredQuestion
has title: refresh jquery data constantly
has comment: http://stackoverflow.com/comment/44928726
has comment: http://stackoverflow.com/comment/44928335
has comment: http://stackoverflow.com/comment/44931564
score: 0
upvote count: 1
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28287007
has comment: http://stackoverflow.com/comment/44928739
has comment: http://stackoverflow.com/comment/44928685
tagged with: javascript
tagged with: jquery
has body: i have this code &lt;script type="text/javascript"&gt; var scheduled = $("select").filter(function() { return $(this).val() == "&lt;%=pempidw%&gt;"; }); document.write(scheduled.length); &lt;/script&gt; and it is working with counting the amount of times a certain item is selected. however, it only works and counts properly if i refresh the page after options are changed. i need a way for this to constantly refresh or be "live" so if it was to auto refresh every second, everytime something is changed in the page it would reflect correctly. I know how to do a full page autorefresh and no I don't want that.
answer count: 1
favorite count: 0

http://stackoverflow.com/comment/45113107
has text: FYI, preconditioning can be done on a copy of the data if you don't want to change the original. IMO, preconditioning leads to the simplest use of the data. You combine all your code in one place that fixes up a copy of the data structure to make sure that everything you plan to reference exists at least in some default condition.
score: 0
comment on: http://stackoverflow.com/a/28387661
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45125293
type: Comment
has text: You got an answer in suggestion.
type: AnswerComment
comment on: http://stackoverflow.com/a/28394274
score: 0

http://stackoverflow.com/q/28405410
tagged with: heroku
score: 3
has comment: http://stackoverflow.com/comment/45145217
has body: For analytics, I save three pieces of data into a MongoDB database: hour: moment().startOf('hour').toDate() day: moment().startOf('day').toDate() month: moment().startOf('month').toDate() The hour and the month are correct, however the day is sometimes 1 day behind like in the example below, why? hour: 2015-02-09 08:00:00.000Z day: 2015-02-08 00:00:00.000Z month: 2015-02-01 00:00:00.000Z
has comment: http://stackoverflow.com/comment/45163957
tagged with: mongodb
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45145838
has title: moment().startOf('day').toDate() Shows Yesterday's Date, Why?
tagged with: momentjs
answer count: 0
upvote count: 3
type: UnansweredQuestion
type: Question

http://stackoverflow.com/comment/61011411
score: 0
type: Comment
has text: Short but sweet explanation. Gre8 :)
comment on: http://stackoverflow.com/a/28422790
type: AnswerComment

http://stackoverflow.com/q/28291202
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/44935924
has title: Having trouble adding java to HTML, What am I missing?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44935877
has comment: http://stackoverflow.com/comment/44935960
has comment: http://stackoverflow.com/comment/44936008
has body: Trying to do something simple here. I'm a beginner so this is all kind of new. The code works in JSFiddle but if I save it as a .html file and attempt to upload it/open it the script no longer works. Jquery script im trying to use - $('#getdata').on('click', function () { var formCategory = $('#categories').val(); var formAddress = $('#address').val(); var formTown = $('#town').val(); var formInfo = $('#info').val(); $('#form_Alert').val('' + formTown + ' |' + formCategory + '| ' + formAddress + ' ' + formInfo); }); What it's looking like when I'm adding it to HTML <!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Strict//EN" <Title>BNN CAD Town: Dundalk Edgemere Sparrows Point Essex Middle River Cockeysville Parkville White Marsh Woodlawn Lansdowne Catonsville Arbutus Monkton Sparks Incident Type: SHOOTING STABBING ARMED ROBBERY ROBBERY SERIOUS ASSAULT HOME INVASION Address: Details: Alert:
has comment: http://stackoverflow.com/comment/44935824
type: Question
has comment: http://stackoverflow.com/comment/44935795
has answer: http://stackoverflow.com/a/28291236
has comment: http://stackoverflow.com/comment/44936087
has comment: http://stackoverflow.com/comment/44935843
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/44935844

http://stackoverflow.com/q/28371865
type: AnsweredQuestion
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28371956
has title: Simple way to randomly choose the name of a JavaScript file from a list of possible names
has body: I have 170 HTML5 animations that need to be cycled randomly when a page loads. I figure the easiest thing to do is randomly choose the JavaScript file name for the animation. Can someone outline easiest way of doing that? Thanks in advance. EDIT: I realise that maybe the language I'm using is wrong - am learning as I go. What I want to do is set the SRC attribute in a SCRIPT tag randomly from a list of 170 filenames. So far, I've gleaned that it should be something like this, &lt;!--[if !IE]&gt;--&gt;&lt;script id="animation" src="" type="text/javascript"&gt; &lt;/script&gt; &lt;!--&lt;![endif]--&gt; &lt;script type="text/javascript"&gt; //Files var filesArray = ['file1.js', 'file2.js']; //src vars var url = 'http://www.example.com/'; // Shuffle var file = musicArray[Math.floor(Math.random() * myArray.length)]; //Set src getElementById("animation").src = url + file; &lt;/script&gt; But that's not working for me. Is it even possible to set the SRC attribute in this way?
answer count: 1
tagged with: arrays
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28371956
tagged with: google-swiffy

http://stackoverflow.com/comment/45086745
has text: `$().ready(function () {...}` is the same as `$(documenet).ready(function(){...}` - why should the OP change the shorter form to the longer one?
type: Comment
comment on: http://stackoverflow.com/a/28373127
score: 1
type: AnswerComment

google-maps-api-3
tags question: http://stackoverflow.com/q/28291144
tags question: http://stackoverflow.com/q/28298449
tags question: http://stackoverflow.com/q/28415101
tags question: http://stackoverflow.com/q/28309739
tags question: http://stackoverflow.com/q/28356959
tags question: http://stackoverflow.com/q/28297179
tags question: http://stackoverflow.com/q/28287636
tags question: http://stackoverflow.com/q/28371976
tags question: http://stackoverflow.com/q/28413474
tags question: http://stackoverflow.com/q/28293582
tags question: http://stackoverflow.com/q/28373032
tags question: http://stackoverflow.com/q/28350598
tags question: http://stackoverflow.com/q/28288367
tags question: http://stackoverflow.com/q/28367048
tags question: http://stackoverflow.com/q/28348539
tags question: http://stackoverflow.com/q/28302147
tags question: http://stackoverflow.com/q/28352047
tags question: http://stackoverflow.com/q/28288660
tags question: http://stackoverflow.com/q/28321525
tags question: http://stackoverflow.com/q/28338260
tags question: http://stackoverflow.com/q/28323559
tags question: http://stackoverflow.com/q/28399690
tags question: http://stackoverflow.com/q/28345745
tags question: http://stackoverflow.com/q/28420421
tag name: google-maps-api-3
type: Tag
tags question: http://stackoverflow.com/q/28404774
tags question: http://stackoverflow.com/q/28385983
tags question: http://stackoverflow.com/q/28335912
tags question: http://stackoverflow.com/q/28404179
tags question: http://stackoverflow.com/q/28345336
tags question: http://stackoverflow.com/q/28280738
tags question: http://stackoverflow.com/q/28385281
tags question: http://stackoverflow.com/q/28339217
tags question: http://stackoverflow.com/q/28398250
tags question: http://stackoverflow.com/q/28357187
tags question: http://stackoverflow.com/q/28340344
tags question: http://stackoverflow.com/q/28413791
tags question: http://stackoverflow.com/q/28425150
tags question: http://stackoverflow.com/q/28398881
tags question: http://stackoverflow.com/q/28300539

http://stackoverflow.com/a/28418177
has body: Yes; that is completely correct.
answers question: http://stackoverflow.com/q/28418112
type: AcceptedAnswer
downvote count: 0
upvote count: 1
type: Answer
score: 1
accepted answer of: http://stackoverflow.com/q/28418112

http://stackoverflow.com/comment/55697013
type: Comment
has text: Downvoted, see above.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28428245

http://stackoverflow.com/q/28429175
tagged with: mysql
has title: Magento: How to set VAT attribute
downvote count: 1
type: Question
tagged with: magento
tagged with: javascript
score: -1
upvote count: 0
answer count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has body: i am new to this magento world and stuck in a problem. i need to create a attribute rule which can add 20% in all prices by default. in fact i created 1 rule with name "standard VAT" in sales> Tax> Manage Tax rule. but by default magento is using "none" in Product > Price > Tax Class. how can we make magento use tax attribute "Standard VAT" by default? i know one way is by selecting all products and editing attribute, but that is not the solution, if we go this route we have to apply edit it every minute. as our listing updates every 30 minute. we need a 1 time solution please, all our newly add products and existing products can auto use that attribute. if you know any way we can edit any file in magento please advise us with full file path, code to add and line number. Thank you for your help in advance.
has comment: http://stackoverflow.com/comment/45189507
has answer: http://stackoverflow.com/a/28452570

http://stackoverflow.com/a/28348765
score: 0
has comment: http://stackoverflow.com/comment/45044109
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45044875
type: Answer
has body: youre way was correct. just put it in an if statement and set the number of the length. var childLimiter = 2; var listItems = $('ol').children('li').length; if(listItems <= childLimiter){ $(this).parent().append(' child node '); } else { $(this).parent().append(' child node '); } see updated fiddle greetings timotheus
accepted answer of: http://stackoverflow.com/q/28348537
has comment: http://stackoverflow.com/comment/45046110
answers question: http://stackoverflow.com/q/28348537

http://stackoverflow.com/comment/45175683
comment on: http://stackoverflow.com/a/28408657
score: 0
type: AnswerComment
has text: Thats because those are in the array... The snippet is a proof of concept, showing that it creates an array of urls and then prints, waits, prints... Wrince and repeat. It shows that it works. I cant do iframes here and i have no urls to load in them. Please try to understand the code as i cannot explain it any more than i did. Good luck.
type: Comment

http://stackoverflow.com/comment/128525813
type: Comment
has text: If you output the `event.target` when the event fires you'll see the first event is for the div and the second is for the img. If you specified ".item img" for your event selector it will only fire once.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28343140

http://stackoverflow.com/a/28351009
has comment: http://stackoverflow.com/comment/45069494
downvote count: 0
has comment: http://stackoverflow.com/comment/45068308
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28350619
has body: Take a look at Angular's docs for routeProvider, as this should clear up some of your confusion. I think what you want to do here is use an existing route in your .otherwise, because since /other isn't defined anywhere, Angular won't know what do you with it: var app = angular.module('app', ['ngRoute', 'ngResource']); app.config(function config($routeProvider) { $routeProvider .when('/', { templateUrl: '../templates/main/index.html' }) .when('/login', { templateUrl: '../templates/main/login/login.html' }) .otherwise({ redirectTo: '/' }); }); I believe this should give you the effect you're looking for. Obviously you can tweak it as you see fit, if for example you wanted to have a 404 route/template for anything that you don't define. As it stands, this will always fall back to the homepage for a particular route that doesn't exist. This gets more complicated when you're considering users and logged in/out states, but this is more of a proof-of-concept. Additionally, ngRoute will render by default a URL in the format of /#/foo since that is using a hashbang-style format, which enables crawlers for search engines to be able to parse and read the various pages/states of a JavaScript webpp. What you're referring to is a document fragment, which are not indexable by crawlers. You can read more about the differences on Google's Webmaster docs.

http://stackoverflow.com/q/28435383
has comment: http://stackoverflow.com/comment/45219329
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: associations
has body: I have following models: Comment.js module.exports = { attributes: { id : { type : 'integer', primaryKey : true }, objectId : { type : 'string', required : true }, comment : { type : 'string', required : true } } }; Image.js and Video.js are the same: module.exports = { attributes: { id : { type : 'integer', primaryKey : true }, name : { type: 'string' }, comments : { collection : 'comment', via : 'objectId' } } }; When i try populate comments with Video or Image model array is always empty (some comments are inserted for both).. Image.find({id: 1}).populate('comments').exec(function(err, image) { console.log(image); }); Or this... Video.find({id: 1}).populate('comments').exec(function(err, video) { console.log(video); }); I want to separate video and image models, and for comments i want use combined table. Tnx
tagged with: model
has title: Sails multiple models associate
has answer: http://stackoverflow.com/a/28436089
type: UnansweredQuestion
upvote count: 1
tagged with: sails.js
score: 1
tagged with: populate
type: Question

http://stackoverflow.com/q/28308493
has comment: http://stackoverflow.com/comment/44968464
answer count: 0
has body: I am trying to render the contacts list after retrieving it thru rdflib.js. It is loading properly and saving it in the list inside the scope. It does recognize the number of items in the list, but I am not able to render the values since the $scope doesn't update, it seems like I am calling $scope.apply() in the wrong place. It seems it is because I call it outside angular, but I am deliberately calling it inside the function that is outside angular context (nowOrWhenFetched), so not making sense for me. any help? $scope.load = function () { //$scope.getContactsList(); var g = $rdf.graph(); var f = $rdf.fetcher(g); f.nowOrWhenFetched($scope.path + '*',undefined,function(){ var DC = $rdf.Namespace('http://purl.org/dc/elements/1.1/'); var RDF = $rdf.Namespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#'); var LDP = $rdf.Namespace('http://www.w3.org/ns/ldp#'); //var myOntology = $rdf.Namespace('http://user.pds.org/ontology/'); var VCARD = $rdf.Namespace('http://www.w3.org/2006/vcard/ns#'); var evs = g.statementsMatching(undefined, RDF('type'), VCARD('Individual')); if (evs != undefined) { for (var e in evs) { var id = evs[e]['subject']['value']; var fullname = g.anyStatementMatching(evs[e]['subject'], VCARD('fn'))['object']['value']; var email = g.anyStatementMatching(evs[e]['subject'], VCARD('hasEmail'))['object']['value']; var phone = g.anyStatementMatching(evs[e]['subject'], VCARD('hasTelephone'))['object']['value']; var contact = { id: id.slice(id.length-1), Name: fullname, Email: email, Phone: phone }; $scope.contacts.push(contact); } } $scope.apply(); }); }; Thanks.
has comment: http://stackoverflow.com/comment/44968155
has comment: http://stackoverflow.com/comment/44968225
upvote count: 1
type: Question
tagged with: javascript
downvote count: 0
has comment: http://stackoverflow.com/comment/44968765
score: 1
has title: Angular not rendering the view
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44968277

http://stackoverflow.com/comment/44970655
has text: my problem is get current scroll position
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28309754
score: 0

http://stackoverflow.com/comment/45034863
comment on: http://stackoverflow.com/q/28327032
type: QuestionComment
has text: theyre just files in the same directory. I presume theyre valid JSON as when i run them on their own it works, as in, run them the first time. But when I go back to the first JSON file, (as in call the function again with the starting JSON file) it comes up with an error.
type: Comment
score: 0

sencha-touch-2.1
tag name: sencha-touch-2.1
tags question: http://stackoverflow.com/q/28396760
type: Tag

http://stackoverflow.com/q/28350198
has title: Hapijs TypeError: string is not a function when trying to render a view
score: 0
has body: I've been looking for a few hours and cant find and answer to why I'm getting this error. When I try to render the view file, I'm getting the error "string is not a function" Server var dust = require("dustjs-linkedin"); var Hapi = require('hapi'); var app = new Hapi.Server({ connections: { routes: { files: { relativeTo: path.join(__dirname, 'public') } } } }); app.views({ engines: { dust: dust }, relativeTo: __dirname, path: 'views' }); Index.js var path = require('path'); var Tv = require('tv'); var app = require(path.join(__dirname, 'server')); app.connection({ port: process.env.PORT || 80 }); //hapi app.register(Tv, function (err) { if (!err) { app.start(function () { console.log("Hapi started and listening on port: " + app.info.port); }); } }); //we load all the routes here var routesLoader = require(path.join(__dirname, 'lib/routesLoader')); routesLoader(app, path.join(__dirname, 'routes')); Entry part of route file app.route([{ method: 'GET', path: '/{siteid}/admin', handler: function (req, res) { SettingsManager.readSettingsFile().then(function (settings) { var siteId = req.params.siteid; res.state("x-site-id", siteId); var adminData = {siteId: siteId}; for (var i in settings) { adminData[i] = settings[i].toString(); } //console.log(adminData); res.view('admin/admin-menu', adminData); }, function (err) { console.log(err); }); }]);
answer count: 0
type: UnansweredQuestion
tagged with: node.js
has comment: http://stackoverflow.com/comment/45048380
has comment: http://stackoverflow.com/comment/45049182
type: Question
tagged with: hapi.js
tagged with: javascript

http://stackoverflow.com/q/28364419
score: 0
has comment: http://stackoverflow.com/comment/45141224
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45141302
has comment: http://stackoverflow.com/comment/45141490
has title: Grunt set option for task and run that task using new value
tagged with: gruntjs
type: Question
has comment: http://stackoverflow.com/comment/45379318
answer count: 1
has body: I have Grunt build automation added in my project. I have created one custom task which sets a variable for other task and now I want to run the task using the value I set. grunt.registerTask('dist-flow', function () { if (!grunt.option('env')) { grunt.option('env', 'prod'); console.log(grunt.option('env')); } grunt.registerTask('dist',['dev_prod_switch']); grunt.task.run('distdev'); }); But whenever I run the dist-flow task it will set env to prod but dev_prod_switch always take default value which I set for dev_prod_switch. So I want set the options from task and run specific task using that new value.
tagged with: javascript
has comment: http://stackoverflow.com/comment/45141469
tagged with: build-process
favorite count: 0
has answer: http://stackoverflow.com/a/28403431
has comment: http://stackoverflow.com/comment/45141620

http://stackoverflow.com/comment/45118803
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28390496
has text: @AdibBehjat I have tested it completely along the way and the first few statements work i'm just not sure what's going wrong after.
score: 0

http://stackoverflow.com/q/28420117
score: 1
type: Question
has comment: http://stackoverflow.com/comment/45182378
tagged with: asp.net-mvc
has title: User.Identity.Name is empty on Safari browsers
tagged with: javascript
has comment: http://stackoverflow.com/comment/45208786
answer count: 1
downvote count: 0
tagged with: asp.net-web-api
has body: Good morning. we currently have a MVC 5 application on asp.net 4.5.1, that we are aiming to be used on the mobile browsers. we are using some ajax calls to fill some drop downs on the View, however since those API calls are using the logged on user, the server is rejecting the call from safari. This is evident on iphone safari, but not on iphone chrome. The controller side looks like this [HttpGet] [Route("API/Account/Dependents/{idPlusType}")] public IHttpActionResult GetUserOrDependantInfo(string idPlusType) { ... string loggedOnUser = User.Identity.Name; } It is this part what is coming back as string.empty my client side is a simple ajax to a .get $.ajax({ url: path, dataType: "json", type: "GET", contentType: 'application/json; charset=utf-8', success: function (d) { -- Rest } } Now fiddler show very similar request. One the one from chrome is serviced correctly. The one from safari it is not. Fiddler request for safari from a iphone Cookie:.ASPXAUTH=0530DF01D09167C311032C3A6A258D24C20A9189FC8ACE76239016815047D4FEB5FCDDAED04E7FBCA41763388B1C655987732203CFD77D4B76C1EC3200ACCC26F61151BA77F4B6C3745C20D1D70369677814BB2A;__RequestVerificationToken_L2V6VmVyaWZ5MTIzTUhB0=Vb_TYkr-Begl4fv4JulkokhM24VFZjXjt_gHdsmz3ckfkKbBJu8YmNJcghafJ8_0Edn0Lb9SopXA7Di4fKZm6uV1AOM1;__RequestVerificationToken_L2V6VmVyaWZ5MTIzTUhBVGVzdA2=_sxROjMA7jW8PbluEKtzEOAbdJfpBDpYRWJLhwR6SDlX10UA7m7FU-6xezerP73HyqeLqrmqdYfwQfLftIhwqr5Fs0w1; ASP.NET_SessionId=dbh0kje3unlap545zeuvld31 now Chrome from the same iphone. Cookie:ASP.NET_SessionId=qgbcybtzvw2sxaa3w1yphu1z;__RequestVerificationToken_L2V6VmVyaWZ5MTIzTUhBVGVzdA2=v7ZBYrFtmg1GuuETKlIubWKr7T4Rddt1I40f9i56LzmQDI1svaw6qpk4hpuZqm_12ltrEkak9GewyhXU1rX0gQCiMvg1;__RequestVerificationToken_L2V6VmVyaWZ5MTIzTUhB0=NkM3pLoBJeYd2MTMKXwrh7dFY7uQYLGbzVN9nPy-ai7oNdmPXoxbI8Z6Xc0SGkVS3IxY-gmTTzD6m_eu2tKNjOA46jU1;.ASPXAUTH=2CBEC21CF8A3EDD3A4C6870FF4D68F16536C4CA9D87634CA4EB817589140EC85B8967C8A2F4ACAD8CF52FAAD5E4488F2210C6B75CCF55412CFA6F6ADD66323DB5072CD3622092865…
tagged with: asp.net
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45175767
upvote count: 1
tagged with: safari
has answer: http://stackoverflow.com/a/28504458

http://stackoverflow.com/comment/44969814
has text: Still only works when clicking on a computer, wont work on iPad still.
comment on: http://stackoverflow.com/a/28291877
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28332825
has comment: http://stackoverflow.com/comment/45013110
score: 0
has comment: http://stackoverflow.com/comment/45012867
has body: In test1.html test2.html Input hidden test 2
has comment: http://stackoverflow.com/comment/45012692
has comment: http://stackoverflow.com/comment/45013446
has comment: http://stackoverflow.com/comment/45014039
has comment: http://stackoverflow.com/comment/45012926
has comment: http://stackoverflow.com/comment/45012789
has comment: http://stackoverflow.com/comment/45013900
type: Answer
has comment: http://stackoverflow.com/comment/45013547
has comment: http://stackoverflow.com/comment/45013243
answers question: http://stackoverflow.com/q/28332245
has comment: http://stackoverflow.com/comment/45013852
has comment: http://stackoverflow.com/comment/45013778
has comment: http://stackoverflow.com/comment/45014349

http://stackoverflow.com/q/28324309
tagged with: vbscript
has answer: http://stackoverflow.com/a/28337051
tagged with: browser
answer count: 2
has comment: http://stackoverflow.com/comment/45000030
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45017245
favorite count: 0
has title: Close Internet Explorer Programmatically
tagged with: http://stackoverflow.com/tag/html
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/44996844
type: UnansweredQuestion
has body: Is there any way IE can be closed programmatically? I am trying to build a simple login system for the school I am working at in which a pupil would sign in using a HTML form and when they click the submit button the window will close automatically. I have tried this using JavaScript (close() seems to be redundant now), VBScript (.Quit) and trying to run a .cmd file to close it externally (Windows Script Host). None of these have worked. I am not doing this maliciously and I have absolutely no bad intentions of using this code. I understand that it is a universal standard for web browsers not to be closed by client/server side scripts. But, I am, nonetheless, wondering whether this would be possible and how (preferably without installing any other applications).
type: Question
tagged with: internet-explorer
has answer: http://stackoverflow.com/a/28324872
has comment: http://stackoverflow.com/comment/44998268

http://stackoverflow.com/q/28310707
has body: Right now in my test environment it's sufficient to say window.location.href = "/home"but in other environment this base url will not be the same. How do I, using JavaScript, redirect the page to the base url of the web application? It's an ASP NET MVC Application.
has comment: http://stackoverflow.com/comment/44972313
has answer: http://stackoverflow.com/a/28310878
possible better answer: http://stackoverflow.com/a/28310826
has answer: http://stackoverflow.com/a/28310826
has title: How to redirect to base url which is not always unique
score: 0
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28310878
tagged with: asp.net-mvc
type: Question
answer count: 2
tagged with: url
has comment: http://stackoverflow.com/comment/44972272
tagged with: javascript

http://stackoverflow.com/comment/53500284
type: Comment
has text: This doesn't work in IE 11.
comment on: http://stackoverflow.com/a/28352842
type: AnswerComment
score: 0

http://stackoverflow.com/a/28349771
has body: Perhaps I'm misunderstanding your code but I think your issue is here: ajaxRequest("post", "/api/myAPI/Update/" + (Id || "") + "/" + (loginUserId || ""), data, null) Why are you submitting data in the AJAX request? That's the click event parameter so I have a feeling this isn't necessary and/or was unintentional. If data contains some information that you do need for the AJAX request I would suggest extracting the specific values out and submitting your own object.
score: 0
has comment: http://stackoverflow.com/comment/45437232
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/28328629
accepted answer of: http://stackoverflow.com/q/28328629

http://stackoverflow.com/a/28386230
answers question: http://stackoverflow.com/q/28377882
type: Answer
has comment: http://stackoverflow.com/comment/45116387
has body: Essentially, I've created a pretty clever workaround. It is a mask that covers the image (invisible) until the html is loaded, then the hover css takes place after the z-index is lowered. The hover javascript is on the container. FIDDLE .summary { margin: -50px auto 0; width: 50px; height: 50px; position: relative; z-index: 0; } .summary-mask { margin: 50px auto 0; width: 50px; height: 50px; position: relative; z-index: 1; } .loaded .summary-mask { z-index: -1; } HTML JS var response = ' Follow Page Name Username Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy .. '; $(document).ready(function () { function showProfileTooltip(e, id) { //send id & get info from get_profile.php $.ajax({ url: '/echo/html/', data: { html: response, delay: 0 }, method: 'post', success: function (returnHtml) { e.find('.user-container').html(returnHtml).promise().done(function () { $('.the-container').addClass('loaded'); }); } }); } function hideProfileTooltip() { $('.the-container').removeClass('loaded'); } $('.the-container').hover(function (e) { var id = $(this).find('.summary').attr('data-id'); showProfileTooltip($(this), id); }, function () { hideProfileTooltip(); }); });
has comment: http://stackoverflow.com/comment/45123792
has comment: http://stackoverflow.com/comment/45116434
has comment: http://stackoverflow.com/comment/45132699
has comment: http://stackoverflow.com/comment/45597799
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28377882

http://stackoverflow.com/q/28340920
accepted answer: http://stackoverflow.com/a/29875804
has comment: http://stackoverflow.com/comment/45026962
has answer: http://stackoverflow.com/a/28544639
tagged with: javascript
has comment: http://stackoverflow.com/comment/45027033
has comment: http://stackoverflow.com/comment/45027697
has answer: http://stackoverflow.com/a/28555605
has comment: http://stackoverflow.com/comment/47995601
has comment: http://stackoverflow.com/comment/45029191
has comment: http://stackoverflow.com/comment/45029324
has comment: http://stackoverflow.com/comment/45028649
has comment: http://stackoverflow.com/comment/45030705
favorite count: 0
has comment: http://stackoverflow.com/comment/45028822
tagged with: cordova
answer count: 9
has comment: http://stackoverflow.com/comment/47943965
upvote count: 30
has title: how to make my phonegap android app crash?
has comment: http://stackoverflow.com/comment/47994424
has answer: http://stackoverflow.com/a/29884005
has answer: http://stackoverflow.com/a/29875804
has answer: http://stackoverflow.com/a/29893097
has answer: http://stackoverflow.com/a/28531525
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45027455
has comment: http://stackoverflow.com/comment/45381587
linked to: http://stackoverflow.com/q/18810576
has body: I am developing a crash reporter plugin for phonegap android apps. For the testing purpose, I have to make my application crash &amp; "Unfortunately, application has stopped" window has to be invoked. When I make an unhandled exception in the javascript, the app is not crashing. Instead its showing the same screen. I made the app screen stop respond to user input by executing some infinite loop in javascript &amp; waited around 1 hour, still the app was not crashing. Is the phonegap library by default handling the exceptions ? how I can make my app crash by making exception in javascript level ? I tried the below code,added a java method to generate crash in the 'CordovaActivity' class. public static void generateCrash() { int a = 0; int b = 10; int c = b/a ; } The app is crashing when I call this method from java (from the 'onCreate' in the activity class) . But when I invoke the same method from the javascript using plugin, the app is not crashing. I want my app to crash by calling/invoking some function from the javascript.
has comment: http://stackoverflow.com/comment/47664095
has answer: http://stackoverflow.com/a/28400124
has comment: http://stackoverflow.com/comment/45029717
score: 29
downvote count: 1
has answer: http://stackoverflow.com/a/29903589
has answer: http://stackoverflow.com/a/28452930
type: Question
has comment: http://stackoverflow.com/comment/45028005
linked to: http://stackoverflow.com/q/28129601
possible better answer: http://stackoverflow.com/a/28544639

http://stackoverflow.com/a/28314992
answers question: http://stackoverflow.com/q/28306606
has comment: http://stackoverflow.com/comment/44985203
upvote count: 3
type: AcceptedAnswer
has body: $$qProvider was introduced in AngularJS 1.3.0-beta.14. It is undocumented and used internally. Prior to this version $IntervalProvider used $q and in beta.14 and later it uses both $q and $$q. Somewhere you have conflicting versions of AngularJS modules. Check all your files or for example your Bower components. Make sure your core AngularJS version is high enough for other modules you might be using. Angular Material for example requires Angular 1.3.x.
has comment: http://stackoverflow.com/comment/44989052
has comment: http://stackoverflow.com/comment/44988310
has comment: http://stackoverflow.com/comment/44985270
type: Answer
score: 3
has comment: http://stackoverflow.com/comment/44985416
has comment: http://stackoverflow.com/comment/44985335
accepted answer of: http://stackoverflow.com/q/28306606
downvote count: 0

http://stackoverflow.com/q/28408288
answer count: 2
accepted answer: http://stackoverflow.com/a/28408317
has body: I need insert variable inside nth-child() var slider_wraper = $('.img-slide-wrapper'); var increment = 1; $('.ar-right').on('click', function(){ slider_wraper.children('img:nth-child(" + increment + ")').clone().hide().appendTo(img_div).fadeIn(1000); increment++; console.log(increment); });
tagged with: javascript
tagged with: jquery
has title: How to insert variable inside nth-shild(' ') selector
has answer: http://stackoverflow.com/a/28408317
score: 2
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/28408310
favorite count: 0
type: Question
upvote count: 2
possible better answer: http://stackoverflow.com/a/28408310

http://stackoverflow.com/q/28430348
score: 18
tagged with: javascript
has answer: http://stackoverflow.com/a/28430482
accepted answer: http://stackoverflow.com/a/28430482
has answer: http://stackoverflow.com/a/28430494
answer count: 3
has comment: http://stackoverflow.com/comment/45191542
has answer: http://stackoverflow.com/a/28430549
has title: How to loop through arrays starting at different index while still looping through entire array?
downvote count: 0
has comment: http://stackoverflow.com/comment/45191635
favorite count: 0
upvote count: 18
has body: Suppose I had an array of 5 strings. How can I start a for loop at index 3 and go around and end up at index 2? Let me give an example. var myArry = ["cool", "gnarly", "rad", "farout", "awesome"]; Would like to start at index 3 ("farout") loop through to end of array ("awesome") then continue looping at index 0 through index 2. Basically beginning an array at some point (other than index 0) and still hit every element in the array.
possible better answer: http://stackoverflow.com/a/28430494
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45191444
type: Question

http://stackoverflow.com/q/28346746
type: Question
has answer: http://stackoverflow.com/a/28350125
downvote count: 0
tagged with: javascript
tagged with: passport.js
tagged with: express
tagged with: passport-local
answer count: 1
has comment: http://stackoverflow.com/comment/45038188
favorite count: 0
accepted answer: http://stackoverflow.com/a/28350125
upvote count: 2
has body: The code for my Logout Mechanism is app.get('/logout', isLoggedIn, function(req, res) { req.logout(); res.redirect('/'); }); Am using a Express-session package using a secret key, haven't set Cookies anywhere. While I click the browser Back button after logout, It still allows the user to go back to the page being authenticated. How do I terminate this session entirely? isLoggedIn is just authenticating via PassportJS's isAuthenticated method. What is the way out here? Please help. Thanks in Advance. Edit: This is the session Id
tagged with: node.js
score: 2
type: AnsweredQuestion
has title: Browser Back Button doesn't destroy the session in PassportJS + ExpressJS. How to kill/terminate the session entirely?

http://stackoverflow.com/q/28358652
score: 0
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has title: Add Span to Label ID
tagged with: css
has answer: http://stackoverflow.com/a/28359147
has comment: http://stackoverflow.com/comment/45060446
type: Question
has answer: http://stackoverflow.com/a/28358725
answer count: 2
tagged with: javascript
has body: I'm trying to add a span to a label for which I don't have access to the HTML as it's output from RSForms Pro. I would like to add a tooltip span to individual labels so when the person rolls their mouse over, they get some information. Here is what the code looks like: Death Records Retrieval/Search The next option has the class Services_DM1 and so forth. How do I go about adding a span to "Death Records Retrieval/Search" without having access to the actual code? Is there a way to inject it?

http://stackoverflow.com/q/28430468
has comment: http://stackoverflow.com/comment/45191764
has comment: http://stackoverflow.com/comment/45191682
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45191645
has comment: http://stackoverflow.com/comment/45191628
has comment: http://stackoverflow.com/comment/45191629
has comment: http://stackoverflow.com/comment/45191815
has answer: http://stackoverflow.com/a/28430511
answer count: 4
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28430511
linked to: http://stackoverflow.com/q/1463867
has comment: http://stackoverflow.com/comment/45191694
has comment: http://stackoverflow.com/comment/45192084
upvote count: 1
linked to: http://stackoverflow.com/q/8667736
has comment: http://stackoverflow.com/comment/45191780
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45191801
has title: difference between $ and $$
has body: I used $ instead of document.getElementById() in javascript and i don't know what is the use of $$. Can any one please tell me what is the use of $$? Here is the code: var link_object = $$('a[class="menu_item"]'); if (window.location.href.search('inident.do') &gt;= 0) { link_object.each(function (elem) { if (elem.innerHTML == 'Create an Incident') { elem.style.fontWeight = 'bold'; elem.style.color = 'black'; } }); }
possible better answer: http://stackoverflow.com/a/28430587
tagged with: javascript
has answer: http://stackoverflow.com/a/28431856
has comment: http://stackoverflow.com/comment/45191674
has answer: http://stackoverflow.com/a/28430587
has answer: http://stackoverflow.com/a/28430863
score: 0

http://stackoverflow.com/comment/45035904
comment on: http://stackoverflow.com/q/28345808
type: Comment
type: QuestionComment
has text: what you exactly want to do ?
score: 0

google-apps-script
tags question: http://stackoverflow.com/q/28363895
tags question: http://stackoverflow.com/q/28332155
tags question: http://stackoverflow.com/q/28319318
tags question: http://stackoverflow.com/q/28302583
tags question: http://stackoverflow.com/q/28295056
tags question: http://stackoverflow.com/q/28433654
tags question: http://stackoverflow.com/q/28390564
tags question: http://stackoverflow.com/q/28378738
type: Tag
tag name: google-apps-script
tags question: http://stackoverflow.com/q/28323703
tags question: http://stackoverflow.com/q/28368864
tags question: http://stackoverflow.com/q/28374024
tags question: http://stackoverflow.com/q/28288438
tags question: http://stackoverflow.com/q/28327924
tags question: http://stackoverflow.com/q/28424268
tags question: http://stackoverflow.com/q/28411350
tags question: http://stackoverflow.com/q/28303727
tags question: http://stackoverflow.com/q/28358354
tags question: http://stackoverflow.com/q/28370847
tags question: http://stackoverflow.com/q/28433758
tags question: http://stackoverflow.com/q/28377951
tags question: http://stackoverflow.com/q/28364248
tags question: http://stackoverflow.com/q/28377887
tags question: http://stackoverflow.com/q/28395604
tags question: http://stackoverflow.com/q/28379540

http://stackoverflow.com/a/28408426
has body: All the events hash are limited to the views el. Hence the event won't be triggered. Access the element Globally and bind the event using jquery in view's initialize. ev.views.Home = Backbone.View.extend({ initialize:function(){ $('#search').click(this.searchKey); } }); Edit : this answer just solves the problem. consider Peter Wagener answer.
accepted answer of: http://stackoverflow.com/q/28408292
answers question: http://stackoverflow.com/q/28408292
score: 0
type: AcceptedAnswer
type: Answer

angular-ui-router
tags question: http://stackoverflow.com/q/28384719
tags question: http://stackoverflow.com/q/28353817
tags question: http://stackoverflow.com/q/28373009
tags question: http://stackoverflow.com/q/28284480
tags question: http://stackoverflow.com/q/28287399
tags question: http://stackoverflow.com/q/28375372
tags question: http://stackoverflow.com/q/28348050
tags question: http://stackoverflow.com/q/28389380
tags question: http://stackoverflow.com/q/28414836
tags question: http://stackoverflow.com/q/28368651
tag name: angular-ui-router
tags question: http://stackoverflow.com/q/28366927
tags question: http://stackoverflow.com/q/28407576
tags question: http://stackoverflow.com/q/28326108
tags question: http://stackoverflow.com/q/28285100
tags question: http://stackoverflow.com/q/28357504
type: Tag
tags question: http://stackoverflow.com/q/28310243
tags question: http://stackoverflow.com/q/28419042

http://stackoverflow.com/comment/133739995
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/44656670
type: Comment
has text: How does this solve the original issue? Where are you capturing the values from JS and passing them to razor view?

http://stackoverflow.com/comment/44984372
comment on: http://stackoverflow.com/q/28316643
type: QuestionComment
has text: @Zeratops That works somewhat. User can't click on the seek bar anymore (to change the value), but dragging is smooth. Thanks!
type: Comment
score: 0

http://stackoverflow.com/comment/45054765
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28355410
has text: I remember once I had the same issue, take a look to this post: http://stackoverflow.com/questions/2921745/how-to-make-cross-domain-ajax-calls-to-google-maps-api

http://stackoverflow.com/comment/44970007
type: AnswerComment
comment on: http://stackoverflow.com/a/28309098
type: Comment
has text: @user61629 there's really no such thing as a "jquery context". If the `$that` variable hasn't been touched since the `pop_open()` code ran, then it should still contain the same reference to the same jQuery object; you don't need to assign it to anything. Just use it.
score: 0

http://stackoverflow.com/q/28388336
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28389070
score: 1
has title: Angular filter select lists excluding selected value
type: Question
has body: I have a dynamic html block for which a user can add multiple select lists. I'm wanting to disable the selections that the user has made in the previous lists by checking using a custom filter. The part i'm struggling with how to pass the dynamic model into the filter and check that the value does not exist on the already generated select lists. I've created a plunker. I appreciate the help. angular.module('app',[]) .filter('excludeFrom', [function () { return function (things, selectedValue) { if (!angular.isUndefined(things) && !angular.isUndefined(selectedValue)) { //&& selectedValue.length > 0) { var tempThings = []; angular.forEach(selectedValue, function (name) { angular.forEach(things, function (things) { if (angular.equals(things, selectedValue.name)) { tempThings.push(things); } }); }); return tempThings; } else { return things; } }; }]);
upvote count: 1
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/q/28400400
has comment: http://stackoverflow.com/comment/45136485
tagged with: arrays
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
has title: How do I create a list of random numbers using JavaScript?
has body: My code is working but it isn't producing the output I want; I have three lists. One produces all random numbers, second produces the the numbers that are even, and the third produces numbers that are odd. Everything seems fine but the third list is only producing one odd numbered element instead of the other odd numbers the first list generates. How can I fix this? Javascript: var nums = []; var allLists = " "; var evenList = " "; var oddList = " "; for(i = 0; i < 50; i++){ nums[i] = parseInt(Math.random() * 10); allLists += " " + nums[i] + " "; if(nums[i] % 2 == 0){ evenList += " " + nums[i] + " "; } else{ oddList = " " + nums[i] + " "; } } allLists += " "; evenList += " "; oddList += " "; document.getElementById("div1").innerHTML = allLists; document.getElementById("div2").innerHTML = evenList; document.getElementById("div3").innerHTML = oddList; HTML:
has comment: http://stackoverflow.com/comment/45136475
tagged with: list
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28400473
tagged with: if-statement
has answer: http://stackoverflow.com/a/28400432
has answer: http://stackoverflow.com/a/28400473
type: Question
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/28400432

http://stackoverflow.com/comment/44978284
type: Comment
type: QuestionComment
has text: This depends entirely upon the calling code. There are many techniques, but we need to see your code that is calling the 5 web services to make a meaningful suggestion rather than launch into a generic discussion that covers the hundreds of possible ways this could be done. FYI, the most common answer is that you use a closure so you have access to which request it was when you get the completion callback. How best to do that depends entirely upon how your code is structured.
comment on: http://stackoverflow.com/q/28314241
score: 0

http://stackoverflow.com/a/28309784
has comment: http://stackoverflow.com/comment/45479468
type: Answer
has body: You can check for Isdirty flag.When cell data is modified the respective model item is marked as Isdirty=true. var data = grid.dataSource.data(); var dirty = $.grep(data, function(item) { return item.dirty }); // Dirty array contains those elements modified console.log("dirty", dirty); Here I'm doing for the entire grid data.You can do the same for single row.
answers question: http://stackoverflow.com/q/28297247
score: 0

http://stackoverflow.com/a/34008658
type: Answer
has body: You can place two div where 1st div (Header) will have transparent scroll bar and 2nd div will be have data with visible/auto scroll bar. Sample has angular code snippet for looping through the data. Below code worked for me - {{col1}} {{col2}} {{col3}} {{row.col1}} {{row.col2}} {{row.col3}} Additional style to hide header scroll bar -
answers question: http://stackoverflow.com/q/28350930
score: 0

http://stackoverflow.com/a/28389640
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28389547
type: Answer
upvote count: 1
has body: You could use display:blockand float your elements to the left. But this method requires some additional CSS to add the list bullets. Snippet ul > li{ display:block; float:left; clear:left; list-style:circle; } ul>li:before{ content:"•"; margin-right:10px; } Item-1 Item-ABC Item-A Item-ABDAKDÖSAKD Item-AAAAA

bluebird
tags question: http://stackoverflow.com/q/28379922
tags question: http://stackoverflow.com/q/28388129
tags question: http://stackoverflow.com/q/28371561
tags question: http://stackoverflow.com/q/28338337
tags question: http://stackoverflow.com/q/28430276
tags question: http://stackoverflow.com/q/28366199
tags question: http://stackoverflow.com/q/28354365
tag name: bluebird
tags question: http://stackoverflow.com/q/28373838
tags question: http://stackoverflow.com/q/28372500
tags question: http://stackoverflow.com/q/28285343
tags question: http://stackoverflow.com/q/28302848
tags question: http://stackoverflow.com/q/28308131
type: Tag
tags question: http://stackoverflow.com/q/28352924
tags question: http://stackoverflow.com/q/28286894

http://stackoverflow.com/q/28421321
accepted answer: http://stackoverflow.com/a/28426170
has body: All my .js files look like this: function function_name(){ ..... some code ..... } $(document).ready(function_name); $(document).on('page:load', function_name); I use setInterval(some_function, 7000), Event handlers like $(document).on('click', '.blah-blah', function(){...}). Unfortunately, these stuff calls multiple times if I a have more than one request to server via turbolinks (using turbolinks session). Actually amount of calls equals to the amount of server requests. For instance, I have &lt;button id="button"&gt;&lt;/button&gt; and js event handler, handler executes as many times as requests in turbolinks session I have. It's so annoying) I'd like you to find out how to keep turbolinks turned on and avoid multiple calls inside js files. Thanks.
score: 1
upvote count: 1
tagged with: ruby-on-rails
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28426170
tagged with: javascript
has title: Rails turbolinks JS files Bug
tagged with: turbolinks
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/45178691
has text: @ArsenyMikhalev The top code works you just have to add all the types of letters of accents into the switch statement and the regex
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28357326

http://stackoverflow.com/q/28375433
favorite count: 0
type: Question
upvote count: 1
tagged with: bigcommerce
has body: I'm trying to implement the Bing Translator Web Widget in my BigCommerce site. The default widget is a bit clunky and doesn't fit in with my sites appearance. Is there any way that I can mimic the Widgets functionality in a select list of languages? Alternatively, little flags are always pleasant to the eye. Microsoft gives more info here but I'm unsure how to preserve the default features like having an admin sign in and improve the translation.
tagged with: bing-translator-api
answer count: 0
tagged with: javascript
type: UnansweredQuestion
downvote count: 0
has title: Customize the Bing Translator Web Widget
score: 1

http://stackoverflow.com/q/28386753
type: Question
accepted answer: http://stackoverflow.com/a/28386849
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28386842
has answer: http://stackoverflow.com/a/28386812
tagged with: angularjs
tagged with: binding
possible better answer: http://stackoverflow.com/a/28386812
has comment: http://stackoverflow.com/comment/45111292
has answer: http://stackoverflow.com/a/28386874
has answer: http://stackoverflow.com/a/28386941
favorite count: 0
has comment: http://stackoverflow.com/comment/62335705
answer count: 5
has answer: http://stackoverflow.com/a/28386849
has title: AngularJS pass URL in attribute to isolated scope of directive - unexpected token ':'
upvote count: 7
tagged with: angularjs-directive
type: AnsweredQuestion
score: 7
tagged with: angularjs-scope
has body: I'm fairly new to AngularJS and just started using it a few days ago, so forgive me if the question itself is incorrect. The problem I ran into is that I'd like to pass a URL parameter via attribute to the isolated scope of my directive, but at the : part in http:// it gives me an error, saying Syntax Error: Token ':' is an unexpected token at column 5 of the expression [http://... The HTML part of the directive (where I "call" it) is something like this: &lt;myDirective datasource="http://url"&gt;&lt;/myDirective&gt; And I bind(?) it to the isolated scope like this: scope: { dataSource: '=datasource' } If the value of the attribute contains only simple characters, it works. How can I solve this? Thanks.

http://stackoverflow.com/comment/45016813
comment on: http://stackoverflow.com/q/28334694
score: 0
has text: Hi @JBaczuk, Thanks for the response. My issue is that the tID's variable in the API2 function runs before all of the functions in API1 complete. At the end of API1, I run a function to remove the good url from the array, expecting it to update the array (which it does) and then run API2 and then get the tID's variable (which holds the updated array from API1). The issue is that tID's in API2 is evaluated before API1 is finished, which results in an old array.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45043451
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28349534
has text: Where are you calling this function on your page? Before the element exists on the page, or after?

http://stackoverflow.com/comment/45157694
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28401618
type: Comment
has text: From reading [the mongoose code](https://github.com/LearnBoost/mongoose/blob/dd4f05dbeb9cd144071209f38a465e86377d9164/lib/model.js#L163), it looks like the function passed to `.save()` is actually given 3 arguments: error object (if any), saved model, and numberAffected. So I think your second function will need to have a signature of `function (savedSession, numAffected, callback) {`.

http://stackoverflow.com/comment/45372993
type: Comment
has text: okey i just added the plugin as well, but the map still wont load and the console doesnt write out anything. Although Logcat is giving me an error that says "unable to find stats for iface rmnt0"
comment on: http://stackoverflow.com/a/28438725
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45018160
comment on: http://stackoverflow.com/q/28335961
has text: @Barmar, could you give me some example code to try?
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/28327879
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28318004
has body: When you call chart.draw, provide a number for the first argument for the number of milliseconds to transition. It defaults to 0 so by default there is no transition. This is not something provided by Dimple or D3 natively. There are other libraries you can look into which provide some of that functionality, like the one referenced by (and detailed in) this blog post : http://spin.atomicobject.com/2014/01/21/convert-svg-to-png/
score: 2
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28318004

http://stackoverflow.com/a/28578845
accepted answer of: http://stackoverflow.com/q/28389684
answers question: http://stackoverflow.com/q/28389684
type: AcceptedAnswer
has body: As it turns out, the issue I was having here was that Openshift has predefined that websocket connections must come in on port 8000, but are then forwarded to port 8080 on my gear, so my server needed to be listening on a different port than my client was explicitly connecting to, which is super counter-intuitive. A mostly unrelated question I found on here ultimately lead me to an article from Openshift that lays out the details.
downvote count: 0
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/a/28361203
has comment: http://stackoverflow.com/comment/45069217
type: Answer
has body: You can give the css() method a function to perform some logic on the current value. Try this: $('.classname').mousedown(function() { $(this) .css("z-index", "100") .siblings().css("z-index", function(i, val) { return parseInt(val, 10) - 1; }); });
has comment: http://stackoverflow.com/comment/45069204
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/45086433
score: 4
answers question: http://stackoverflow.com/q/28361171

http://stackoverflow.com/comment/44968961
comment on: http://stackoverflow.com/q/28308763
type: Comment
has text: Probably duplicate with this one: http://stackoverflow.com/questions/25964869/chrome-screenshot-works-only-when-extension-is-clicked
score: 1
type: QuestionComment

http://stackoverflow.com/comment/45001724
comment on: http://stackoverflow.com/a/28327007
has text: OMG! I have read and practiced this 100 times and i wasted 3 hours on it! Thanks!
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28307112
score: 1
has title: Medium script to embed not working
type: Question
has body: I'm using Drupal to embed the widget Medium profile , but when loading the page the following errors appear in the console and the widget is not generated correctly. embed-frame.bundle.NoHmxLqhwXL_4tl9CwlL2Q.js:630 Can not define setters/getters for "mi", property name already exists. embed-frame.bundle.NoHmxLqhwXL_4tl9CwlL2Q.js:33697 Uncaught TypeError: Cannot read property 'userId' of undefined The error occurs when trying to embed the widget to any profile Medium. I think the error comes from Medium , but if anyone has found a solution I would appreciate your cooperation.
tagged with: javascript
has comment: http://stackoverflow.com/comment/45018589
upvote count: 1
has comment: http://stackoverflow.com/comment/45017747
favorite count: 0
has comment: http://stackoverflow.com/comment/44975461
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45078887
tagged with: embed
tagged with: drupal
downvote count: 0

http://stackoverflow.com/comment/45057173
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28356891
has text: Don't put them on your website?
score: 3

http://stackoverflow.com/a/28365218
answers question: http://stackoverflow.com/q/28365129
upvote count: 1
has body: Assuming that you will change "form button" for the ID of the button, and "form input" for the ID of the input. The jQuery code would be something like this: $("form button").click(function() { if ($("form input").val() != "") $("form input").hide(); });
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/45120406
score: 0
type: AnswerComment
has text: @priyam, That's the subject of a new question and depends on more detail and understanding of your app, but you could do something as simple as ` @ViewBag.Message ` and then in the controller `ViewBag.Message = "some message";`
comment on: http://stackoverflow.com/a/28391582
type: Comment

http://stackoverflow.com/q/28353232
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45050192
has body: The following snippet of code is from angular's documentation. What is the it() function here doing (I'm assuming it has some conventional meaning because otherwise no context seems to be given for its meaning)? I don't see any reference to it on angular's site. It's also hard to google due to it's name. The context is with regards to code testing. it('should say hello', function() { var scopeMock = {}; var cntl = new MyController(scopeMock); // Assert that username is pre-filled expect(scopeMock.username).toEqual('World'); // Assert that we read new username and greet scopeMock.username = 'angular'; scopeMock.sayHello(); expect(scopeMock.greeting).toEqual('Hello angular!'); });
upvote count: 37
has answer: http://stackoverflow.com/a/28353270
has title: What is the `it()` function here doing?
type: Question
score: 37
answer count: 2
has comment: http://stackoverflow.com/comment/45050180
has answer: http://stackoverflow.com/a/28353826
downvote count: 0
tagged with: javascript
favorite count: 0
linked to: http://stackoverflow.com/q/24145304
has comment: http://stackoverflow.com/comment/94204910
tagged with: angularjs

http://stackoverflow.com/a/28381673
type: Answer
has body: You could patch user.saveAsync var user_saveAsync = user.saveAsync; user.saveAsync = function() { return user_saveAsync.bind(this)() //-&gt; same as calling `user.saveAsync()` .spread(function(user) { // but now you're returning spreaded result return user; }); } Then you can just do function saveUser(user) { return user.saveAsync(); }
score: 0
answers question: http://stackoverflow.com/q/28379922
has comment: http://stackoverflow.com/comment/45105186

http://stackoverflow.com/comment/45165402
score: 1
comment on: http://stackoverflow.com/q/28286073
type: Comment
type: QuestionComment
has text: If you need this test, there must be a situation when you expect this error might occur. Can you provide a scenario when this error occurs?

http://stackoverflow.com/comment/44941548
has text: $scope.$digest() function iterates through all the watches in the $scope object, and its child $scope objects (if it has any). When $digest() iterates over the watches, it calls the value function for each watch. If the value returned by the value function is different than the value it returned the last time it was called, the listener function for that watch is called.
comment on: http://stackoverflow.com/q/28293080
score: 0
type: Comment
type: QuestionComment

alerts
tags question: http://stackoverflow.com/q/28402451
type: Tag
tag name: alerts

http://stackoverflow.com/comment/45079479
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28369116
has text: Please edit your question to say as much, rather than responding in a comment.

http://stackoverflow.com/comment/45087223
comment on: http://stackoverflow.com/q/28373349
has text: you're setting the same image for both device types... and where's blackberry? where's windows mobile? where's symbian?
score: 0
type: Comment
type: QuestionComment

performance
tags question: http://stackoverflow.com/q/28345312
tags question: http://stackoverflow.com/q/28290969
tags question: http://stackoverflow.com/q/28408568
tags question: http://stackoverflow.com/q/28435915
tags question: http://stackoverflow.com/q/28379619
tags question: http://stackoverflow.com/q/28335282
tags question: http://stackoverflow.com/q/28388533
tags question: http://stackoverflow.com/q/28346660
tags question: http://stackoverflow.com/q/28329869
tags question: http://stackoverflow.com/q/28344542
tags question: http://stackoverflow.com/q/28341519
tags question: http://stackoverflow.com/q/28422487
tags question: http://stackoverflow.com/q/28341580
tags question: http://stackoverflow.com/q/28321982
tags question: http://stackoverflow.com/q/28310062
tags question: http://stackoverflow.com/q/28352232
tag name: performance
tags question: http://stackoverflow.com/q/28337455
tags question: http://stackoverflow.com/q/28414604
tags question: http://stackoverflow.com/q/28330912
type: Tag
tags question: http://stackoverflow.com/q/28436275
tags question: http://stackoverflow.com/q/28338412
tags question: http://stackoverflow.com/q/28394409

http://stackoverflow.com/a/28406167
type: Answer
has comment: http://stackoverflow.com/comment/45153216
has comment: http://stackoverflow.com/comment/45155519
accepted answer of: http://stackoverflow.com/q/28326470
answers question: http://stackoverflow.com/q/28326470
has comment: http://stackoverflow.com/comment/45190212
score: 0
type: AcceptedAnswer
has body: I tested your fiddle and find out, that your class is overwritten by another one, so your Basemapgallery won't show up as expectet. Checkout my fiddle here : http://jsfiddle.net/e0k6Lfsa/8/ I setup a seperate clas for the tp and set the position attribute to important. .tpclass { position:absolute !important; top:10px !important; right:40px !important; } var switchPane = domConstruct.toDom(" BASEMAPS HERE "); domConstruct.place(switchPane, "mapDiv"); var tp = new TitlePane({ id: "tp", title:"Basemaps", closable: false, open: false, region:"mapDiv", class:"tpclass" },dom.byId("switchPane")); It's iportant that you delete the //appLayout.addChild(tp); line, because of that, the class of the Titlepane is overwriten and thersfor your position right won't work. Regards,Miriam
has comment: http://stackoverflow.com/comment/45189273
has comment: http://stackoverflow.com/comment/45147205

http://stackoverflow.com/comment/44939058
type: AnswerComment
comment on: http://stackoverflow.com/a/28293010
score: 0
type: Comment
has text: @Akash just add in in your script tag and do the necessary

http://stackoverflow.com/a/28447698
answers question: http://stackoverflow.com/q/28429605
upvote count: 1
type: AcceptedAnswer
type: Answer
has body: "code_postal is not defined" happens because of this line of javascript: var currentCp = communeListe[i][code_postal]; Javascript thinks code_postal is the name of a variable, but there's no "var codePostal = ..." anywhere in your javascript. Here's what's going on with your JSP page: First, your JSP is rendered. JSP invokes the SQL query and stores the result in the communeCp variable (an object of type javax.servlet.jsp.jstl.sql.Result). JSP then replaces this line: var communeListe = "${communeCp}"; with the result of evaluating "communeCp.toString()". I don't know what that is, but it might be something as simple as the default Object.toString implementation, so this is the actual javascript that would be rendered to the page: var communeListe = "javax.servlet.jsp.jstl.sql.Result@123456". Now that the JSP has been rendered, the browser executes the javascript. It fails to even evaluate because you have the undefined code_postal reference, but if for some reason that wasn't a problem, it would fail because you are trying to do a for each loop over the communeListe, but javascript sees that communeListe is just a simple string, so it doesn't make sense to do a for loop over that. Now, with that understood, I'll try to explain how you could achieve the behavior you want without AJAX. From your code, it looks like you want the following behavior: A user needs to enter a postal code and select a ville in that postal code. After they've entered 5 characters of their postal code, enable the "ville" dropdown and populate it with the possible villa choices for that postal code. You have the basic idea for one way to achieve this: Do a query in JSP that gets all postal codes and all villes, then, when the postal code is entered, look through this data somehow in javascript and populate the ville dropdown with the villes that are in that postal code. The problem is in making the data from the SQL query available to the javascript. Here's how you might do that without AJAX.…
has comment: http://stackoverflow.com/comment/45232331
accepted answer of: http://stackoverflow.com/q/28429605
downvote count: 0
score: 1

http://stackoverflow.com/a/28293661
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/62051985
has comment: http://stackoverflow.com/comment/45005546
has body: From what I see here, the error returned would be request-specific, not comment-specific. In that paradigm it wouldn't make sense to give each comment an error property. Instead, in this situation I'd keep some sort of array to store the errors: this.setState({ errors: this.errors.push(err); }); Then you can have a separate &lt;ErrorDisplay/&gt; component of your own creation which receives the error array as a prop. Whenever the array changes, perhaps it can display the most recent error for a few seconds. It's up to you. By the way, dig into Flux as soon as you can. If not Flux, then something else. The folks at Facebook will eagerly tell you that keeping definitive state like this in a React component is to be avoided. It's a necessary evil when getting acquainted with React though, so don't worry.
has comment: http://stackoverflow.com/comment/44973108
upvote count: 2
answers question: http://stackoverflow.com/q/28290590
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45005750
accepted answer of: http://stackoverflow.com/q/28290590

http://stackoverflow.com/comment/45164787
score: 0
type: QuestionComment
has text: You're echo div with double quote attribute inside double quote attribute. The php code will not execute on the client but on the server before html is rendered.
type: Comment
comment on: http://stackoverflow.com/q/28415705

http://stackoverflow.com/comment/45096213
has text: Drop down shown in example, will it be populated from DB? I don't see data there in the sample. Also you don't need e.preventDefault(); in your click function.
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28378053

http://stackoverflow.com/comment/44946793
comment on: http://stackoverflow.com/q/28295870
type: QuestionComment
has text: location.search works fine. Thanks Teemu
score: 0
type: Comment

http://stackoverflow.com/comment/45032164
type: Comment
has text: It's definitely something to do with the knockout mapping file not loading correctly. Here's your code working in a [jsfiddle](http://jsfiddle.net/7mnoodn8/).
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28342211

http://stackoverflow.com/comment/91949817
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/52475498
has text: @Chris in that case why it raise a warning ?

http://stackoverflow.com/a/28338420
upvote count: 1
has body: You could do this, $(document).ready(function(){ //Other code here $(document).on('click','#deleteRecord',function(){ //I want to submit variables attr1 and attr2 as post data to delete_post.php var link = $("#deleteRecord"); var formData = new FormData(); // perform validations // append to formData formData.append("attr1", link.attr("attr1"); formData.append("attr2", link.attr("attr2"); // ajax post $.post("") }); });
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28338338
score: 1

http://stackoverflow.com/q/28310145
upvote count: 2
answer count: 3
tagged with: meteor
favorite count: 0
has title: User-specific fields in simple-schema/AutoForm collection insert [Meteor]
has answer: http://stackoverflow.com/a/28317710
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/34677011
score: 2
downvote count: 0
type: Question
tagged with: mongodb
has body: Im using a simple-schema and a quickForm to allow users to persist documents to my collection, but I want to add Meteor.userId() and Meteor.user().username fields to ultimately only return data specific to the current user. Since quickForms doesnt show its insert() method, Im not sure where to add the fields. Below is the schema I am using to allow a user to persist Speakers to the collection. Speakers = new Meteor.Collection('speakers'); Speakers.attachSchema(new SimpleSchema({ first: { type: String, label: "first name", max: 200 }, last: { type: String, label: "last name", max: 200 }, date: { type: Date, label: 'date', optional: true } }));
tagged with: javascript
tagged with: meteorite
has answer: http://stackoverflow.com/a/28310752

http://stackoverflow.com/comment/45070226
type: QuestionComment
comment on: http://stackoverflow.com/q/28364145
has text: You should also avoid using the name of JavaScript built-in objects, properties, and methods, such as "name"
type: Comment
score: 0

http://stackoverflow.com/comment/45116315
score: 0
type: QuestionComment
has text: @dandavis Oh I'm working on a chrome extension for YouTube. Do you know what they're using?
type: Comment
comment on: http://stackoverflow.com/q/28389347

http://stackoverflow.com/tag/csv
type: Tag
tag name: csv
tags question: http://stackoverflow.com/q/28417769
tags question: http://stackoverflow.com/q/28305967
tags question: http://stackoverflow.com/q/28287466
tags question: http://stackoverflow.com/q/28313945
tags question: http://stackoverflow.com/q/28435176
tags question: http://stackoverflow.com/q/28371079

http://stackoverflow.com/q/28376189
tagged with: forms
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has body: I have included a simple form on the home page of our website that posts its results to a page named Results.aspx. Instead of the form's results returning on the same page, I'd like it if the results opened in a new modal. How is this accomplished? To recap, the form is on the home page, and on submit, the results should be shown in a new modal window. Looking For Medicare Advantage Plans? Please enter your zip code
upvote count: 1
has answer: http://stackoverflow.com/a/28376628
favorite count: 0
type: UnansweredQuestion
has title: Display Form Results in Bootstrap Modal
has comment: http://stackoverflow.com/comment/45092660
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/28376313

http://stackoverflow.com/comment/45076253
comment on: http://stackoverflow.com/q/28355141
score: 0
type: QuestionComment
has text: @VictorGrazi: [Check this demo](http://jsfiddle.net/anbw75ue/)
type: Comment

http://stackoverflow.com/q/28313579
tagged with: javascript
has answer: http://stackoverflow.com/a/28314391
answer count: 1
favorite count: 0
tagged with: cordova
type: UnansweredQuestion
tagged with: android
downvote count: 1
has body: I am creating a cordova plugin where i need to raise a custom defined event in the angular JS code. For example I need to call the function below from native java code var callFromJava=function(){ alert("Call received from Native code"); } Now I need to call this from my activity in native code. Update 1 Cordova file public class CordovaApp extends CordovaActivity { super.onCreate(savedInstanceState); super.init(); wv = new CordovaWebView(this); Log.i("PARSEPUSH","URL of main "+wv.getUrl()); // Set by &lt;content src="index.html" /&gt; in config.xml. Log.i("PARSEPUSH",launchUrl); loadUrl(launchUrl); public void callJS(){ //something goes here to call JS event. } } I want to use Cordova loadUrl and sendJavascript() methods. I don't know how to use them.
upvote count: 0
has title: Call JS events from native java code
score: -1
type: Question

http://stackoverflow.com/a/28390538
upvote count: 1
has comment: http://stackoverflow.com/comment/45118496
score: 1
has comment: http://stackoverflow.com/comment/45118509
downvote count: 0
has comment: http://stackoverflow.com/comment/45118448
answers question: http://stackoverflow.com/q/28390322
has body: So I have figured it out, thanks to @claies. HTML: &lt;input type="button" name="one" value=" 1 " onclick="calcu(this.name)" &gt; JavaScript: calc.output.value += "1";
type: Answer

http://stackoverflow.com/a/28431410
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: I found a way to do this by using _gl.getError() var supportsWebGL=function(){ if(Detector.webgl){ var _canvas = document.createElement( 'canvas' ); var _gl = _canvas.getContext( 'webgl' ) || _canvas.getContext( 'experimental-webgl' ); var errors=undefined; try{ _gl.clearStencil( 0 ); errors=_gl.getError(); }catch(e){ return false; } return errors==0; }else{ return false; } } Only if errors are equal to zero the method will return true. If you have other methods you want to check for, just add them to the try/catch block. If you need a solution that works without Three.js, check this out: var supportsWebGL=function(){ if(!window.WebGLRenderingContext)return false; try{ var _canvas = document.createElement( 'canvas' ); var _gl = _canvas.getContext( 'webgl' ) || _canvas.getContext( 'experimental-webgl' ); _gl.clearStencil( 0 ); var errors=_gl.getError(); return errors==0; }catch(e){ return false; } }
has comment: http://stackoverflow.com/comment/45196109
accepted answer of: http://stackoverflow.com/q/28429579
upvote count: 3
answers question: http://stackoverflow.com/q/28429579
score: 3

http://stackoverflow.com/comment/44940315
comment on: http://stackoverflow.com/a/28293497
has text: I apologize, I have double check you script and works great! Thanks guys for your help!
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45002263
comment on: http://stackoverflow.com/a/28327251
score: 1
type: AnswerComment
has text: @xproofx `.getElementsByTagName()` **always** returns a NodeList, but in that case it would be an empty one.
type: Comment

http://stackoverflow.com/a/28390124
answers question: http://stackoverflow.com/q/28390079
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45117991
type: Answer
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/28390079
has body: Firefox, Safari, and Chrome do not support an insert, over over-write, mode. In IE (only) you can query if it is turned on by the OS via document.queryCommandValue("OverWrite") but there is not a way to set it. However, it can be mimicked.

http://stackoverflow.com/comment/44936199
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28291372
score: 0
has text: I'm sure this is just bad naming, but it's not supposed to be `#post-title`, is it? (you use a hiphen in one, and an underscore in another)

http://stackoverflow.com/a/28282187
answers question: http://stackoverflow.com/q/28281782
score: 0
type: AcceptedAnswer
has body: I would suggest using the Selenium Webdriver, which extends the ability to do browser-based automation. HERE is a good overview. HERE is the download/documentation. Here is an example of its use: Sub GetWebPageText(url$) ' REQUIRES REFERENCE TO THE SELENIUM WEBDRIVER TYPE LIBRARY Dim selenium As New SeleniumWrapper.WebDriver selenium.Start "InternetExplorer", url selenium.Open url Debug.Print selenium.getBodyText End Sub
type: Answer
accepted answer of: http://stackoverflow.com/q/28281782

http://stackoverflow.com/q/28315431
has answer: http://stackoverflow.com/a/30551013
has answer: http://stackoverflow.com/a/28315666
has comment: http://stackoverflow.com/comment/44980315
upvote count: 1
has body: From my understanding in JavaScript (And Ruby and Python) only a single instance of a given primitive value exist in memory at any given time. For example, If you instantiate a number, then that number is created in memory. Any other variable that reinstantiates that number, will actually be referencing the same number in memory that was already created. This can be illustrated with the following example: var x = 5; var y = 5; Object.is(x, y); &gt;&gt;&gt;true What is the phenomenon of primitive values being singletons called?
has comment: http://stackoverflow.com/comment/44980454
type: Question
has comment: http://stackoverflow.com/comment/44980290
tagged with: javascript
score: -1
answer count: 2
favorite count: 0
type: UnansweredQuestion
has title: What is the phenomenon of primitive values being singletons called?
downvote count: 2
has comment: http://stackoverflow.com/comment/44980427
has comment: http://stackoverflow.com/comment/44980399

http://stackoverflow.com/comment/44970121
has text: Please show us the markup/css/script and also (if possible) reproduce the problem in a jsFiddle.
score: 0
comment on: http://stackoverflow.com/q/28309433
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28378619
answer count: 1
tagged with: angularjs
has answer: http://stackoverflow.com/a/28379309
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28379309
type: Question
tagged with: javascript
has title: changing API_URL isn't taking effect
has body: I am very new to Angular and JS space. I cloned a repo to play around with it. I followed all the instructions and everything worked fine. But when I make a change to API_URL in this code https://github.com/Tivix/angular-django-registration-auth/blob/master/app/scripts/services/djangoAuth.js then nothing happens. Its almost like the code isn't taking effect. I reload the page, restart nginx, but absolutely nothing. The console of chrome shows that its still trying to make request to old API_URL value. I've also re-ran npm install and bower install but same problem. Is there some basic thing I'm missing? I think this should take effect immediately after I restart nginx and reload the page. Am I missing something with bower?
score: 0

http://stackoverflow.com/comment/44996844
has text: Perhaps this would be possible with an additional browser plugin that would interact with your login system. Maybe there already is something out there. But why do you want to do that? I don't see the point of logging in to sth and closing the browser. And why do you force your pupil to use IE?
comment on: http://stackoverflow.com/q/28324309
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44976078
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28312598
type: AnswerComment
has text: Thanks @Abovestand, but could you tell me a little more as I didnt get it completely.

http://stackoverflow.com/a/28329121
type: AcceptedAnswer
score: 0
type: Answer
has body: /*changed*/ li:not(:target) .view:hover p { opacity: 1; transform: translateY(150px); } The :not(selector) selector matches every element that is NOT the specified element/selector. /*added*/ li:target .view .mask { display:none; } ------> jsfiddle
answers question: http://stackoverflow.com/q/28328357
accepted answer of: http://stackoverflow.com/q/28328357

http://stackoverflow.com/comment/44932938
score: 0
type: Comment
type: QuestionComment
has text: You need that output, but what's the input?
comment on: http://stackoverflow.com/q/28289613

http://stackoverflow.com/a/30191571
has body: Is https://stackoverflow.com/a/17288940/1423583 an answer to your question? Basically it says that you have to change the server to always serve the index.html page.
score: 2
downvote count: 0
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/28372904

http://stackoverflow.com/comment/45006861
type: Comment
has text: Thanks for this. Great answer, in case anyone else is looking at a similar problem this helps too: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/_multi_fields.html
comment on: http://stackoverflow.com/a/28328604
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45154269
type: AnswerComment
comment on: http://stackoverflow.com/a/28410223
type: Comment
score: 1
has text: @mosquito87: You got all the other bits of the inheritance right (and a lot of people don't), this is one of the bits lots of people forget and leave out (since JavaScript itself doesn't actually *use* the `constructor` property for anything, even though it creates it).

http://stackoverflow.com/comment/45077534
type: Comment
has text: Thanks, but this is not helping either. I put together this plunk to demonstrate my problem: http://plnkr.co/edit/rLZECVQin2ArVUoAxVYV?p=preview
comment on: http://stackoverflow.com/a/28366712
score: 0
type: AnswerComment

http://stackoverflow.com/q/28362392
has body: I have an ASP.Net MVC5 project running on IIS7 where I noticed a high (like 2 to 5 times as high) memory use as soon as I added an external javascript library. The app consumes about 100mb's of memory under normal circumstances, once the js is added it consumes 400 to 700 mb of memory on the server. I understand that using heavy js libs can have an impact on the client, but why and how can it cause such an impact on my server-memory? For reference, the library was kendo ui.
downvote count: 0
tagged with: javascript
tagged with: asp.net
favorite count: 0
tagged with: kendo-ui
answer count: 0
type: UnansweredQuestion
tagged with: iis
upvote count: 1
type: Question
has title: Impact of Javascript libraries on server side memory
score: 1

http://stackoverflow.com/a/28313997
answers question: http://stackoverflow.com/q/28313544
downvote count: 0
has comment: http://stackoverflow.com/comment/44995056
has body: Just taking a quick peek at the module's definition on Github, it appears that the datatables module takes a dependency on the datatables.directives and datatables.factory defined (also in the git repository). The datatables.directives in turn has other dependencies (e.g. datatables.renderer, datatables.options, etc. I believe your best bet in getting the main datatables module up and running is to first load the 'leaf' scripts of datatables (i.e. the scripts that have no dependencies), followed by the datatables.renderer (which only has dependencies on the 'leaf' scripts), followed by the datatables.directives script, then finally load the datatables script. So it would look something like this: ` `
type: Answer
score: 3
upvote count: 3

http://stackoverflow.com/comment/45103696
score: 0
type: Comment
has text: Thank you, but this is not the issue. I am trying to change active element my scrolling through the content of page.
comment on: http://stackoverflow.com/a/28382473
type: AnswerComment

http://stackoverflow.com/comment/45123679
type: Comment
score: 0
type: AnswerComment
has text: How would one go about? If I wrap an additional hyperlink around `Word 2`, there appears a link; but when clicked, it seems to redirect to the same hyperlink of `Word 1` and `Word 3`, instead of to a different webpage.
comment on: http://stackoverflow.com/a/28393255

http://stackoverflow.com/q/28303035
type: UnansweredQuestion
tagged with: requirejs
has title: requirejs how to access required object
type: Question
has body: I have: define(['jquery', 'kendo', 'util/addMenu', 'config'], function ($, kendo, addMenu, config) { var obj = { paymentTermsFilterUI: function (e) { e.kendoDropDownList({ dataSource: config.filters.paymentterms, optionLabel: "Select payment term", dataTextField: "text", dataValueField: "id", change: function (e) { obj.setInternalFilter('termId', 'eq', this.value()) } }); }, } But it is telling me that config is undefined. How can I get access to config? config: require.config({ baseUrl: '/laravel/public/js/app', paths: { jquery: '/laravel/public/js/jquery/jquery', bootstrap: '../bootstrap/bootstrap.min', kendo: '../kendo/kendo.all.min', kendo_culture: '../kendo/kendo-culture-en-GB', typeahead: '../typeahead', text: '../text', handlebars: '../handlebars/handlebars', io: 'http://view.euautomation.com:8008/socket.io/socket.io' }, shim: { "bootstrap": { deps: ["jquery"] }, "kendo": { deps: ["jquery"] }, "kendo_culture": { deps: ["kendo"], exports: 'kendo' }, "typeahead": { deps: ["jquery"] } }, filters: { conditions: [ {"id": 1, "condition": "New"}, {"id": 4, "condition": "New - FS"}, {"id": 6, "condition": "New in box"}, {"id": 5, "condition": "Refurbished"} ], leadtimes: [ {"id": 1, "name": "Not set"}, {"id": 2, "name": "Same day"}, {"id": 3, "name": "Next day"}, {"id": 4, "name": "2-3 days"}, {"id": 5, "name": "3-5 days"}, {"id": 6, "name": "5-7 days"}, {"id": 7, "name": "7-10 days"}, {"id": 8, "name": "3-4 weeks"}, {"id": 9, "name": "5-6 weeks"}, {"id": 10, "name": "9 weeks"}, {"id": 11, "name": "10-14 days"}, {"id": 12, "name": "7-8 weeks"}, {"id": 13, "name": "2-3 weeks"}, {"id": 14, "name": "48 hours"}, {"id": 15, "name": "10-12 weeks"} ], warranties: [ {"id": 1, "warranty": "None"}, {"id": 2, "warranty": "1 Month"}, {"id": 3, "warranty": "3 Months"}, {"id": 4, "warranty": "6 Months"}, {"id": 5, "warranty": "12 Months"}, {"id": 6, "warranty": "Lifetime"}, {"id": 7, "warranty": "24 Months"}, {"id": 8, "warranty": "DOA"}, {"id": 9, "warranty": "14 days"} ], paymen…
answer count: 1
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28303504

http://stackoverflow.com/comment/45195693
score: 2
has text: What promise library does have a `Promise` constructor and a `.promise()` method?
type: AnswerComment
comment on: http://stackoverflow.com/a/28432512
type: Comment

http://stackoverflow.com/comment/44970345
score: 0
has text: What do you mean with "But when I try to re-map the javascript to the buttons, it won't work"?
comment on: http://stackoverflow.com/q/28309646
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28324178
type: Answer
has body: Because SVG is not an input-type, listen for the event on the window instead: $(window).on('keypress', function (evt){ ... })
upvote count: 11
downvote count: 1
answers question: http://stackoverflow.com/q/28323977
score: 10
accepted answer of: http://stackoverflow.com/q/28323977
type: AcceptedAnswer

http://stackoverflow.com/a/34032652
score: 2
downvote count: 0
has body: i give you my code thats works great for me. Before using it in the app following is very important to work: you use cordova/phonegap camera plugin : cordova-plugin-camera so you have to set the option by capturing the image following the get base64 encoded image navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 20, allowEdit: true, destinationType: destinationType.DATA_URL }); the function onPhotoDataSuccess function onPhotoDataSuccess(imageData) { upladImage(imageData); } the function uploadImage function upladImage(imageData){ $.ajax({ type: "POST", url: "http://localhost/upload/up.php", data: {img_data:imageData}, cache: false, contentType: "application/x-www-form-urlencoded", success: function (result) { alert("upload OK: "+ result); } }); } img_data is the $_POST[img_data] variable on the server side PHP code On server side (simple code) #from ajax post request save the post variable to $img $img = $_POST["img_data"]; #folder to upload chmod 777 !!! define('UPLOAD_DIR', 'images/'); #filename will be generated by timestamp $file = UPLOAD_DIR . time() . '.jpg'; #replace data header $img = str_replace('data:image/png;base64,', '', $img); #replace empty space $img = str_replace(' ', '+', $img); #base64 decode $data = base64_decode($img); #save the file $success = file_put_contents($file,$data); #give feedback to your APP if($success) echo "upload successfully"; else echo "an error occours while saving file"; the ajax post request method is a good alternative to file transfer plugin upload function because some android version have problem with the file transfer upload function. (so it was my experience) also important: you have to include cordova and jquery library in your html file.
upvote count: 2
answers question: http://stackoverflow.com/q/28280287
type: Answer

http://stackoverflow.com/comment/44972533
type: AnswerComment
has text: No I'm suggesting that you take your code out of it. It has nothing to do inside the call to foundation.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28310835

http://stackoverflow.com/comment/45115997
type: Comment
type: QuestionComment
has text: directive would be the right way to go about this.
score: 1
comment on: http://stackoverflow.com/q/28389226

http://stackoverflow.com/a/28300475
score: 1
upvote count: 1
has body: You may need to create an attribute-value-function map like this: var map = { 'label': function(value) { return function(el) { el.text(value); }; }, 'color': function(value) { return function(el) { el.css('color', value); }; }, 'children': function(items) { return function(el) { items.forEach(function(item) { var child = create(item); el.append(child); }); }; } }; Then you may create an initializer-function: function create(markup) { var el = $('&lt;div&gt;'); var actions = []; for (var key in markup) { var value = markup[key]; var act = map[key](value); actions.push(act); } actions.forEach(function(act) { act(el); }); return el; } And finally call: $('body').append(create(markup));
downvote count: 0
answers question: http://stackoverflow.com/q/28299901
type: Answer

http://stackoverflow.com/comment/44943647
has text: Hmm...the problem is that I need to use tr and td. Is there really no way? If tbody can't be adjust can we choose some other space as the sortable zone?
type: Comment
comment on: http://stackoverflow.com/a/28290124
score: 0
type: AnswerComment

http://stackoverflow.com/q/28404179
tagged with: javascript
has body: I have 3 shop location that I wanted to show in google map. I have separate it into 3 tab and 3 google map. It was working fine at the 1st tab. But the 2nd tab and 3rd tab is not load properly. It was working fine without the tabs. I found some blog that tabs require to refresh? I am not sure how to do so but i tried and getting error. Anyone can help me out ? Thanks Here below is my tab code:- CITY BOX HILL FOREST HILL Google map function : -
tagged with: google-maps-api-3
score: 0
answer count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: tabs
has title: Google map is not load properly in tab 2 and tab 3. How to create refresh tabs?
upvote count: 1
has answer: http://stackoverflow.com/a/28404733
downvote count: 1
type: Question

http://stackoverflow.com/comment/45208786
comment on: http://stackoverflow.com/q/28420117
type: QuestionComment
type: Comment
score: 0
has text: We are using cookie based authentication. Not token based.

http://stackoverflow.com/comment/44947930
type: Comment
has text: Uncaught TypeError: Cannot read property 'addEventListener' of null i m still getting this error
comment on: http://stackoverflow.com/a/28297850
score: 0
type: AnswerComment

openlayers-3
type: Tag
tags question: http://stackoverflow.com/q/28379685
tag name: openlayers-3
tags question: http://stackoverflow.com/q/28309194
tags question: http://stackoverflow.com/q/28341716

http://stackoverflow.com/q/28359761
tagged with: javascript
has answer: http://stackoverflow.com/a/28359875
score: 0
answer count: 2
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28359875
has comment: http://stackoverflow.com/comment/45062470
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has body: I am trying to make a quiz using jQuery, and am pulling the questions and answers from an external Json file. My problem is that my foreach loop only prints out the last element in the Json item. This is my Jquery: function postData(data) { var html = ""; $.each(data, function(key, value) { html += "&lt;ul&gt;&lt;h3&gt;&lt;span&gt;" + key + "&lt;/span&gt;&lt;/h3&gt;"; $.each(value.answers, function(i, j){ html += "&lt;li&gt;" + j.answer + "&lt;/li&gt;"; }); html += "&lt;/ul&gt;"; }); $('#content').append(html); }; And an example of the data in my Json File is: { "Question Title": { "answers": [{ "answer" : "answer one", "answer" : "answer two", "answer" : "answer three", "answer" : "answer four" }] }, "Question title two": { "answers": [{ "answer" : "True", "answer" : "False" }] } } However the only answers I get are: Question title - answer 4 Question title two - False Am I just trying loop through them oddly or am I not printing the objects properly? Let me know if you need me to clarify on anything. Thank you.
has title: jQuery .each() only prints last item from external Json
possible better answer: http://stackoverflow.com/a/28359993
type: Question
has answer: http://stackoverflow.com/a/28359993

http://stackoverflow.com/a/28426813
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28426499
has comment: http://stackoverflow.com/comment/45313101
has comment: http://stackoverflow.com/comment/45313779
has comment: http://stackoverflow.com/comment/45383224
upvote count: 2
answers question: http://stackoverflow.com/q/28426499
has comment: http://stackoverflow.com/comment/45321655
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45312384
type: Answer
has body: You can use file streams to put all output from spawned hark to g.xml. Example: // don't need "&gt;" in args var args = [' 02:00:00:00' ,'-s','pdml'], logStream = fs.createWriteStream('./xml'); var spawn = require('child_process').spawn, child = spawn('tshark', args); child.stdout.pipe(logStream); child.stderr.pipe(logStream); child.on('close', function (code) { console.log('child process exited with code ' + code); }); Because of child here is a stream, you can just pipe it into your logged file stream.
has comment: http://stackoverflow.com/comment/45404293

http://stackoverflow.com/comment/45042806
type: QuestionComment
comment on: http://stackoverflow.com/q/28349445
score: 0
type: Comment
has text: [See Rule #3 of the Owasp guide](https://www.owasp.org/index.php/DOM_based_XSS_Prevention_Cheat_Sheet).

http://stackoverflow.com/a/28291288
score: 1
type: AcceptedAnswer
upvote count: 1
has body: Using index position i, as in race_color(i) doesn't work because at times, when i is 0 race is "Black" (groups A, C), and in another case it's "White" (group B). Instead, key the colors by the actual race value race_color(d.race), which remains consistent across groups.
accepted answer of: http://stackoverflow.com/q/28288706
answers question: http://stackoverflow.com/q/28288706
type: Answer
downvote count: 0

http://stackoverflow.com/q/28352160
has comment: http://stackoverflow.com/comment/45060962
type: Question
linked to: http://stackoverflow.com/q/194397
tagged with: javascript
linked to: http://stackoverflow.com/q/3793246
accepted answer: http://stackoverflow.com/a/28352906
possible better answer: http://stackoverflow.com/a/28352777
upvote count: 2
tagged with: security
has title: javascript client side security
answer count: 2
linked to: http://stackoverflow.com/q/162159
downvote count: 0
has answer: http://stackoverflow.com/a/28352906
favorite count: 0
tagged with: parse-platform
has answer: http://stackoverflow.com/a/28352777
linked to: http://stackoverflow.com/q/6697181
type: AnsweredQuestion
score: 2
has body: I'm concerned about javascript security as client can view and edit code, I know to overcome this we can use ajax calls to run critical process on server. But recently I was going through parse cloud code, a part of it runs on server. I would like to know if that's the answer to javascript security concerns and is it safe?
has comment: http://stackoverflow.com/comment/45048235

http://stackoverflow.com/q/28293545
downvote count: 0
tagged with: javascript
favorite count: 0
has body: I am using a webview and want to load a JScode to show in that webview. However I am getting a problem above API16.It never loads the JS page. It gives me an error: Here is my code: @JavascriptInterface public void loadWebviewUrl(){ Map &lt;String, String&gt; extraEncryptionHeaders = new HashMap&lt;String, String&gt;(); extraEncryptionHeaders.put("X-APP-DEVICETYPE", "ANDROID"); appVersionname=CommonMethods.getAppVersion(WebPayUActivity.this); extraEncryptionHeaders.put("X-APP-APPVERSIONNAME", appVersionname); extraEncryptionHeaders.put("X-DEVICE", Constant.ANDROIDID); extraEncryptionHeaders.put(Constant.HEADER_SECURITY_KEY, Constant.SECURITY_HASH_VALUE); mWebView.loadUrl(mPayUrl, extraEncryptionHeaders); **//getting error in this line that has been mentioned above** mWebView.addJavascriptInterface(new Wscript(WebPayUActivity.this), "Android"); screenDpi=CommonMethods.getResoltuion(this); mWebView.setWebViewClient(new MyWebViewClient(this)); mImageView.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { customAlertDialog(); } }); mWebView.setWebChromeClient(new WebChromeClient()); } After reading the solutions at different sites I got to know to add annotation. But after writing the annotation, the error is still the same. Can anyone please check and help me back Thanks
upvote count: 8
tagged with: android
score: 8
has answer: http://stackoverflow.com/a/28862780
tagged with: webview
type: Question
accepted answer: http://stackoverflow.com/a/28862780
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28293847
tagged with: java
has answer: http://stackoverflow.com/a/28293847
has title: None of the methods in the added interface have been annotated with @android.webkit.JavascriptInterface; they will not be visible in API 17
answer count: 2

http://stackoverflow.com/q/28379922
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/28381673
tagged with: mongoose
tagged with: javascript
has answer: http://stackoverflow.com/a/28381673
score: 0
has answer: http://stackoverflow.com/a/28410043
tagged with: promise
has body: I am using mongoose with bluebird initializing with promisifyAll. It's cool and I'm loving promises. But mongoose's model.save() returns a function signature like (err, user, numAffected) so bluebird's model.saveAsync() returns a two-element array rather than the obvious result alone. This makes chaining inconvenient so I've taken to making little helper functions like this: function saveUser(user) { return user.saveAsync() .spread(function (user, numAffected) { return user; }); } It would be much easier to add this at the time of promisification to the mongoose prototype and only have to do it once in the entire application... but I have no idea how.
has title: How to extend Mongooose prototype with better saveAsync
type: AnsweredQuestion
tagged with: bluebird
accepted answer: http://stackoverflow.com/a/28410043

http://stackoverflow.com/comment/45111697
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28386580
has text: @aweeeezy also try this code to debug: `var html = key+" "+val+" "` and send screenshot

http://stackoverflow.com/a/28395113
has comment: http://stackoverflow.com/comment/45127390
type: Answer
has body: This is tricky because you're attempting to modify data outside of Angular's "world". It seems easy enough to do, but because you're creating elements that are bound to Angular, it's taking some liberties with the content that can go in there, or rather how it's "rendered" by Angular. tl;dr; - you need to use the $sce provider with Angular inside a controller in order to "trust" new content as HTML; use $sce.trustAsHtml(content). Best approach would be to actually create a controller here and attach it to your form with ng-controller. The trick will be to use ng-change on the textarea to hook to the text changing instead of using jQuery. From a recently converted hardcore jQuery guy to one who now prefers to live inside Angular's "world", I can tell you that using events, controllers, and http.get has a lot of similarities and is easy to work with. Here's some pseudo-code to quickly get you going: HTML Pseudo Markup: &lt;form ng-controller="myController as ctrl"&gt; ... &lt;textarea ... ng-model="textinput" ng-change="ctrl.updateLength()"&gt;&lt;/textarea&gt; &lt;span ng-bind-html="ctrl.textRemainingDisplay"&gt; &lt;/form&gt; Notice ng-model in there - we'll use that in the change event handler. The other critical piece is the display, which we us ng-bind-html; the $sce provider below will give us a render in the format needed to bind without any further ado. Javascript Pseudo markup: angular.module("myModule",[]).controller("myController", function($scope, $http, $sce) { this.updateLength = function() { this.textRemainingDisplay = $sce.trustAsHtml(500-this.textinput.length); } }); You could [probably should] use a directive to do the same thing, I just think as someone who's also learning Angular that controllers are a little easier to digest. Difference would be some syntax on the controller (using directive instead and returning an object) and then the markup on the span would go something like &lt;span mydirective&gt;&lt;/span&gt; and the created directive would…
has comment: http://stackoverflow.com/comment/45128547
downvote count: 0
answers question: http://stackoverflow.com/q/28394378
score: 1
upvote count: 1

http://stackoverflow.com/q/28281415
tagged with: http://stackoverflow.com/tag/html
has title: firefox bug - Options disappeared on hover
possible better answer: http://stackoverflow.com/a/28282010
has answer: http://stackoverflow.com/a/28282010
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/28282223
score: 0
answer count: 2
has body: Firefox represents a bug when I insert a select box on mouseenter event. The whole dropdown list is gone on hover. How can I fix this bug? document.querySelector('#test').addEventListener('mouseenter',function(){ this.innerHTML = ' 2 3 '; }); #test{ width: 100px; height: 100px; background-color: #000; }
has answer: http://stackoverflow.com/a/28282223
tagged with: firefox
tagged with: javascript
tagged with: drop-down-menu

http://stackoverflow.com/a/28332298
type: Answer
has comment: http://stackoverflow.com/comment/45022616
accepted answer of: http://stackoverflow.com/q/28324292
has body: You're trying to loop a char. This for loop will run 0 times. Try with this javascript. Your loop also wanted to iterate between 9-22. I guess ids are not only between 9-22. So do it for all applicable div>p jQuery(function ($) { $('div.span12 &gt; p').find('a[href]').attr('href', '#lock'); $('div.span12 &gt; p').find('i.cercale2').replaceWith('&lt;i class="cercale2 fa fa-lock fa-1x"&gt;&lt;/i&gt;') });
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45023875
score: 0
answers question: http://stackoverflow.com/q/28324292

http://stackoverflow.com/comment/45165363
comment on: http://stackoverflow.com/q/28415958
score: 0
type: Comment
type: QuestionComment
has text: i want to select specific dates not continous

http://stackoverflow.com/comment/44955116
type: Comment
score: 0
has text: How are you adding the circle's bounds to the `markerBounds` bounds?
comment on: http://stackoverflow.com/q/28300539
type: QuestionComment

http://stackoverflow.com/comment/45172267
comment on: http://stackoverflow.com/a/28419468
score: 0
type: AnswerComment
type: Comment
has text: Okay so I see this working now, however, I still get nothing returned from my console.log on line 9 of Feeds.js, is there anything I need to do in Reddit.js?

http://stackoverflow.com/q/28359690
has title: SVG polygon shape from latLngs
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45088792
has comment: http://stackoverflow.com/comment/45088893
has comment: http://stackoverflow.com/comment/45066766
downvote count: 0
score: 1
tagged with: latitude-longitude
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
tagged with: geography
type: Question
tagged with: d3.js
has comment: http://stackoverflow.com/comment/45088522
has body: I am trying to write a Javascript function which will allow me to enter any set of bounds and get back a shape of that area (for example provide the bounds of Kansas and get back its shape). I already have the bounds and know that I can create an svg polygon and set its points attribute to the bounds array (converted to a string). I also understand that since the points are really latLngs I should set the viewBox attr to the bounds of the entire world (so that I can truly enter in any set of coordinates). What I am having trouble understand is how I can effectively "zoom in" so that I can actually see the shape. With the function below I am successfully getting it to render but it is incredibly small and I am unsure of how to have it fit as much of the box as possible? I began looking at D3 but then wasn't sure that was the best solution as I am not trying to put these on a map, I am just trying to draw them. var pointsData = function(bounds) -&gt; points = [] i = 0 while i &lt; bounds.length points.push bounds[i].lat + ' ' + bounds[i].lng i++ return points.toString().replace(",", "");; and then setting the points attr of a given svg to the result of the pointsData function. EDIT > Solution: Ended up using HTML5 Canvas and map projector function: http://jsfiddle.net/xtjgwa45/1/
answer count: 0
upvote count: 1
has comment: http://stackoverflow.com/comment/45066653

http://stackoverflow.com/a/28453051
has comment: http://stackoverflow.com/comment/45247796
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: As gskinner pointed out, the problem can be reproduced on other websites. It can also be reproduced on pages that only use a single audio resource. The problem is specific to Chrome 40 (or at least very recent versions of Chrome). It is not specific to certain versions of SoundJS. Using another browser seems to be the only solution.
answers question: http://stackoverflow.com/q/28400437
has comment: http://stackoverflow.com/comment/45531417
upvote count: 3
score: 3
accepted answer of: http://stackoverflow.com/q/28400437

http://stackoverflow.com/comment/137693694
score: 0
type: Comment
type: QuestionComment
has text: Does this answer your question? [Running a shell command from Node.js without buffering output](https://stackoverflow.com/questions/9777215/running-a-shell-command-from-node-js-without-buffering-output)
comment on: http://stackoverflow.com/q/28426499

http://stackoverflow.com/comment/45147237
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28406403
score: 0
has text: Hi, should have said that .parent() will not work in this instance as some of the pages, the img has a wrapping a href tag around it which will remove this element rather than the td. So it really needs to find the closest td

http://stackoverflow.com/comment/44923746
type: AnswerComment
has text: Thanks - what is the binding syntax when using `observableModel` ? e.g. what should `data-bind="value: propertyName"` become when using the new model?
type: Comment
comment on: http://stackoverflow.com/a/28284173
score: 0

http://stackoverflow.com/a/28416522
type: Answer
has comment: http://stackoverflow.com/comment/45166994
score: 3
upvote count: 3
has body: The W3 actually lists both methods in their spec of the Window interface: http://www.w3.org/TR/cssom-view/#extensions-to-the-window-interface You can safely use either one.
accepted answer of: http://stackoverflow.com/q/28416343
downvote count: 0
answers question: http://stackoverflow.com/q/28416343
has comment: http://stackoverflow.com/comment/45178066
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45167060
has comment: http://stackoverflow.com/comment/45179077

http://stackoverflow.com/a/28417747
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45169161
answers question: http://stackoverflow.com/q/28417716
score: 4
upvote count: 4
accepted answer of: http://stackoverflow.com/q/28417716
has body: You need call function, add () to myFunc. In your example you added reference to internal function. document.getElementById("demo").innerHTML = "My father is " + myFather.name().myFunc(); Also add return to myFunc. To get properties from parent scope - save reference to this person.prototype.name = function () { var _this = this; return { myFunc: function () { return _this.firstName + " " + _this.lastName; } } }; Example

http://stackoverflow.com/a/28296473
score: 3
type: AcceptedAnswer
downvote count: 0
has body: How can a browser extension (such as firefox add-on, chrome extension) talk to the backend Java programs? In the case of a firefox extension it's quite simple, you have pretty much the same privileges as the browser itself. I.e. you can just open sockets, access the filesystem or maybe even use named pipes. I.e. all the usual IPC mechanisms. I don't know much about the chrome APIs except that they're more restrictive. But I assume that at the least they can create HTTP requests. So at the very least you can simply do JSON or XML-based message passing via HTTP requests to your server application. For the server-side technology you likely want to use whatever provides a simple REST API to address form the client side.
accepted answer of: http://stackoverflow.com/q/28294349
type: Answer
answers question: http://stackoverflow.com/q/28294349
upvote count: 3
has comment: http://stackoverflow.com/comment/44980789
has comment: http://stackoverflow.com/comment/44978128

http://stackoverflow.com/comment/45148425
type: AnswerComment
comment on: http://stackoverflow.com/a/28405746
type: Comment
has text: I have updated the answer.Check the links mate.It will definitely help u.If you found the answer helpful do accept it.It might help other too..
score: 0

http://stackoverflow.com/comment/44944917
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28293339
has text: Are you not able to detect session across windows

http://stackoverflow.com/a/28380685
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28380641
type: Answer
has body: Try using the keyup function instead (although you might not want to listen for key* events at all, see below): $('#padd').keyup(function(){ var ypoints = 200; var points = parseInt($(this).val()); console.log("Points: "+(points+ypoints)); }); Instead of keyup, you should listen for the explicit input event: $('#padd').on("input", function(){ var ypoints = 200; var points = parseInt($(this).val()); console.log("Points: "+(points+ypoints)); }); An example when listening for the input event trumps using keyup is when using an input of type number. In a (not so) modern browser, this adds a stepper to the input field, which you can use to increment or decrement the inputs value by 1 using your mouse. This does not fire the keyup event (no keys are pressed) but nevertheless changes the value. It is really a matter of when certain events are fired and the state of the input's value at that time. There is an explanation on quirksmode.org: keyup Fires when the user releases a key, after the default action of that key has been performed. and more information on the input event on MDN: The DOM input event is fired synchronously when the value of an or element is changed.
upvote count: 3
score: 3
answers question: http://stackoverflow.com/q/28380641

http://stackoverflow.com/comment/45058714
comment on: http://stackoverflow.com/q/28357602
has text: @ribsies If there is no `navbar-fixed-top` class applied, it is same height. But once it is applied, it is floating and the height is not the same.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28306805
type: Answer
has comment: http://stackoverflow.com/comment/44964930
has body: It is because the innerHtml contains 2 new line characters at the begin and end of the span1 variable just after var span1 = document.getElementById("box").innerHTML; try and add: alert('|' + span1 + '|'); and you will se exactly what I am refering about. You could use span1.trim() to remove the whitespace before and after that string in JS.
answers question: http://stackoverflow.com/q/28306486
score: 1
has comment: http://stackoverflow.com/comment/44964604
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44965093

http://stackoverflow.com/comment/45160681
score: 5
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28413663
has text: The XMLHttpRequest object is better than opening a window.

http://stackoverflow.com/comment/45077520
comment on: http://stackoverflow.com/a/28367745
type: AnswerComment
score: 0
type: Comment
has text: The one problem I now have is that the links are not preserved the next time I click the button. How would I ensure that the links are preserved and the next set of links are merely appended to the page?

http://stackoverflow.com/a/28413996
has comment: http://stackoverflow.com/comment/45176896
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/45163871
accepted answer of: http://stackoverflow.com/q/28413791
answers question: http://stackoverflow.com/q/28413791
has body: 1) Create an array to hold your markers var markers = []; 2) Push each marker to the array when you add them to the map var marker = new google.maps.Marker({ position: markerCoords, map: map }); markers.push(marker); 3) When you need to remove them, iterate through your array and call setMap(null) on each marker for (var i=0; i&lt;markers.length; i++) { markers[i].setMap(null); } Hope this helps. JSFiddle demo Edit: Here is your code updated with my modifications. I guess you periodically call the loadXMLFile() function (?). var map = null; var markers = []; function initialize() { var mapOptions = { zoom: 12, center: new google.maps.LatLng(53.3478, -6.2597) //center over dublin }; map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); loadXMLFile(); } function loadXMLFile() { for (var i = 0; i &lt; markers.length; i++) { markers[i].setMap(null); } var filename = 'data.xml'; $.ajax({ type: "GET", url: filename, dataType: "xml", success: parseXML, error: onXMLLoadFailed }); function onXMLLoadFailed() { alert("An Error has occurred."); } function parseXML(xml) { var bounds = new google.maps.LatLngBounds(); $(xml).find("marker").each(function () { //Read the name, address, latitude and longitude for each Marker var nme = $(this).find('name').text(); var address = $(this).find('address').text(); var lat = $(this).find('lat').text(); var lng = $(this).find('lng').text(); var markerCoords = new google.maps.LatLng(parseFloat(lat), parseFloat(lng)); bounds.extend(markerCoords); var marker = new google.maps.Marker({ position: markerCoords, map: map }); markers.push(marker); }); map.fitBounds(bounds); } } google.maps.event.addDomListener(window, 'load', initialize);
has comment: http://stackoverflow.com/comment/45163697
has comment: http://stackoverflow.com/comment/45166424
has comment: http://stackoverflow.com/comment/45163790
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45163669
score: 1

android
tags question: http://stackoverflow.com/q/28320135
tags question: http://stackoverflow.com/q/28427540
tags question: http://stackoverflow.com/q/28329948
tags question: http://stackoverflow.com/q/28372873
tags question: http://stackoverflow.com/q/28294994
tags question: http://stackoverflow.com/q/28434344
tags question: http://stackoverflow.com/q/28328024
tags question: http://stackoverflow.com/q/28405563
tags question: http://stackoverflow.com/q/28350598
tags question: http://stackoverflow.com/q/28320088
tags question: http://stackoverflow.com/q/28336573
tags question: http://stackoverflow.com/q/28362984
tags question: http://stackoverflow.com/q/28373349
tags question: http://stackoverflow.com/q/28431935
tags question: http://stackoverflow.com/q/28402850
tags question: http://stackoverflow.com/q/28406168
tags question: http://stackoverflow.com/q/28324598
tags question: http://stackoverflow.com/q/28295678
tags question: http://stackoverflow.com/q/28396534
tags question: http://stackoverflow.com/q/28417252
tags question: http://stackoverflow.com/q/28320640
tags question: http://stackoverflow.com/q/28300131
tags question: http://stackoverflow.com/q/28293656
tags question: http://stackoverflow.com/q/28328452
tags question: http://stackoverflow.com/q/28433197
tags question: http://stackoverflow.com/q/28373623
tags question: http://stackoverflow.com/q/28360074
tags question: http://stackoverflow.com/q/28391984
tags question: http://stackoverflow.com/q/28398104
tags question: http://stackoverflow.com/q/28355453
tags question: http://stackoverflow.com/q/28429673
tags question: http://stackoverflow.com/q/28293967
tags question: http://stackoverflow.com/q/28298864
tags question: http://stackoverflow.com/q/28309556
tags question: http://stackoverflow.com/q/28283481
tags question: http://stackoverflow.com/q/28313579
tags question: http://stackoverflow.com/q/28288270
tags question: http://stackoverflow.com/q/28433343
tags question: http://stackoverflow.com/q/28397389
tags question: http://stackoverflow.com/q/28353067
tags question: http://stackoverflow.com/q/28369123
tags question: http://stackoverflow.com/q/28336709
tags question: http://stackoverflow.com/q/28350584
tags question: http://stackoverflow.com/q/28407411
tags question: http://stackoverflow.com/q/28404948
tags question: http://stackoverflow.com/q/28394045
tags question: http://stackoverflow.com/q/28404318
tags question: http://stackoverflow.com/q/28343124
tags question: http://stackoverflow.com/q/28341289
tags question: http://stackoverflow.com/q/28341694
tags question: http://stackoverflow.com/q/28342402
tag name: android
tags question: http://stackoverflow.com/q/28333397
tags question: http://stackoverflow.com/q/28317943
type: Tag
tags question: http://stackoverflow.com/q/28293545

http://stackoverflow.com/a/28303418
answers question: http://stackoverflow.com/q/28303059
type: Answer
has body: Each function is overridding the results of the other so no matter what happens the last to run will win and you'll never see the result of the first. By changing each function to return a boolean you can make sure you only call the second if the first has passed. $(document).on('change', '.document_file_field', function() { var input = $(this); if(file_size_check(input)) { file_extension_check(input_field); } }); var file_extension_check = function(input_field) { var file_name = input_field.val(); var extension = file_name.replace(/^.*\./, ''); extension.toLowerCase(); var validExtensions = ['jpg', 'jpeg', 'gif', 'png', 'docx', 'mp4', 'pdf']; if ($.inArray(extension, validExtensions) == -1) { input_field.prev('.custom-file-upload.btn').removeClass('btn-info').addClass('btn-danger'); input_field.parent('.upload_document').find('.js-error').text(extension + ' file formats are not allowed'); input_field.parent('.upload_document').find('.btn-success').attr('disabled', 'disabled'); return false; } else { input_field.prev('.custom-file-upload.btn').removeClass('btn-danger').addClass('btn-info'); input_field.parent('.upload_document').find('.js-error').empty(); input_field.parent('.upload_document').find('.btn-success').removeAttr('disabled'); return true; } } var file_size_check = function(input) { var raw_file_size = input[0].files[0].size var file_size_mb = (Math.round((raw_file_size / 1024 / 1024) * 100) / 100) if (raw_file_size &gt;= 1000000) { input.prev('.custom-file-upload.btn').removeClass('btn-info').addClass('btn-danger'); input.parent('.upload_document').find('.js-error').text('File Size to large - Must be under 1mb'); input.parent('.upload_document').find('.btn-success').attr('disabled', 'disabled'); return false; } else { input.prev('.custom-file-upload.btn').removeClass('btn-danger').addClass('btn-info'); input.parent('.upload_document').find('.js-error').empty(); input.parent('.upload_document').find('.btn-success').removeAttr('disabled'); return true; } }
has comment: http://stackoverflow.com/comment/44958388
upvote count: 1
score: 1
downvote count: 0

http://stackoverflow.com/comment/45116109
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28389216
has text: My solution would be to wrap the plugin in an immediately invoked function expression... `(function($) { ... /* plugin code */ ... })(jQuery)`
score: 0

http://stackoverflow.com/q/28345683
score: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45037148
has answer: http://stackoverflow.com/a/28346636
has comment: http://stackoverflow.com/comment/45036968
has comment: http://stackoverflow.com/comment/45035907
has body: Is there any way to use JavaScript's OnUnload() function to find out which URL the user is navigating away to? For example, if my code is in page1.html, and the user clicks a link to http://example.com, is there any way for JavaScript code present in page1.html, to retrieve the URL "http://example.com" and display/store it before the page unloads? I am able to do this if I invoke a function through my link by using its OnClick, but I cannot find a way to do this otherwise. (I can post my code for that if needed, but it does meet my business requirement) EDIT : This looks to be impossible, since my business requirement demands that I do not make any change to the content of the page, excepting the adding in of a javascript file where this code is present.
has title: Javascript - Get URL being navigated to
has answer: http://stackoverflow.com/a/28347412
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45037186
tagged with: javascript
has comment: http://stackoverflow.com/comment/45036477
tagged with: jquery
has comment: http://stackoverflow.com/comment/45036688
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45036009
has comment: http://stackoverflow.com/comment/45035525
has comment: http://stackoverflow.com/comment/45035805

http://stackoverflow.com/a/28380408
upvote count: 1
has body: HTML button My button Jquery $('#my_button').bind('click', function() { var value = $(this)val(); var whatever = $(this).data('whatever'); var id = $(this).data('id'); var values = $(this).data('values'); console.log(value); console.log(whatever); console.log(id); console.log(values); }); Open Firefox > Inspect Element > Console Tab. Load the codes Click the button See response
answers question: http://stackoverflow.com/q/28379939
downvote count: 0
type: Answer
score: 1

http://stackoverflow.com/comment/45118890
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28390358
score: 0
has text: @MikkoOhtamaa: yes, good point. I meant as fast as the device can go, which if the refresh rate is 60, is 60. i could have been more clear, but if the CPU is getting flooded, then OP is unlikely to be actually seeing 60 updates a second, and scheduling around, say 20FPS, would lower the CPU use... afaik, there is no way to adjust RAF's 'target FPS' yourself.

http://stackoverflow.com/q/28383091
has comment: http://stackoverflow.com/comment/45386139
score: 0
has comment: http://stackoverflow.com/comment/45104450
has comment: http://stackoverflow.com/comment/45377499
possible better answer: http://stackoverflow.com/a/28528862
has answer: http://stackoverflow.com/a/28528862
answer count: 4
favorite count: 0
has answer: http://stackoverflow.com/a/28529214
tagged with: regex
has comment: http://stackoverflow.com/comment/45104447
has answer: http://stackoverflow.com/a/28383151
has comment: http://stackoverflow.com/comment/45398154
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45387574
accepted answer: http://stackoverflow.com/a/28529214
has answer: http://stackoverflow.com/a/28535979
has title: Remove and replace characters by regex
upvote count: 3
downvote count: 3
type: Question
has body: I'm trying to write a regex that makes the next things: _ -> replace it by a space + -> remove it if there is not another + after it (i.e. c++ => c++. c+ -> c) ' -> remove it if it's in the start or end of the word (i.e. Alin's -> Alin's. 'Alin's -> alin's) &amp;, -, ., ! - Don't remove. Another special characters - remove I want to do it by passing one time the string for example: Input: "abc's, test_s! &amp; c++ c+ 'Dirty's'. and beautiful'..." Output: "abc's test s! &amp; c++ c Dirty's. and beautiful..." Explanation: char `'` in `abc's,` stays because `3` char `,` in `abc's,` was removed because `5` char `_` in `test_s!` was replaced by space because `1` char `!` in `test_s!` is not removed because `!` char `&amp;` is not removed because `4` char `+` in `c++` is not removed because `2` char `+` in `c+` was removed because `2` word: `'Dirty's'.` was replaced to `Dirty's.` because `3` and `4` char `'` in `beautiful'...` was removed because `3` char `.` is not removed because of `4` This is my javascript code: var str = "abc's test_s c++ c+ 'Dirty's'. and beautiful"; console.log(str); str = str.replace(/[_]/g, " "); str = str.replace(/[^a-zA-Z0-9 &amp;-.!]/g, ""); console.log(str); This is my jsfiddle: http://jsfiddle.net/alonshmiel/LKjYd/4/ I don't like my code because I'm sure that it's possible to do it by running one time over the string. Any help appreciated!
has comment: http://stackoverflow.com/comment/45371343
tagged with: javascript

http://stackoverflow.com/q/28325172
has title: Image refreshing with setInterval()
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44998104
score: 0
answer count: 2
has body: I have 4 div´s each contains an image item and a select list of 4 div-id. I want to refresh the images simultaneously by changing the source of each image every 2 seconds. I'm using setInterval() for each image and the problem is when I must stop all the timers at the same time. Should I make a timer variable per div/img? $(.div-id option:selected).each(function(){ var timer = setInterval(function(){ $(.div-id img).attr("src", "new-source-path"); },2000); }); How can I stop all the active timers at once without stopping every timer Id? Is there any solution with setTimeout() or any plugin to do that?
has comment: http://stackoverflow.com/comment/44998078
tagged with: setinterval
has comment: http://stackoverflow.com/comment/44998044
possible better answer: http://stackoverflow.com/a/28326206
has answer: http://stackoverflow.com/a/28325308
has answer: http://stackoverflow.com/a/28326206
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
tagged with: settimeout
has comment: http://stackoverflow.com/comment/44998487
type: Question
accepted answer: http://stackoverflow.com/a/28325308

http://stackoverflow.com/q/28402005
answer count: 3
has answer: http://stackoverflow.com/a/28402111
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28402031
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28402045
has title: select div but not inputs within div jquery
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28402045
has body: I'm trying to select a div for a click event but not the inputs within said div. I thought this would do it but it does not work. here is a demo. Thank you html &lt;div id = "test"&gt;&lt;input&gt;&lt;/div&gt; js $('#test:not(input)').click(function(){ alert(); });
score: 2
upvote count: 2
has answer: http://stackoverflow.com/a/28402031
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/45190563
score: 0
comment on: http://stackoverflow.com/q/28428945
type: Comment
type: QuestionComment
has text: @fef what about the definition of callback function. What is going to be performed when callback() function is invoked? do you want to create dynamic functions for each button?

http://stackoverflow.com/comment/45176942
score: 0
type: Comment
type: QuestionComment
has text: How does it fail? Is there an error in the Javascript console?
comment on: http://stackoverflow.com/q/28421917

http://stackoverflow.com/comment/44995635
has text: @karolkochan yea you are right it looks like this now http://pastebin.com/Nd21H2Qq but crash if it has more then one timesheet, think it is cause res.jsonp(timesheet), how do i change this to res after for each is done ? :)
comment on: http://stackoverflow.com/q/28303188
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28374604
type: Answer
accepted answer of: http://stackoverflow.com/q/28284765
upvote count: 7
answers question: http://stackoverflow.com/q/28284765
score: 7
type: AcceptedAnswer
has body: I've finally found a solution. The top of my iframe had a domain.location set to domain.com and my iframe a domain.location set to support.domain.com. Event though I still think that both belong to the same domain, browsers don't like it it seems so. Re-setting the domain.location did the work. To answer the ones asking about how to re-set location.domain, here is the snippet of code my team used to use. This is quite old (2y ago), not really optimized and we do not use it anymore, but I guess it's worth sharing. Basically, what we were doing is load the iframe with passing it top domain in the URL parameters. var topDomain = (function handleDomain(parameters) { if (typeof parameters === "undefined") { return; } parameters = parameters.split("&amp;"); var parameter = [], domain; for (var i = 0; i&lt;parameters.length; ++i) { parameter.push(parameters[i]); } for (var j = 0; j&lt;parameter.length; ++j) { if (parameter[j].indexOf("domain") &gt; -1) { domain = parameter[j]; break; } } if (typeof domain !== "undefined") { domain = domain.split("="); return domain[1]; } return; })(window.location.search), domain = document.domain; if (domain.indexOf(topDomain) &gt; -1 &amp;&amp; domain !== topDomain) { document.domain = topDomain; }
downvote count: 0
has comment: http://stackoverflow.com/comment/77295919

http://stackoverflow.com/q/28295292
tagged with: javascript
tagged with: github
has body: I have a yeoman generator installed globally on my system. I would like to use the "canary" branch of a yeoman project if I type $ yo into the console. Currently it uses the master branch. Anyone any hints?
tagged with: yeoman
favorite count: 0
score: 2
accepted answer: http://stackoverflow.com/a/28295524
has answer: http://stackoverflow.com/a/55948979
upvote count: 2
tagged with: git
has title: How to use a branch for a yeoman generator
possible better answer: http://stackoverflow.com/a/55948979
type: AnsweredQuestion
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28295524
downvote count: 0

http://stackoverflow.com/q/28392439
downvote count: 0
tagged with: angularjs-bootstrap
tagged with: javascript
type: UnansweredQuestion
tagged with: asp.net
tagged with: angularjs
type: Question
score: 10
favorite count: 0
answer count: 2
has body: I have an iframe with ASP.NET application, that contains UpdatePanel. I started using Angular inside the application, but things didn't work because of the .NET postbacks. To solve this, I used this solution: with (Sys.WebForms.PageRequestManager.getInstance()) { add_endRequest(onEndRequest); // regester to the end Request } function onEndRequest(sender, args) { angular.bootstrap($('#mainDiv'), ['defaultApp']); var rootscope = angular.element('#mainDiv').scope(); if (rootscope) { rootscope.$apply(); } } And it works great. The problem is that when I dynamically load a different user control in the ASP.NET page, with another ng-controller, Angular throws an error saying the app is already loaded: App Already Bootstrapped with this Element So the question is: How can I check if the app is already bootstrapped? Can I reload this module? Can I remove it from the element and than bootstrap it again? Thanks.
tagged with: asp.net-mvc
has answer: http://stackoverflow.com/a/28417199
has title: Check if AngularJS module is bootstrapped
upvote count: 10
has answer: http://stackoverflow.com/a/34501500

http://stackoverflow.com/comment/45468695
type: QuestionComment
comment on: http://stackoverflow.com/q/28369123
has text: I was thinking that would be the best solution and have tried to add in the code from the linked question but I cannot get it to work. If someone could add this code for me and send me a link to the updated file that would win the bounty.
score: 0
type: Comment

postback
tag name: postback
type: Tag
tags question: http://stackoverflow.com/q/28284486

http://stackoverflow.com/comment/45016010
has text: Apologies about the "actual whole numbers" business. I will clarify. This is in reference to the fact that users will sometimes not populate all fields and so, some fields will be left empty by the user. Thus, "actual whole numbers" means, the field will have an actual number (instead of just being empty) input by the user or automatically calculated and this number will be a whole number, because on all fields, I'm working with math.floor for rounding down with decimals to ensure there are no decimals.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28312226

http://stackoverflow.com/comment/45291895
type: QuestionComment
has text: Did you tried || instead of &&
score: 0
comment on: http://stackoverflow.com/q/28431860
type: Comment

http://stackoverflow.com/a/28437765
upvote count: 1
type: AcceptedAnswer
has body: You can find escape html code here. escape html
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28436823
answers question: http://stackoverflow.com/q/28436823

http://stackoverflow.com/comment/45130350
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28396919
score: 0
has text: Actually, I did find a way to do this, described below.

http://stackoverflow.com/q/28317943
type: Question
tagged with: javascript
has body: In this case I am using persistent storage. I am noticing that images (even very low-res ones, like 40 KB and 300x300px) have a "mandatory" loading delay of about 500ms. Of course, being Javascript, I can pre-load all the images I am ever going to use, but this would kill memory usage. I can also pre-load the images before loading the new page, but that's a bit cumbersome. I am not sure if there is some trick to eliminate or reduce this delay. I am using Cordova/Crosswalk (crosswalk-cordova 10.39.235.13-arm), which runs Chrome 39.0.2171.71. Any idea to make this faster and/or as instant as possible?
has title: Short (500ms?) delay in Cordova when referencing images on disk
answer count: 2
downvote count: 0
score: 1
favorite count: 0
tagged with: cordova
has answer: http://stackoverflow.com/a/28472017
type: UnansweredQuestion
tagged with: android
linked to: http://stackoverflow.com/q/15261532
has answer: http://stackoverflow.com/a/28448424
upvote count: 1

http://stackoverflow.com/q/28366499
has comment: http://stackoverflow.com/comment/45078967
tagged with: anchor
tagged with: ios8
has body: When I am holding long press on anchor tag, it's giving context menu with options "open", "open in new tab", "add to reading list" and "copy". We are listening for "contextmenu" event but this event is not being fired. As we know -webkit-touch-callout is broken in iOS 8. Can somebody help us in disabling context menu in iOS 8 safari? Thanks in advance. Below is the code disable copy and contextmenu. $("body").on("cut copy paste contextmenu dragstart", function () { return false; }); we want make sure that users not copy anything. We have prevented copying text but There is a corner case, If image is inside the anchor tag, context menu gives option to open image in new tab and user can copy the image from new tab.
has comment: http://stackoverflow.com/comment/45074195
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45079394
answer count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45079393
type: Question
has comment: http://stackoverflow.com/comment/45079558
has comment: http://stackoverflow.com/comment/45079262
score: 1
has title: Javascript disable context menu on long press on anchor tag in iOS 8 safari
favorite count: 0
tagged with: contextmenu
upvote count: 2
downvote count: 1

http://stackoverflow.com/comment/44929149
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28287300
has text: Updated my post: http://jsfiddle.net/wbo3pt9u/

http://stackoverflow.com/a/28383843
score: 2
answers question: http://stackoverflow.com/q/28381790
has comment: http://stackoverflow.com/comment/45123106
downvote count: 0
has comment: http://stackoverflow.com/comment/45122653
has comment: http://stackoverflow.com/comment/45123432
has body: The issue is that CoffeeScripts are intended to communicate with the DOM in an "unobtrusive way", so that you don't see any signs of JS in your HTML. And this happens because your script is compiled as a self-executing anonymous function, that isolates its scope from the global namespace. paintIt doesn't "leak" outside. It's by design (and here's some explaination on this). You need to do that differently. To distinguish attributes' purpose, I personally place any behaviour-related stuff in data-* attributes and bind events on selectors like [data-paint], that indicate presence of such attributes. I suggest you rewrite your HTML like so: Paint it red Then handle the click event for each data-paint: $("[data-paint]").on "click", -> # `@` is basically `this` and `@thing` is `this.thing` # `@dataset` contains the data attributes of the given element @style.color = @dataset.paint A-a-and you're done. See the JSFiddle.
upvote count: 2
type: Answer

http://stackoverflow.com/a/28401539
type: Answer
answers question: http://stackoverflow.com/q/28400979
score: 1
has body: Have you tried looking at ngTouch? http://www.ng-newsletter.com/posts/angular-on-mobile.html What exactly do you mean for a "mouseleave" on a touch device?
upvote count: 1
has comment: http://stackoverflow.com/comment/45139375
downvote count: 0

http://stackoverflow.com/q/28366690
tagged with: javascript
has answer: http://stackoverflow.com/a/28546672
score: 0
tagged with: arcgis-js-api
has title: ArcGIS find conflict between layer and geometry
answer count: 1
tagged with: arcgis
has body: I have a problem I could use some help with. In our application we have multiple FeatureLayers and on some of these layers a user can draw new objects. When a user draws a new object, lets call it a tent (any type of Geometry), I need to check if the position is valid. The object is valid when it does not consume the same position as a building. The buildings are stored on a separate featureLayer that is stored on a MapServer (and loaded in the browser). The drawing, the tent, is only stored locally (for now). So to get to the point.. what is think I need is a service that finds the distance between all objects on a layer(the buildings) and the object that is drawn at-the-moment.. I did have a look at the SummarizeNearby services but at this moment we don’t have the license for it. Then I had a look at the GeometryService and I would like to know if this is the correct way to do it.. I think it is possible to use the difference or intersect method of the GeometryService to find the difference between all the graphic/geometries on the buildings-layer and the drawn-object. If the difference is the same size as the graphics in the buildings-layer, then there is no conflict. But if the result is different then the buildings-layer, then the buildings-layer did contain the object that is just drawn, and there-for the drawn object is not valid. Please let me now if this is the way to go, or if there are other ways to calculate/find objects that intersect/overlap. Many thanks! Nico
accepted answer: http://stackoverflow.com/a/28546672
type: AnsweredQuestion
tagged with: arcgis-server
type: Question

http://stackoverflow.com/comment/45186933
score: 0
type: Comment
has text: @WimOmbelets missing `var` before `var $this = $(this);`
type: AnswerComment
comment on: http://stackoverflow.com/a/28427282

http://stackoverflow.com/comment/44976620
comment on: http://stackoverflow.com/q/28312944
has text: Directives are compiled following their priority number (greater comes first), so try to add `priority: 1` or try other numbers when you define your directive (along the `restrict` and `link` properties).
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28354402
upvote count: 2
has body: If you couldn't get an actual bytesLoaded and bytesTotal, you could track how long it takes all users to load that iframe and come up with an average loading speed that you then use to govern the progress bar. If you wanted it to be even more accurate, you could track how the current user's loading speeds match up to the average loading speeds on every item they preview (or maybe per feed) and develop an even better approximation based on that user's relative times. The first few people would just be guesswork but after that, you might be able to get relatively close. Naturally, that approach is going to work better when you have a large number of users, like feedly does. For a smaller site or more niche RSS feeds, it would be less useful. Edit: I don't think they're actually doing that though. At least, I don't see them making any tracking requests. I think they're probably just faking it. After previewing a lot of items, sometimes the bar is only half way full when it disappears and sometimes it fills in completely before you see more than a white screen. I think it's a placebo.
answers question: http://stackoverflow.com/q/28353988
score: 2
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45073901
accepted answer of: http://stackoverflow.com/q/28353988

http://stackoverflow.com/comment/45020454
type: Comment
comment on: http://stackoverflow.com/a/28337285
type: AnswerComment
has text: This literally the best possible answer to such a question.
score: 0

http://stackoverflow.com/q/28420843
tagged with: css
accepted answer: http://stackoverflow.com/a/28420969
possible better answer: http://stackoverflow.com/a/28420903
has body: I am trying to make a div toggle its visibility when a button is clicked. Currently I can hide the div, but I'm having trouble making it visible again. function unhide(divID) { //var item = document.getElementById(divID); //if (item) { // item.className = (item.className == 'hidden') ? 'unhidden' : 'hidden'; // $('#SearchParParams').toggle() //} var group = $('.group'), target = group.filter('#' + divID); if (target.className =='group hidden') { group.removeClass('unhidden').addClass('hidden'); target.addClass('unhidden').removeClass('hidden'); target.length == 0; } if (target.className == 'group unhidden') { group.removeClass('hidden').addClass('unhidden'); target.addClass('hidden').removeClass('hidden'); target.length = 1; } //$('#SearchAddParams,#SearchParParams').click(function () { // $('#SearchParParams, #SearchAddParams').toggle(); //}); }
has title: Hide / Show a DIV
downvote count: 4
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/28420969
tagged with: http://stackoverflow.com/tag/html
score: -2
upvote count: 2
answer count: 2
has answer: http://stackoverflow.com/a/28420903

http://stackoverflow.com/comment/45213612
type: Comment
comment on: http://stackoverflow.com/a/28430182
type: AnswerComment
has text: Thanks for the link to the Plunker. However, when I click on fetch, the alert says the content is null. I used Chrome and Firefox. What could the issue be?
score: 0

http://stackoverflow.com/q/28338338
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28338420
has body: I want to grab attributes of <a href> link and spit those attributes to another script file as post data. Following are the details of what I have done till now Html link Delete Now the jQuery code is as follows $(document).ready(function(){ //Other code here $(document).on('click','#deleteRecord',function(){ //I want to submit variables attr1 and attr2 as post data to delete_post.php }); }); Thanks in advance.
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28338744
score: 1
possible better answer: http://stackoverflow.com/a/28338395
favorite count: 0
has answer: http://stackoverflow.com/a/28338395
has comment: http://stackoverflow.com/comment/45022254
tagged with: php
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28338744
upvote count: 1
type: Question
has title: Using jQuery to grab attributes of link and spit as form post to another script file
downvote count: 0

http://stackoverflow.com/a/32275508
has body: This is a hard one...I messed around with it here: $(window).keypress(function(e) {//spacebar trigger if (e.keyCode === 0 || e.keyCode === 32) { $('#story_1_1_1, #story_1_1_2, #story_1_2_1, #story_1_2_2').attr('end', 'story_2_1_1.begin'); $('#story_2_1_1').attr('begin', '0s;story_2_1_2.end'); } }); https://jsfiddle.net/kt7gax2a/2/
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28294933

http://stackoverflow.com/a/28285990
type: Answer
accepted answer of: http://stackoverflow.com/q/28285934
has comment: http://stackoverflow.com/comment/44926410
upvote count: 1
has body: Do like this: $(document).ready(function() { $('#showit').click(function(){ $('.shown').slideToggle("fast"); $(this).text($(this).text() == 'Show Less' ? 'Show More': 'Show Less'); }); });
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44926303
score: 1
has comment: http://stackoverflow.com/comment/44926587
answers question: http://stackoverflow.com/q/28285934

http://stackoverflow.com/comment/44947670
type: AnswerComment
score: 0
has text: yes i have set id="file" in input and the same id to the document.getElementById("file")
type: Comment
comment on: http://stackoverflow.com/a/28297538

http://stackoverflow.com/a/28327138
has comment: http://stackoverflow.com/comment/45001821
upvote count: 0
has comment: http://stackoverflow.com/comment/45002212
downvote count: 3
has comment: http://stackoverflow.com/comment/45001818
answers question: http://stackoverflow.com/q/28326998
has body: You can use eval() function in the following manner $.each(strategies, function(index, value) { strategy = "strategy_" + value; eval(strategy+"()"); });
score: -3
type: Answer

http://stackoverflow.com/comment/45070314
type: Comment
has text: and do it for the image which you want to load alone. writing this function multiple time is not a problem rite?
type: AnswerComment
comment on: http://stackoverflow.com/a/28363664
score: 0

http://stackoverflow.com/comment/45121674
score: 0
type: Comment
has text: You can't do that. All operations in nodejs are asynchronous so will end in the future. When your `call()` function ends you don't have body yet. The concept of nodejs is to use callbacks and preform actions inside callbacks.
type: AnswerComment
comment on: http://stackoverflow.com/a/28391946

http://stackoverflow.com/comment/44946927
score: 0
type: QuestionComment
has text: I don't think there is an automated way of going from something structured as XML to something as unstructured as Javascript... but why would you convert to JS in the first place?
type: Comment
comment on: http://stackoverflow.com/q/28297126

http://stackoverflow.com/comment/45055741
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28355989
has text: Try this and tell me what you get. `speakerId: { type: String, autoValue: function(){ var ses = Session.get('pathId'); console.log(ses) } }`
type: Comment

http://stackoverflow.com/comment/45056536
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28343159
type: Comment
has text: And as for going with atmosphere, I shall see if all the packages I need are there.

http://stackoverflow.com/a/30689432
answers question: http://stackoverflow.com/q/28318002
has comment: http://stackoverflow.com/comment/49464949
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/52379039
type: Answer
upvote count: 1
has body: I know for me that my on file event would not fire because I was missing 'enctype="multipart/form-data"' in my form tag. example: Files:

wordpress
tags question: http://stackoverflow.com/q/28366078
tags question: http://stackoverflow.com/q/28339416
tags question: http://stackoverflow.com/q/28374918
tags question: http://stackoverflow.com/q/28290969
tags question: http://stackoverflow.com/q/28376477
tags question: http://stackoverflow.com/q/28330736
tags question: http://stackoverflow.com/q/28288660
tags question: http://stackoverflow.com/q/28299576
tags question: http://stackoverflow.com/q/28287454
tags question: http://stackoverflow.com/q/28351934
tags question: http://stackoverflow.com/q/28399690
tags question: http://stackoverflow.com/q/28417618
tags question: http://stackoverflow.com/q/28299296
tags question: http://stackoverflow.com/q/28360130
tags question: http://stackoverflow.com/q/28295947
tags question: http://stackoverflow.com/q/28312904
tags question: http://stackoverflow.com/q/28346526
tags question: http://stackoverflow.com/q/28385821
tags question: http://stackoverflow.com/q/28404416
tags question: http://stackoverflow.com/q/28280087
tags question: http://stackoverflow.com/q/28380567
tags question: http://stackoverflow.com/q/28420766
tags question: http://stackoverflow.com/q/28370753
tags question: http://stackoverflow.com/q/28357116
tags question: http://stackoverflow.com/q/28363540
tags question: http://stackoverflow.com/q/28323345
tags question: http://stackoverflow.com/q/28362862
tags question: http://stackoverflow.com/q/28294226
tags question: http://stackoverflow.com/q/28327840
tags question: http://stackoverflow.com/q/28282159
tag name: wordpress
tags question: http://stackoverflow.com/q/28380626
tags question: http://stackoverflow.com/q/28287326
tags question: http://stackoverflow.com/q/28306984
tags question: http://stackoverflow.com/q/28309251
tags question: http://stackoverflow.com/q/28383505
tags question: http://stackoverflow.com/q/28357381
tags question: http://stackoverflow.com/q/28373361
tags question: http://stackoverflow.com/q/28306725
tags question: http://stackoverflow.com/q/28361371
tags question: http://stackoverflow.com/q/28393165
tags question: http://stackoverflow.com/q/28341309
type: Tag
tags question: http://stackoverflow.com/q/28372222

http://stackoverflow.com/comment/44979749
has text: what calendar you are using, as far i know it will be default behavior of JavaScript to show date according to the client machine
score: 2
comment on: http://stackoverflow.com/q/28315111
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28307451
tagged with: kendo-ui
score: 0
answer count: 1
type: UnansweredQuestion
tagged with: css
tagged with: kendo-treeview
has body: I'm using the Angular-Kendo UI treeview widget in conjunction with the k-template directive to display a list of icons to the right of each tree node. With this way of doing it, my jquery .click() event should hide/show my reptIcons span, but it's only working on the very first tree node at the top. It should work on every node I click on, but it's reverting to the first node in my tree. Here's an image to show exactly what I mean: Here is the html with the kendo-tree-view directive and my custom data-toggle-tree-icons directive: &lt;div id="" class="reports-tree" kendo-tree-view="nav.treeview" k-options="nav.treeOptions" k-data-source="nav.reportsTreeDataSource" k-on-change="nav.onTreeSelect(dataItem)" &gt; &lt;span class="tree-node" k-template&gt; {{dataItem.text}}&lt;data-toggle-tree-icons/&gt; &lt;/span&gt; and then the javascript to handle the click event: $('.reports-tree').click(function (e) { $("span[class$='reptIcons'").hide(); $("#myIcons").closest('span').css("display", "inline"); $("#myIcons").css("margin-left", "5px"); }); The directive code is: directive('toggleTreeIcons', function ($compile) { // on Kendo treeview, using the k-template option to embed tree icons return { restrict: 'AE', templateUrl: 'app/shared/include/treeicons-include.html' } }); contents of treeicons-include.html &lt;span id="myIcons" class="reptIcons" style="display: none; width: 50px;"&gt; &lt;a title="add new folder" ng-click="nav.addAfter(nav.selectedItem)"&gt;&lt;i class="fa fa-folder-open"&gt;&lt;/i&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp; &lt;a title="add report here" ng-click="nav.addBelow(nav.selectedItem)"&gt;&lt;i class="fa fa-plus"&gt;&lt;/i&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp; &lt;a title="remove" ng-click="nav.remove(nav.selectedItem)"&gt;&lt;i class="fa fa-remove"&gt;&lt;/i&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp; &lt;a title="rename" onclick="showRename(this);"&gt;&lt;i class="fa fa-pencil"&gt;&lt;/i&gt;&lt;/a&gt; &lt;/span&gt; Ideally I'd like to use the tree-node class above, and …
has answer: http://stackoverflow.com/a/29806846
type: Question
has title: In Angular-Kendo treeview, using a class name to hide/display a span element
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/28377555
answers question: http://stackoverflow.com/q/28377544
downvote count: 0
type: AcceptedAnswer
has body: Escape the backslash one more time when passing your regex inside " delimiter. var search = new RegExp("/\\*var\\*/(.*?)/\\*\\*/"); Example: &gt; var text = "/*var*/test/**/" undefined &gt; var search = new RegExp("/\\*var\\*/(.*?)/\\*\\*/"); undefined &gt; console.log(search.exec(text)[1]) test OR Use the forward slash as delimiter but note that you must need to escape all the forward slashes. &gt; var search = /\/\*var\*\/(.*?)\/\*\*/; undefined &gt; console.log(search.exec(text)[1]) test
upvote count: 2
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/28377544

http://stackoverflow.com/q/28341056
answer count: 0
downvote count: 1
has body: I want to see my exact keyword search in data table. I have a gender column wheres values are male,female and others when I am searching male then show male and female both but I want to see male only. Here is my code $(document).ready(function() { oTable = $('#datatable').dataTable(); oTable.fnFilter( "^" + TERM + "$", COLUMN , true); });
tagged with: yui-datatable
type: Question
tagged with: javascript
tagged with: jquery
score: 0
upvote count: 1
has title: Exact Search in Datatable
has comment: http://stackoverflow.com/comment/45027144
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45028161

http://stackoverflow.com/comment/45030236
score: 0
type: Comment
type: QuestionComment
has text: Haven't I declared this with the first part of my jQuery ? What should I do to fix this ?? When I use the mousedown event handler instead of click eventhandler it works. But I need the click handler
comment on: http://stackoverflow.com/q/28342650

http://stackoverflow.com/q/28433989
downvote count: 1
has title: Operators before the function call
has answer: http://stackoverflow.com/a/28434231
favorite count: 0
upvote count: 3
possible better answer: http://stackoverflow.com/a/28434204
answer count: 4
score: 2
has answer: http://stackoverflow.com/a/28434204
has answer: http://stackoverflow.com/a/28434283
accepted answer: http://stackoverflow.com/a/28434193
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45198107
tagged with: javascript
has body: Today I figured out that it is possible to use operations before the parenthesis of a function call. E.g. console.log|('Hello world!'); or console.log&gt;&gt;(33); Why is this possible and what happens?
has answer: http://stackoverflow.com/a/28434193
type: Question

http://stackoverflow.com/q/28369985
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
linked to: http://stackoverflow.com/q/181214
has title: Change selected files in input element with JQuery
answer count: 0
downvote count: 0
score: 1
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/45080966
has body: I need to change selected files in input:file element with Jquery. Firstly, user select files. There is a file size control in input:file change event. So, if control return false selected file should be removed in file_list. I searched this and try something for 3 - 4 hours. But not achieved still. I hope someone can help me. Here is my function. function handleFiles2() { var names = []; var newList = []; var text = ''; var x = 0; var fsize = 0; var files = $(".fileUpBasvuru").get(0).files; for (var i = 0; i &lt; files.length; ++i) { fsize = parseInt(files[i].size); if (fsize &gt; 102400) { newList.push(files.item(i)); names.push(files[i].name); } } $(".fileUpBasvuru").get(0).files = newList; $(".file_list").html(text); };
has comment: http://stackoverflow.com/comment/45081021
has comment: http://stackoverflow.com/comment/45080729
upvote count: 1
tagged with: multiple-file-upload

http://stackoverflow.com/a/28287409
type: Answer
has body: You can have the effect you want by placing the images on top of another, and adjusting their opacity values on hover. A simple transition will give it the fade in/out look you want. img { height: 600px; width: 200px; } .alt-img { opacity: 0; } .image-container:hover &gt; .main-img { opacity: 0; } .image-container:hover &gt; .alt-img { opacity: 1; } img { transition: 1s; position: absolute; } &lt;div class="image-container"&gt; &lt;img class="main-img" src="http://gogojjtech.com/misc/map/route204.png" /&gt; &lt;img class="alt-img" src="http://gogojjtech.com/misc/map/route205.png" /&gt; &lt;/div&gt;
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28283632
downvote count: 0

http://stackoverflow.com/comment/44999551
has text: @sixtyfootersdude for jquery i don't have any inputs sorry
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28325598
type: AnswerComment

http://stackoverflow.com/a/28389751
has comment: http://stackoverflow.com/comment/111688946
answers question: http://stackoverflow.com/q/28389484
upvote count: 42
downvote count: 8
has comment: http://stackoverflow.com/comment/108865595
type: Answer
has body: There is a built-in function for this. var a = 2; var b = a.toFixed(1); This rounds the number to one decimal place, and displays it with that one decimal place, even if it's zero.
has comment: http://stackoverflow.com/comment/125480355
score: 34

http://stackoverflow.com/a/28401685
answers question: http://stackoverflow.com/q/28401624
type: Answer
upvote count: 1
score: 1
downvote count: 0
has body: I think you're almost there. You just need to remove the brackets from test var and instead of replacing the .text property, you need to replace the .value property document.getElementById('team').value = testvar; Check out this link because I think it accomplishes what you want, http://www.mediacollege.com/internet/javascript/form/add-text.html

http://stackoverflow.com/comment/45068969
has text: "android stock browser" is very vague. There's the AOSP browser that varies per each new release. Then there's the Samsung browser, and HTC browser, etc. You have to be more specific.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28362984

http://stackoverflow.com/q/28361475
has comment: http://stackoverflow.com/comment/45065210
tagged with: javascript
has comment: http://stackoverflow.com/comment/45065221
favorite count: 0
linked to: http://stackoverflow.com/q/14028959
answer count: 3
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/9899372
has title: My Javascript doesn't work when I put a script element in the head to load it from a URL
has comment: http://stackoverflow.com/comment/45065238
has comment: http://stackoverflow.com/comment/45065225
has answer: http://stackoverflow.com/a/28361506
accepted answer: http://stackoverflow.com/a/28361506
possible better answer: http://stackoverflow.com/a/28361598
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/28361598
score: 7
type: Question
has body: I have written the code for a simple function inline, but when i created a separate js.file it doesn't want to work for some reason. I've tried everything it feels like, but maybe my tired eyes can't something! Test Button 1 Lorem ipsum dolor sit amet Button 2 Lorem ipsum dolor sit amet Button 3 Lorem ipsum dolor sit amet The idea is to have three buttons that when you click on one of them only one of the divs will be shown, and the other two will be hidden. Here is the JavaScript (that worked perfectly fine inline): var first_container = document.querySelectorAll(' div:not(:first-child) p'); for (var i = 0; i < first_container.length; i++) { first_container[i].style.visibility = 'hidden'; } var buttons = document.querySelectorAll('button'); for (var i = 0; i < buttons.length; i++) { buttons[i].addEventListener('click', clickHandler); } function clickHandler(e) { e.preventDefault(); var text = document.querySelectorAll('p'); for (var i = 0; i < text.length; i++) { if (text[i] === event.target.nextElementSibling) { text[i].style.visibility = 'visible'; } else { text[i].style.visibility = 'hidden'; } } }
has answer: http://stackoverflow.com/a/28361533
duplicate of: http://stackoverflow.com/q/14028959
upvote count: 7

http://stackoverflow.com/q/28361496
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45065333
has answer: http://stackoverflow.com/a/28362037
has comment: http://stackoverflow.com/comment/45065345
type: Question
answer count: 2
tagged with: javascript
linked to: http://stackoverflow.com/q/5408406
linked to: http://stackoverflow.com/q/4288759
score: 0
linked to: http://stackoverflow.com/q/30036
has answer: http://stackoverflow.com/a/28361602
has comment: http://stackoverflow.com/comment/45065348
has body: I want to convert a for-loop used in JavaScript to asynchronous format in order to remove the script not responding error while running in browsers. My code is given below: links.Timeline.prototype.stackItemsCheckOverlap = function(items, itemIndex, itemStart, itemEnd) { var eventMargin = this.options.eventMargin, collision = this.collision; var item1 = items[itemIndex]; //for loop that I want to change as asynchronous for (var i = itemEnd; i &gt;= itemStart; i--) { var item2 = items[i]; if (collision(item1, item2, eventMargin)) { if (i != itemIndex) { return item2; } } }
has title: how to convert a for loop in java script to asynchronous

http://stackoverflow.com/q/28342244
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45029050
has comment: http://stackoverflow.com/comment/45029401
has body: I want to get the length of language in JavaScript alert box - See screenshot- Ajax Response - My Ajax code - function search_menu(){ $.ajax({ type: 'post', url: rootUrl() + "rest_apis/search_menu.json", cache: false, success: function(res){ //alert(data.data[0].language[142]); var len = res.data[0].language.length; alert(len); //Showing undefined }, contentType: 'application/json', dataType: 'json' }); } I am just alerting alert(lang) its showing undefined. Actually in language having 36 record. why its showing undefined?
tagged with: response
answer count: 4
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45029201
tagged with: javascript
tagged with: jquery
tagged with: ajax
type: Question
has answer: http://stackoverflow.com/a/28342322
has title: JSON response data length getting undefined error in Ajax?
has answer: http://stackoverflow.com/a/28342296
favorite count: 0
has comment: http://stackoverflow.com/comment/45029186
has comment: http://stackoverflow.com/comment/45029295
upvote count: 3
has answer: http://stackoverflow.com/a/28342548
has answer: http://stackoverflow.com/a/28342938
downvote count: 1
possible better answer: http://stackoverflow.com/a/28342938
accepted answer: http://stackoverflow.com/a/28342322

http://stackoverflow.com/comment/45029826
score: 1
has text: Please explain what you want exactly and what have you tried so far to achieve it.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28342630

http://stackoverflow.com/comment/44915780
comment on: http://stackoverflow.com/a/28280573
has text: it's the other way around, the higher the priority number, the sooner it runs.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44948160
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28298049
has text: `Class.create` sound like prototype.js-Style: http://api.prototypejs.org/language/Class/create/
score: 0

http://stackoverflow.com/q/28384599
favorite count: 0
has answer: http://stackoverflow.com/a/28387646
duplicate of: http://stackoverflow.com/q/7995761
type: Question
tagged with: encryption
answer count: 1
score: -1
downvote count: 1
tagged with: asp-classic
linked to: http://stackoverflow.com/q/8661929
upvote count: 0
has body: I have an application, it lands on asp page, which has a html menu like this, Customers Payments Suspend List Wages And the request goes in the url as this to the aspx page. wages/?CompanyID=1&LoginName=Admin How can i encrypt the data before sending to the aspx page? Using a javascript in this html page can be done? if so how?
tagged with: javascript
type: UnansweredQuestion
has title: How can i encrypt data before i pass to aspx page?
linked to: http://stackoverflow.com/q/7995761
tagged with: asp.net

http://stackoverflow.com/comment/45137391
type: Comment
comment on: http://stackoverflow.com/a/28400815
score: 0
type: AnswerComment
has text: I'm not clear what you mean "theArrayCol". I know the value of removeMe already and have an array of removeMe. right now I'm using object.remove("key2", [key2ValuesToRemove]); This is not working.

http://stackoverflow.com/a/28339868
type: Answer
answers question: http://stackoverflow.com/q/28339416
has comment: http://stackoverflow.com/comment/45025647
has comment: http://stackoverflow.com/comment/45183370
has comment: http://stackoverflow.com/comment/45278953
has body: Well, first off, Java and Javascript are not the same language. Now, you probably can just use jquery to select your buttons. For example: In your page.php or index.php: Small Font Next you want to call that button onclick with jquery: On your main.js $(document).ready(function() { //storing your button in var, so you can reference it var mybutton = $(".my-button"); //when you click the button, something happens mybutton.on('click', function() { //do something here (consider using jquery's .css functions to alter the font size) } }); Additionally, you can also add classes to your style.css and then use jquery's .addClass() to assing your css classes wherever you would like the fonts to grow. You asked how to alter the html tag to increase the font globally. First off, you don't want to tag the html tag, you just want to tag the body. Make sure you know the fundamental differences between html, head, and body. So this is how on the click of a button, you would make all the font inside of the body of your document, increase in 100%. $('.mybutton').on('click', function() { $('body').css('font-size','100%'); }
score: 0
has comment: http://stackoverflow.com/comment/45068191
has comment: http://stackoverflow.com/comment/45071487

http://stackoverflow.com/a/57382510
type: Answer
has body: Here's a way to do it without having to specify the size of the element you want the rotating border on: .rotating-border { width: max-content; background: linear-gradient(90deg, purple 50%, transparent 50%), linear-gradient(90deg, purple 50%, transparent 50%), linear-gradient(0deg, purple 50%, transparent 50%), linear-gradient(0deg, purple 50%, transparent 50%); background-repeat: repeat-x, repeat-x, repeat-y, repeat-y; background-size: 15px 4px, 15px 4px, 4px 15px, 4px 15px; padding: 10px; animation: border-dance 4s infinite linear; } @keyframes border-dance { 0% { background-position: 0 0, 100% 100%, 0 100%, 100% 0; } 100% { background-position: 100% 0, 0 100%, 0 0, 100% 100%; } } Hello World
downvote count: 1
score: 27
answers question: http://stackoverflow.com/q/28365839
has comment: http://stackoverflow.com/comment/133397181
upvote count: 28
has comment: http://stackoverflow.com/comment/102260139

http://stackoverflow.com/a/28376001
answers question: http://stackoverflow.com/q/28371589
has body: Add CssClass inside your repeater: <asp:Repeater ID="RepeaterTrackingInformation" runat="server" OnItemDataBound="RepeaterTrackingInformation_ItemDataBound"> Department SentTo Date Approved Date <asp:Label ID="LabelDepartmentName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Department") %>'></asp:Label> <asp:TextBox ID="TextBoxSentTo" CssClass="datepicker" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "SentTo") %>'></asp:TextBox> <asp:TextBox ID="TextBoxApproved" CssClass="datepicker" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "ReceivedFrom") %>'></asp:TextBox> </asp:Repeater> Then in javascript: $('.datepicker').datetimepicker({ pickTime: false });
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28371589
type: Answer

http://stackoverflow.com/comment/45088774
type: QuestionComment
has text: Are the two pages open in the same window? Next time use @PeterKA to make sure I am alerted of your answer immediately. If the two pages are not in the same window, you would need to use local storage or cookies and some kind of a trigger on page 2.
score: 0
comment on: http://stackoverflow.com/q/28371657
type: Comment

http://stackoverflow.com/q/28417576
has answer: http://stackoverflow.com/a/28417656
type: AnsweredQuestion
tagged with: object
has answer: http://stackoverflow.com/a/28417705
possible better answer: http://stackoverflow.com/a/28417656
has answer: http://stackoverflow.com/a/28417660
has answer: http://stackoverflow.com/a/28417841
type: Question
tagged with: function
tagged with: arrays
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28417705
has comment: http://stackoverflow.com/comment/45168345
has comment: http://stackoverflow.com/comment/45170244
has title: How do I take the value of an input field and use it to filter an array?
answer count: 4
has comment: http://stackoverflow.com/comment/45168337
has comment: http://stackoverflow.com/comment/45168529
has body: I'm new to javascript. I want the value entered into the input field to be used to evaluate what gets filtered out of the array: "e". I can't figure out what I am doing wrong. I've tried a lot of different things so I think I'm just making some syntax error? Please help me. html: button js: function Employee (name, salary, gender) { this.name = name; this.salary = salary; this.gender = gender; } var e = [ Matt = new Employee("Matt", 100, "Male"), Alex = new Employee("Alex", 200, "Male"), Zack = new Employee("Zack", 300, "Male"), Mark = new Employee("Mark", 400, "Male"), Rick = new Employee("Rick", 500, "Male"), ]; $('#button').on('click', function () { e.filter(function (e) { return e.salary >= $('#input').val(); }).map (function (e) { return e.name; console.log("asdf"); }); });
score: 0

http://stackoverflow.com/comment/66636054
type: Comment
score: 1
type: AnswerComment
has text: @markE I answered his clearing problems and referenced this answer for the rest of the problem. Thanks for the undo, when i see people clearing each particle rather than the whole screen I just need to set them on the right path... LOL...
comment on: http://stackoverflow.com/a/28391058

http://stackoverflow.com/comment/45085416
type: QuestionComment
has text: @KaiQing what it's not doing is use the js gridscrollfx to add the class "shown" to all items that are already in place but hidden
score: 0
comment on: http://stackoverflow.com/q/28372327
type: Comment

http://stackoverflow.com/a/58093645
answers question: http://stackoverflow.com/q/28316976
has body: Although this answer worked for me, with the change of direct latlng object instead of BMap.Point object to make it work.
downvote count: 0
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/44963855
has text: I think alex is saying that on moseover open the tooltip box and keep it open until the mouseout event is fired, which closes the tooltip box
comment on: http://stackoverflow.com/q/28306419
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45067318
score: 1
comment on: http://stackoverflow.com/q/28362621
has text: Chances are you're having a single-page app there? Because in that case, rewriting a URL might just fire a RouteChange event internal to angular, and the page is changed without reloading the browser window.
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28311228
accepted answer of: http://stackoverflow.com/q/28311196
has body: Because arguments has no sort method. Be aware that arguments is not an Array object, it's an array-like Arguments object. However, you can use Array.prototype.slice to convert arguments to an array; and then you will be able to use Array.prototype.sort: function highest(){ return [].slice.call(arguments).sort(function(a,b){ return b - a; }); } highest(1, 1, 2, 3); // [3, 2, 1, 1]
type: Answer
has comment: http://stackoverflow.com/comment/123412978
answers question: http://stackoverflow.com/q/28311196
score: 31
upvote count: 31
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44975585
has comment: http://stackoverflow.com/comment/44973479
downvote count: 0
has comment: http://stackoverflow.com/comment/44974154

http://stackoverflow.com/comment/44928971
score: 0
type: AnswerComment
has text: With the namespaces (like the example added in my response) you can define this routes with the io.of method.
type: Comment
comment on: http://stackoverflow.com/a/28287428

http://stackoverflow.com/a/28878577
type: Answer
has comment: http://stackoverflow.com/comment/46204409
downvote count: 0
answers question: http://stackoverflow.com/q/28290969
has body: This is an error thrown by AdBlock plus or simular programs. It's nothing to worry about, you can disable the extension to remove the 'errors'. Edit: oh, it's posted in the comments too.
has comment: http://stackoverflow.com/comment/46238895
has comment: http://stackoverflow.com/comment/55275099
score: 8
upvote count: 8

http://stackoverflow.com/a/28403795
has body: Put your script tag in header section like file name like load.js
score: 0
answers question: http://stackoverflow.com/q/28403705
type: Answer

http://stackoverflow.com/comment/45125495
comment on: http://stackoverflow.com/q/28394485
has text: Without your HTML this is difficult. However `position()` is returning undefined somewhere.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45935300
comment on: http://stackoverflow.com/q/28349746
score: 0
has text: Post it in an update to your question.
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28315204
has body: No for loops required if(guestList.indexOf(guestName) === -1) return "xyz" else return "abc"
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28315162
has comment: http://stackoverflow.com/comment/44980165
downvote count: 0
type: Answer

http://stackoverflow.com/q/28412980
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28413047
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45646551
tagged with: css
tagged with: data-uri
has comment: http://stackoverflow.com/comment/45159369
tagged with: http
has comment: http://stackoverflow.com/comment/45164187
has body: I have encoded all the images in my css to base64 encoded data to reduce the number of http requests in the website. However, it appears that there is still an http request for the data encoded images as you can see below. I tried checking for a solution on the web but everywhere it says that there should be no http request for images which are encoded to base64. What am I doing wrong ?
type: Question
tagged with: javascript
has title: Why is my bas64 encoded image creating a http request?
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45159370

reactjs
tags question: http://stackoverflow.com/q/28283283
tags question: http://stackoverflow.com/q/28301963
tags question: http://stackoverflow.com/q/28380709
tags question: http://stackoverflow.com/q/28289000
tags question: http://stackoverflow.com/q/28401714
tags question: http://stackoverflow.com/q/28357982
tags question: http://stackoverflow.com/q/28280779
tags question: http://stackoverflow.com/q/28352572
tags question: http://stackoverflow.com/q/28329382
tags question: http://stackoverflow.com/q/28321431
tags question: http://stackoverflow.com/q/28315205
tags question: http://stackoverflow.com/q/28405444
tags question: http://stackoverflow.com/q/28298163
tags question: http://stackoverflow.com/q/28380938
tags question: http://stackoverflow.com/q/28303077
tags question: http://stackoverflow.com/q/28320094
tags question: http://stackoverflow.com/q/28354451
tags question: http://stackoverflow.com/q/28386125
tags question: http://stackoverflow.com/q/28285183
tags question: http://stackoverflow.com/q/28391313
tags question: http://stackoverflow.com/q/28331032
tags question: http://stackoverflow.com/q/28290590
tags question: http://stackoverflow.com/q/28345529
type: Tag
tags question: http://stackoverflow.com/q/28289826
tags question: http://stackoverflow.com/q/28356802
tags question: http://stackoverflow.com/q/28387733
tags question: http://stackoverflow.com/q/28368872
tags question: http://stackoverflow.com/q/28362456
tags question: http://stackoverflow.com/q/28330752
tags question: http://stackoverflow.com/q/28435915
tags question: http://stackoverflow.com/q/28353702
tags question: http://stackoverflow.com/q/28399715
tags question: http://stackoverflow.com/q/28307091
tags question: http://stackoverflow.com/q/28338913
tags question: http://stackoverflow.com/q/28403625
tags question: http://stackoverflow.com/q/28426673
tags question: http://stackoverflow.com/q/28426750
tags question: http://stackoverflow.com/q/28297784
tags question: http://stackoverflow.com/q/28356623
tags question: http://stackoverflow.com/q/28399265
tags question: http://stackoverflow.com/q/28364962
tags question: http://stackoverflow.com/q/28356862
tags question: http://stackoverflow.com/q/28434167
tags question: http://stackoverflow.com/q/28300547
tags question: http://stackoverflow.com/q/28399159
tags question: http://stackoverflow.com/q/28319735
tag name: reactjs
tags question: http://stackoverflow.com/q/28361252
tags question: http://stackoverflow.com/q/28314368
tags question: http://stackoverflow.com/q/28356776
tags question: http://stackoverflow.com/q/28432746
tags question: http://stackoverflow.com/q/28419276
tags question: http://stackoverflow.com/q/28433069
tags question: http://stackoverflow.com/q/28385273
tags question: http://stackoverflow.com/q/28287763
tags question: http://stackoverflow.com/q/28314726
tags question: http://stackoverflow.com/q/28435952
tags question: http://stackoverflow.com/q/28434789
tags question: http://stackoverflow.com/q/28281675
tags question: http://stackoverflow.com/q/28322447
tags question: http://stackoverflow.com/q/28417490
tags question: http://stackoverflow.com/q/28314248
tags question: http://stackoverflow.com/q/28309547
tags question: http://stackoverflow.com/q/28320438
tags question: http://stackoverflow.com/q/28387152
tags question: http://stackoverflow.com/q/28370178
tags question: http://stackoverflow.com/q/28385501

http://stackoverflow.com/comment/45019460
type: QuestionComment
comment on: http://stackoverflow.com/q/28336709
score: 1
has text: Where is checkbox? Or its state's variable?
type: Comment

http://stackoverflow.com/comment/45052866
score: 0
has text: What if I used $http's success and error methods on it's promise (rather than then() and catch()) would that be better somehow?
type: AnswerComment
comment on: http://stackoverflow.com/a/28354478
type: Comment

http://stackoverflow.com/a/28403632
score: 0
answers question: http://stackoverflow.com/q/28403556
type: Answer
has body: I found the answer in one of the examples. Basically, use fillGraph option and set it true for a series. var g3 = new Dygraph( document.getElementById("div_g3"), function() { var ret = "X,Y1,Y2\n"; for (var i = 0; i &lt; 100; i++) { ret += i + "," + i + "," + (i * (100-i) * 100/(50*50)) + "\n"; } return ret; }, { series: { Y1: { fillGraph: true } } } );
has comment: http://stackoverflow.com/comment/45144009

http://stackoverflow.com/a/28401868
answers question: http://stackoverflow.com/q/28399690
has comment: http://stackoverflow.com/comment/45154400
has comment: http://stackoverflow.com/comment/45158705
score: 0
type: Answer
has body: working example.........http://jsfiddle.net/vezkvkve/1/ html: &lt;script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"&gt;&lt;/script&gt; &lt;input type="text" id="mapaddress" /&gt; &lt;input type="submit" id="change" onclick="changeMap()"&gt; &lt;div id="map" style="width: 413px; height: 300px;"&gt;&lt;/div&gt; javascript &lt;script type="text/javascript"&gt; function changeMap(){ var mapOptions = { zoom: 16, center: new google.maps.LatLng(54.00, -3.00), mapTypeId: google.maps.MapTypeId.ROADMAP }; var geocoder = new google.maps.Geocoder(); //var address = '3410 Taft Blvd Wichita Falls, TX 76308'; var address= document.getElementById("mapaddress").value; if(!address) { address = '3410 Taft Blvd Wichita Falls, TX 76308'; } geocoder.geocode( { 'address': address}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { map.setCenter(results[0].geometry.location); var marker = new google.maps.Marker({ map: map, position: results[0].geometry.location }); } else { alert("Geocode was not successful for the following reason: " + status); } }); var map = new google.maps.Map(document.getElementById("map"), mapOptions); return false; } &lt;/script&gt;

http://stackoverflow.com/a/28317365
has body: Well, you can avoid needing to worry about closures much and still achieve the necessary results. It can be done by attaching each text variable to its respective marker. This way your anonymous function can call it using this.text for (var i = 0; i &lt; tGoogleMarker.length - 1; i++) { var marker = new google.maps.Marker({ text: tGoogleMarker[i][4], position: new google.maps.LatLng(tGoogleMarker[i][0], tGoogleMarker[i][1]), map: map, flat: false, icon: tGoogleMarker[i][2], shadow: tGoogleMarker[i][3] }); google.maps.event.addListener(marker, 'click', function () { ShowMarkerContentPopUp(this, this.text); }); }
answers question: http://stackoverflow.com/q/28315515
score: 0
type: Answer

http://stackoverflow.com/q/28312512
favorite count: 0
tagged with: angularjs
downvote count: 0
has body: Inside of an ng-repeat="item in vm.items I have the following input["file"]: &lt;input type="file" ng-attr-id="image{{item}}" class="form-control" accept="image/*" onchange="angular.element(this).scope().vm.openFile(event, item)" required&gt; I am calling vm.openFile using onchange instead of ng-change because ng-change is not supported for input["file"] types. The problem, now, is that I am unable to pass item to my onchange function because of the following error: Uncaught ReferenceError: item is not defined How can I pass the value of item, which is just a string, into my onchange function within ng-repeat?
has answer: http://stackoverflow.com/a/28312911
accepted answer: http://stackoverflow.com/a/28312911
type: AnsweredQuestion
has title: How to pass value of ng-repeat variable into input["file"]'s onchange function?
has comment: http://stackoverflow.com/comment/44975337
score: 1
type: Question
has comment: http://stackoverflow.com/comment/44975488
has comment: http://stackoverflow.com/comment/44975315
has comment: http://stackoverflow.com/comment/44975456
has comment: http://stackoverflow.com/comment/44975418
answer count: 1
has comment: http://stackoverflow.com/comment/44975405
tagged with: javascript
linked to: http://stackoverflow.com/q/17063000
upvote count: 1

http://stackoverflow.com/comment/45169302
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28417936
score: 0
has text: The code above always set the currentPlayer to "Name1" use this instead: currentPlayer = playerList[pTurn = (++pTurn)%playerList.length];

http://stackoverflow.com/comment/45177297
comment on: http://stackoverflow.com/q/28421945
has text: Angular does not require a backend server app unless you build features that depend on one. Have you tried putting your code in a [Plunker](http://plnkr.co/), or a similar tools, so you could test and share it easily?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45120230
type: QuestionComment
comment on: http://stackoverflow.com/q/28391448
has text: Why do you think you couldn't add them?
score: 0
type: Comment

http://stackoverflow.com/comment/44983951
type: QuestionComment
comment on: http://stackoverflow.com/q/28317438
score: 0
has text: yes in jquery and this function would work on edit click..so at every edit for different csv.. so how it is possible
type: Comment

http://stackoverflow.com/a/28338947
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/28336743
accepted answer of: http://stackoverflow.com/q/28336743
has body: subs manager caches the data, try with normal subscription Meteor.subscribe('')
upvote count: 2

http://stackoverflow.com/a/28292087
has comment: http://stackoverflow.com/comment/45027148
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/44977179
accepted answer of: http://stackoverflow.com/q/28291828
downvote count: 0
has body: What about using ng-if like this.. Fiddle {{choice.Text}} {{choice.Text}} or use Angular Js ngChecked attribute Fiddle {{choice.Text}} Update: using ng-model and ng-value Fiddle Though both the above code is working, it has got some issues for working along with ng-model. As per Angular Js documentation this functionality can be achieved using ng-model and ng-value itself like this and so this should be the recommended way . ng-value should be the value to which the expression should be set when selected. {{choice.Text}}
answers question: http://stackoverflow.com/q/28291828
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45028789
has comment: http://stackoverflow.com/comment/45026425
has comment: http://stackoverflow.com/comment/44991277
has comment: http://stackoverflow.com/comment/44947280

http://stackoverflow.com/q/28312079
answer count: 0
score: 1
has body: I've found a way to implement file upload progress using XMLHttpRequest. The issue with this is that once uploading is complete the server returns HTML page that I can't seem to reliably display from XMLHttpRequest. I tried the following: //xhr = XMLHttpRequest document.write(xhr.responseText); window.scrollTo(0, 0); also this: //xhr = XMLHttpRequest document.open('text/html'); document.write(xhr.responseText); document.close(); Both seems to work under latest Chrome and FF but hang up IE. In other words it's not really reliable. So I was thinking if there's a way to get the current file upload progress without using XMLHttpRequest.send() by letting a "regular" HTML file upload to go through?
upvote count: 1
type: Question
downvote count: 0
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
tagged with: file-upload
has title: Can I get current file upload progress without using XMLHttpRequest.send()?
favorite count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/28311047

http://stackoverflow.com/q/28331361
has answer: http://stackoverflow.com/a/28331526
linked to: http://stackoverflow.com/q/359494
answer count: 2
linked to: http://stackoverflow.com/q/237104
has body: I want to use JavaScript to determine which class/display color a number of divs(called div1, div2...up through div21) are depending on the values in schedule_array. So if 2 is in schedule_array, I want div2 to be of class clicked and if 3 is not in schedule_array, I want div3 to be of class unclicked. The problem is that my === sign seems to be giving false no matter what for this code: function setClasses() { alert("schedule array is "+schedule_array[3]); for(var k = 1; k&lt;22; k++) { var name = "div" + k; if(contains(schedule_array, k)) { document.getElementById(name).className = "clicked"; } else { document.getElementById(name).className = "unclicked"; } } } setClasses(); function contains(a, obj) { //alert(a[3] + "for function contains"); //alert(a.length); for (var i = 0; i &lt; a.length; i++) { document.write(a[i] + "=" + obj); if (a[i] === obj) { document.write("true,,,,,,,,"); return true; } else { document.write("false,,,,,,,,"); } } return false; } (stole this latter function from http://stackoverflow.com/questions/237104/array-containsobj-in-javascript) I have no idea why, but the following code's == fails even when I am comparing the same integer to itself. For example with the code below I get output like: 21=21false,,,,,, As you can see I've already checked to make sure schedule_array exists and has valid numbers. I have also checked to make sure both for loops are running. Finally, I confirmed that in js, even something like "5"==5 should give a true, so even if there is some weird typing going on, that shouldn't affect the outcome. Question: what is up with this weirdness? What am I doing wrong?
possible better answer: http://stackoverflow.com/a/28331526
has comment: http://stackoverflow.com/comment/45009920
has title: javascript says two values are not equal when they are (using ===)
favorite count: 0
has comment: http://stackoverflow.com/comment/45009969
has comment: http://stackoverflow.com/comment/45009873
has answer: http://stackoverflow.com/a/28331437
has comment: http://stackoverflow.com/comment/45010105
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28331437
downvote count: 1
type: Question
upvote count: 0
has comment: http://stackoverflow.com/comment/45010955
tagged with: javascript
score: -1

http://stackoverflow.com/comment/45155804
type: QuestionComment
comment on: http://stackoverflow.com/q/28410804
score: 0
has text: Nope. Wasn't that. Strange thing is that it works perfectly when pressing "Run". Just like there was some kind of "protection" to pervent from infinite loops. Could try to blame that it's not working at all. But still other function calls execute except that only one. trigger('clik') does not work either
type: Comment

http://stackoverflow.com/comment/45204137
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28436810
has text: Nevermind, i just realised that it has the jpg part at the start. :D

http://stackoverflow.com/comment/45092511
type: Comment
comment on: http://stackoverflow.com/a/28375877
score: 0
type: AnswerComment
has text: @t.niese no worries. double negatives are always a pain

http://stackoverflow.com/comment/45006706
has text: Okey on chrome parsing the event.data without removing anything works fine but I get a random error -> Uncaught SyntaxError: Unexpected token c, or token d
comment on: http://stackoverflow.com/a/28329162
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28347449
tagged with: javascript
score: 4
has comment: http://stackoverflow.com/comment/45039290
has comment: http://stackoverflow.com/comment/45039387
has body: I started learning AngularJS so I created two html pages: index.html Angular Tutorial and list.html Hello: {{test}} The app.js looks like this var TodoApp = angular.module("TodoApp", ["ngResource"]). config(function ($routeProvider) { $routeProvider. when('/', { controller: ListCtrl, templateUrl: "list.html" }). otherwise({ redirectTo: '/' }); }); var ListCtrl = function ($scope, $location) { $scope.test = "testing"; }; Unfortunately, when I open the index.html page it is blank. What can be the cause of the problem?
possible better answer: http://stackoverflow.com/a/28347806
favorite count: 0
has answer: http://stackoverflow.com/a/28347549
has title: AngularJS not displaying template
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28347688
upvote count: 4
has answer: http://stackoverflow.com/a/28347806
answer count: 4
has comment: http://stackoverflow.com/comment/45039530
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45039373
downvote count: 0
has comment: http://stackoverflow.com/comment/45039502
has answer: http://stackoverflow.com/a/28347688
has answer: http://stackoverflow.com/a/28347788
type: Question

http://stackoverflow.com/a/28382423
accepted answer of: http://stackoverflow.com/q/28382367
score: 0
answers question: http://stackoverflow.com/q/28382367
type: Answer
has body: You should learn everything about REST web service on server side, ssh protocol and take a look at the expressJs framework
type: AcceptedAnswer

http://stackoverflow.com/q/28365658
has body: Can anyone see what the problem is here? It keeps saying that the basket_text function is not defined but i don't know why? HTML &lt;script type='text/javascript'&gt; document.write(basket_text()); &lt;/script&gt; first.js function basket_text(){ var emptyBasketHTML = "&lt;span class='header_text'&gt;My Bag: (0 items) Total: &amp;#163;0.00&lt;/span&gt;"; var populated = "&lt;span class='header_text'&gt;&lt;a href='/basket'&gt;##ITEMS##&lt;/a&gt;&lt;br /&gt;Total: ##VALUE##&lt;/span&gt;"; //populated += "&lt;input type='submit' value='Checkout' name='commit' class='go_botton header-checkout-button'&gt;" populated += "&lt;form action='/basket'&gt;"; populated += "&lt;input type='submit' value='Checkout' class='header-checkout-button'&gt;" populated += "&lt;/form&gt;"; return fc_basket_text_from_cookie(emptyBasketHTML,populated); } second.js function fc_basket_text_from_cookie(empty_text, normal_text) { var basket = readCookie('bk'); if (basket) { var parts = decodeURIComponent(basket.replace(/\+/g, '%20')).split('|') if (parseInt(parts[1]) == 0) return normal_text.replace(/##VALUE##/g, parts[0]).replace(/##ITEMS##/g, parseInt(parts[1])); // return empty_text else return normal_text.replace(/##VALUE##/g, parts[0]).replace(/##ITEMS##/g, parseInt(parts[1])); } else { return ''; } } function basket_text() { return fc_basket_text_from_cookie('&lt;span&gt;Your basket is empty (not used?)&lt;/span&gt;', '&lt;span&gt;Items in basket: ##ITEMS##&lt;/span&gt;&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;##VALUE##&lt;/span&gt;&lt;/div&gt;') } Any insight is much appreciated? Cheers
tagged with: javascript
has comment: http://stackoverflow.com/comment/45072474
has title: ReferenceError: basket_text is not defined
has comment: http://stackoverflow.com/comment/45072500
has comment: http://stackoverflow.com/comment/45072829
has comment: http://stackoverflow.com/comment/45073231
has comment: http://stackoverflow.com/comment/45072979
has comment: http://stackoverflow.com/comment/45072937
answer count: 0
type: UnansweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/45072903
type: Question

http://stackoverflow.com/comment/45201290
type: QuestionComment
has text: Just to verify,THREE.ObjectLoader does not support this yet: https://github.com/mrdoob/three.js/issues/4967. Still, I should be able to get texture maps onto the geometry somehow! Here is a pull request that addresses this: https://github.com/denzp/three.js/commit/c069ec1b26014b55bc961846feaf7f7554fc2bb2 After building this version, the loadmanager does report images being loaded,but I get other errors: THREE.WebGLRenderer: WEBGL_compressed_texture_pvrtc extension not supported three.js (line 24404) and TypeError: invalid 'instanceof' operand THREE.ImmediateRenderObject three.js (line 21582)
comment on: http://stackoverflow.com/q/28431494
score: 0
type: Comment

http://stackoverflow.com/comment/45067919
type: QuestionComment
type: Comment
score: 0
has text: I don't mean to be THAT guy but, this question has been asked a few times before. [Have a look here for a number of solutions.](http://stackoverflow.com/questions/5867985/iframe-auto-100-height) :)
comment on: http://stackoverflow.com/q/28362958

http://stackoverflow.com/comment/44982122
score: 0
has text: @jfriend00 The JSON is about 9MB. What could I use to store it in? What I am trying to achieve is this: Once the JSON file is initially downloaded for the first time, each subsequent request will reuse the JSON initially downloaded. Only if the user manually requests an update will I refetch the JSON. I tried using `cache: true` in my AJAX call but that did not work. I also looked int HTML5 localStorage but the storage limits are not large enough. Any other suggestions? Thanks so much for your help so far!
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28316115

http://stackoverflow.com/q/28312702
type: Question
has title: Syntax error with jquery selecting table row with a specific attribute
tagged with: javascript
has answer: http://stackoverflow.com/a/28312769
accepted answer: http://stackoverflow.com/a/28312769
answer count: 2
tagged with: jquery-selectors
upvote count: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28312757
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28312757
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44975677
has body: I am trying to pull the data out from a table row so that it can be updated, but I am really confused as to why it is not happening. Below is a snippet of generated HTML. The record ID is held in the first data element as the value of the attribute "name". In the sample below it is 2. Dom Domestic No This has worked successfully to identify the appropriate records for deletion. I am now trying to extend on that, and get the values of the "ID" and "Description" elements as part of an update function, but keep getting this error in Firefox when trying to run the code. Syntax error, unrecognized expression: tr["title"="Grp14"] The js is: function show_update_form() { lvl_prefix = $("#lvl_prefix").val() ; id = $("#grp_table_id").val() ; var grp_list = new Array(); var list = "" ; // list of category groups to be deleted var target = "" ; var cnt = 0 ; var confirm_list = "" ; var msg = "" ; var sel_ID = "" ; var sel_Desc = "" ; var fld_ID = "" ; var fld_Desc = "" ; // create json list of groups to update list = '{"groups": [' ; target = id + " input:checked"; cnt = 0 ; $(target).each(function(index){ list += '{"id":' + $(this).attr("name") + '},' ; grp_list.push($(this).attr("name")) ; // get list so can confirm delete cnt++ ; sel_ID = 'tr["title"="Grp' + grp_list[cnt - 1] + '"] ' ; // get current values sel_Desc = 'tr["title"="Grp' + grp_list[cnt - 1] + '"] ' ; fld_ID = $('tr["title"="Grp2"] ').filter('td["title"="ID"]').text() ; // fld_Desc = $(sel_Desc).filter('td["title"="Description"]').text() ; dlg_grp_update.dialog("open"); // show form and populate with current values }) ; list = list.substr(0, (list.length -1)) + ']}' ; // remove last comma and add closing brackets if (cnt == 0) { // ensure there is something to update alert( "Please select the Group you wish to update.") ; return ; } } // function show_update_form Firefox has a hernia at the line: fld_ID = $('tr["title"="Grp2"] ').filter('td["title"="ID"]').text() ; You can see form the lines around it that the…
has comment: http://stackoverflow.com/comment/44976024

http://stackoverflow.com/comment/45118845
type: AnswerComment
comment on: http://stackoverflow.com/a/28388082
type: Comment
score: 0
has text: thank you , that's a good way, but Is there any way can add some error, or warning or information icon on the content left . like windows message box. then user can know current operation is success or error.

http://stackoverflow.com/comment/44980085
score: 0
comment on: http://stackoverflow.com/q/28315250
type: Comment
type: QuestionComment
has text: The form is doing another works as well. Actually the form send invitation to the friends and i want that if the submit button clicked and the invitation sent then delete some records from another table.

http://stackoverflow.com/a/53885202
type: Answer
score: 3
upvote count: 3
has body: $(document).ready(function() { jQuery.validator.addMethod("noSpace", function(value, element){ return value.indexOf(" ")&lt;0 &amp;&amp; value !==""; }, "Space are not allowed"); });
downvote count: 0
answers question: http://stackoverflow.com/q/28410596

http://stackoverflow.com/q/28314578
favorite count: 0
has title: Trouble Removing One Child DIV At A Time
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28314648
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28314648
has comment: http://stackoverflow.com/comment/44978901
has body: I am building a simple Grocery List App and I am having issues trying to remove a place holder div element. HTML Grocery List App To Buy: In Cart: JS $(function () { var rmv = false; $('#item_body').keydown(function(e) { if (e.keyCode == 13) { var add = $('#item_body').val(); $("#to_buy").append(' ' + add + ' '); $("#in_cart").append(' '); } $(".draggable_item").draggable( { axis: "x" }); $(".draggable_item").dblclick(function() { this.remove(); $('#in_cart > div:first').remove(); }); }); }); CSS #to_buy { float:left; width: 50%; height: 100%; color: #00E5EE; } #in_cart { float: left; width: 49%; height: 100%; color: #00E5EE; } #container { width:100%; height: 100%; } #left_side { height: 100%; width: 50%; float:left; background: #5D5851; } #right_side { height: 100%; width: 50%; float: left; background: #6D5D4D; } #item_body { float:left; clear:both; color: #326B62; } body { background: #B1ADA5; } .draggable_item { color: #FFF; } .holder { height: 20px; } So the screen is split vertically between "to_buy" and "in_cart." When I add an item to "to_buy" I also add a "dummy" div to "in_cart" so that the two sides remain even. However, when I double click to remove an item, when $('#in_cart > div:first').remove(); gets called, first one div is removed, then on the next double click two, then four etc etc. Apparently, it is getting called multiple times or something else wonky is going wrong.
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44978882

http://stackoverflow.com/q/28420883
tagged with: javascript
type: AnsweredQuestion
downvote count: 0
score: 1
favorite count: 0
tagged with: mapbox
has body: If I zoom far away and see the world multiples times, when I click somewhere near the edge a mouse click event is fired with some insane coordinates like [32, 500]. To get the real coordinates I have to use event.latlng.wrap(). Is there any way to enable wrapping by default, so I don't have to do it everywhere manually?
type: Question
has answer: http://stackoverflow.com/a/31104767
tagged with: leaflet
upvote count: 1
answer count: 1
has title: Leaflet coordinates wrapping
accepted answer: http://stackoverflow.com/a/31104767

http://stackoverflow.com/q/28353891
tagged with: ajax
tagged with: jquery-select2
accepted answer: http://stackoverflow.com/a/28357003
upvote count: 1
type: Question
type: AnsweredQuestion
has title: Setting default option with Select2 remote loading
tagged with: javascript
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/28357003
score: 1
tagged with: jquery
has body: I'm using the Select2 library to remote load data via ajax. However, I'd also like to provide a default option "all". Right now it's easy enough for me to augment the "results" array with an {name: 'All', id: 'all'} object, and I can make it so 'All' is initially selected, but what I want is that somebody sees 'All' as an option even before they've entered the minimum input length. Is that possible? Does anybody know how to accomplish this?
favorite count: 0

http://stackoverflow.com/comment/45107455
type: AnswerComment
has text: see the edit, in this line `var targetOffset = $target.offset().top;` set the margin if cover the text, to fix try like this `var targetOffset = $target.offset().top-60;`
type: Comment
comment on: http://stackoverflow.com/a/28383958
score: 0

http://stackoverflow.com/q/28313235
has body: I have a 4 step form with next and previous buttons. I am using jQuery Validation to validate the form. It validates the form when you click next, however, if you fail that step of the validation, neither next nor previous buttons work anymore. Below is my code. Does any one have suggestions? Javascript: $(document).ready(function() { $("body").on('click', '.next', function(){ if(animating) return false; animating = true; var type = $(this).parent().parent().attr("id"); if(type == "business_form"){ if($("#business_form").valid() == true){ $("#return-login2").hide(); current_fs = $(this).parent(); next_fs = $(this).parent().next(); //activate next step on progressbar using the index of next_fs $("#progressbar li").eq($("#business_form fieldset").index(next_fs)).addClass("active"); //show the next fieldset next_fs.show(); //hide the current fieldset with style current_fs.animate({opacity: 0}, { step: function(now, mx) { //as the opacity of current_fs reduces to 0 - stored in "now" //1. scale current_fs down to 80% scale = 1 - (1 - now) * 0.2; //2. bring next_fs from the right(50%) left = (now * 50)+"%"; //3. increase opacity of next_fs to 1 as it moves in opacity = 1 - now; current_fs.css({'transform': 'scale('+scale+')'}); next_fs.css({'left': left, 'opacity': opacity}); }, duration: 800, complete: function(){ current_fs.hide(); animating = false; }, }); } } }); $("body").on('click', '.previous', function(){ if(animating) return false; animating = true; current_fs = $(this).parent(); previous_fs = $(this).parent().prev(); //de-activate current step on progressbar $("#progressbar li").eq($("fieldset").index(current_fs)).removeClass("active"); //show the previous fieldset previous_fs.show(); //hide the current fieldset with style current_fs.animate({opacity: 0}, { step: function(now, mx) { //as the opacity of current_fs reduces to 0 - stored in "now" //1. scale previous_fs from 80% to 100% scale = 0.8 + (1 - now) * 0.2; //2. take current_fs to the right(50%) - from 0% …
has title: jQuery breaks after validation failure on multistep form
has comment: http://stackoverflow.com/comment/44977291
has answer: http://stackoverflow.com/a/28314202
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/44977746
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28314202
has comment: http://stackoverflow.com/comment/44977874
tagged with: jquery-validate
has comment: http://stackoverflow.com/comment/44976898
score: 0
has comment: http://stackoverflow.com/comment/44977369
answer count: 1
tagged with: jquery

http://stackoverflow.com/comment/45061758
comment on: http://stackoverflow.com/a/28359438
score: 0
type: AnswerComment
type: Comment
has text: create a fiddle and test it or edit the fiddle of user, seems your code breaks.

http://stackoverflow.com/a/28321789
type: Answer
has body: The problem is that you refer to serie OHLC which is supported only in Highstock. So you need to attach highstock.js
answers question: http://stackoverflow.com/q/28313524
score: 0

http://stackoverflow.com/comment/45059313
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28334988
has text: As you said the Response is blank , i think that means the php can't return the right data.

http://stackoverflow.com/a/28299485
has body: Write an own property: $scope.checkStorage = function () { return localStorage.getItem('itemChecker') !== null; } //show something here...
has comment: http://stackoverflow.com/comment/44951709
answers question: http://stackoverflow.com/q/28299264
score: 0
type: Answer

http://stackoverflow.com/q/28371320
type: UnansweredQuestion
has body: I have var myFirstArray = [{letter: 'a'}, {letter: 'b'}, {letter: 'c'}]; I would like to make a reference to myFirstArray, so I do this: var mySecondArray = myFirstArray; Pushing, splicing, modifying elements in myFirstArray will be shown in mySecondArray, but if I want to reset that array to something else: myFirstArray = []; or myFirstArray = someOtherData; My reference is lost. I understand why this is, but I want mySecondArray to point at whatever myFirstArray is pointing at, at any time. What's the best way to do this? My workarounds include: // Just empty the array and push it: while (myFirstArray.length) myFirstArray.pop(); for (var x in data) myFirstArray.push(x); // Or put the array in an object: var viewBag = {}; viewBag.myFirstArray = [...]; var mySecondArray = viewBag.myFirstArray; I dislike both of these options :( Edit: Consider another scenario: function doSomethingToMyArray (theArray) { // Say I get new data that will be formatted the way I want it to be // Shouldn't I be allowed to do this? var myNewData = [{ letter: 'd' }]; theArray = myNewData; } var myFirstArray = [{letter: 'a'}, {letter: 'b'}, {letter: 'c'}]; doSomethingToMyArray (myFirstArray); // At this point, myFirstArray will still be a, b, c instead of d
tagged with: object
has comment: http://stackoverflow.com/comment/45083279
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28371410
has comment: http://stackoverflow.com/comment/45083305
has answer: http://stackoverflow.com/a/28371712
tagged with: arrays
tagged with: javascript
score: 0
has title: Keeping Javascript reference after setting the reference to something else
has comment: http://stackoverflow.com/comment/45083687

asp.net-mvc
tags question: http://stackoverflow.com/q/28374086
tags question: http://stackoverflow.com/q/28369580
tags question: http://stackoverflow.com/q/28423190
tags question: http://stackoverflow.com/q/28433851
tags question: http://stackoverflow.com/q/28420117
tags question: http://stackoverflow.com/q/28348339
tags question: http://stackoverflow.com/q/28360838
tags question: http://stackoverflow.com/q/28379673
tags question: http://stackoverflow.com/q/28316478
tags question: http://stackoverflow.com/q/28284271
tags question: http://stackoverflow.com/q/28404398
tags question: http://stackoverflow.com/q/28377924
tags question: http://stackoverflow.com/q/28341418
tags question: http://stackoverflow.com/q/28319357
tags question: http://stackoverflow.com/q/28401444
tags question: http://stackoverflow.com/q/28322795
tags question: http://stackoverflow.com/q/28409784
tags question: http://stackoverflow.com/q/28363596
tags question: http://stackoverflow.com/q/28373894
tags question: http://stackoverflow.com/q/28392439
tags question: http://stackoverflow.com/q/28416367
tags question: http://stackoverflow.com/q/28401780
tags question: http://stackoverflow.com/q/28391323
tags question: http://stackoverflow.com/q/28426549
tags question: http://stackoverflow.com/q/28385418
tag name: asp.net-mvc
tags question: http://stackoverflow.com/q/28315968
tags question: http://stackoverflow.com/q/28336017
tags question: http://stackoverflow.com/q/28320795
tags question: http://stackoverflow.com/q/28399252
tags question: http://stackoverflow.com/q/28408377
tags question: http://stackoverflow.com/q/28305760
tags question: http://stackoverflow.com/q/28369700
tags question: http://stackoverflow.com/q/28280769
tags question: http://stackoverflow.com/q/28428513
tags question: http://stackoverflow.com/q/28337988
tags question: http://stackoverflow.com/q/28356390
tags question: http://stackoverflow.com/q/28343786
tags question: http://stackoverflow.com/q/28323176
tags question: http://stackoverflow.com/q/28310707
tags question: http://stackoverflow.com/q/28416551
tags question: http://stackoverflow.com/q/28324075
type: Tag
tags question: http://stackoverflow.com/q/28287924
tags question: http://stackoverflow.com/q/28395628
tags question: http://stackoverflow.com/q/28425366
tags question: http://stackoverflow.com/q/28435083
tags question: http://stackoverflow.com/q/28282043
tags question: http://stackoverflow.com/q/28366997
tags question: http://stackoverflow.com/q/28296813

http://stackoverflow.com/comment/44964745
has text: Ah ha! Well then, could you share a JSfiddle of your table-ified code?
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28292844

http://stackoverflow.com/comment/45016861
type: QuestionComment
score: 2
has text: If you have a different question, please ask a new question. It's not appropriate to add additional questions to an existing question. I have rolled back your last edit.
comment on: http://stackoverflow.com/q/28335143
type: Comment

http://stackoverflow.com/q/28320795
answer count: 3
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has comment: http://stackoverflow.com/comment/44989999
has body: In MVC 5, I have a Dialog for editing. The Content area is created from a Partial view. If I have the submit button inside the form in the Partial view it works. But I would like the Save button to be at the button of the Dialog and hence outside the form and Partial view. The problem is now that the forms data doesn't get posted. How would you fix this? I have two ideas: 1) Wrap the form outside the Partial view 2) Make a AJAX request and not use the helper, and collect the data from the form somehow? Doesn't feel like the right way. Dialog: &lt;div id="myModal" class="modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt; &lt;h4 class="modal-title" id="myModalLabel"&gt;Edit database connection&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; @{ Html.RenderPartial("View"); } &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button id="saveBtnSettings" type="button" class="btn btn-primary"&gt;Save&lt;/button&gt; &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; Dialog javascript var saveSettings = function () { var url = buildUrl("Edit", "Setting"); $.ajax({ type: "POST", url: url }) .done(function (data, textStatus, jqXhr) { alert('done' + data); }) .fail(function (jqXhr, textStatus, errorThrown) { alert(textStatus.toUpperCase() + ": " + errorThrown + 'Could not load html. '); }); }; Partial view @using (Ajax.BeginForm("Edit", "Setting", new AjaxOptions { UpdateTargetId = "div" })) { &lt;fieldset&gt; @Html.AntiForgeryToken() &lt;div class="form-horizontal"&gt; @Html.ValidationSummary(true, "", new { @class = "text-danger" }) &lt;div class="form-group"&gt; @Html.LabelFor(model =&gt; m…
favorite count: 0
has answer: http://stackoverflow.com/a/28320964
score: 6
has answer: http://stackoverflow.com/a/28321112
upvote count: 6
type: AnsweredQuestion
has title: Moving the submit button outside the form in MVC 5 with Partial view
has answer: http://stackoverflow.com/a/28320920
possible better answer: http://stackoverflow.com/a/28321112
tagged with: forms
type: Question
tagged with: asp.net-mvc
tagged with: javascript
tagged with: ajax
accepted answer: http://stackoverflow.com/a/28320920

http://stackoverflow.com/comment/45012815
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28332032
score: 0
has text: For example, the css linked on the home page gets applied to every page through out the application.

http://stackoverflow.com/comment/80372903
score: 2
comment on: http://stackoverflow.com/a/28321835
type: AnswerComment
has text: Someone needs to put this omnibar monopoly to a stop.
type: Comment

http://stackoverflow.com/comment/45090896
has text: @rblakeley Sometimes the verbose of the syntax doesnt explain the expected behaviour. In general, it's a matter of perspective
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28374257
type: AnswerComment

web-services
type: Tag
tags question: http://stackoverflow.com/q/28431669
tags question: http://stackoverflow.com/q/28389684
tag name: web-services
tags question: http://stackoverflow.com/q/28298074
tags question: http://stackoverflow.com/q/28290864
tags question: http://stackoverflow.com/q/28331327
tags question: http://stackoverflow.com/q/28324015

http://stackoverflow.com/q/28334286
has answer: http://stackoverflow.com/a/28334324
type: AnsweredQuestion
type: Question
tagged with: jquery-mobile
possible better answer: http://stackoverflow.com/a/28334335
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28334324
has answer: http://stackoverflow.com/a/28334335
score: 0
answer count: 2
tagged with: jquery
has title: How to change a jquery mobile radio button group with javascript code?
has body: In jquery mobile, I want to change a radio group with javascript code. I have this: Co-op Department: Arts & Science Management IDS JS var all = $("#profile-edit-form").find("input"); all.removeAttr("checked"); $("#profile-edit-form").find("input[value="+user['department_name']+"]").attr( "checked", "checked" ); all.checkboxradio( "refresh" ); but its not working... Does anyone know what is wrong? It is putting a checked attribute on the input tag though. Thanks

http://stackoverflow.com/q/28300651
tagged with: php
type: AnsweredQuestion
downvote count: 0
score: 1
has body: I have: $this-&gt;addElement('select', 'type', array( 'label' =&gt; 'Banner type', 'required' =&gt; true, 'multiOptions' =&gt; array( '' =&gt; 'Please select', '1' =&gt; 'Image', '3' =&gt; 'Flash', '4' =&gt; 'Html' ), 'value' =&gt; '', )); but when rendered the selected dropdown it has the id = "type" attribute which I don't want. I am cloning this in JavaScript and after all the events it does not work properly.
tagged with: forms
has answer: http://stackoverflow.com/a/28300927
accepted answer: http://stackoverflow.com/a/28300927
type: Question
has answer: http://stackoverflow.com/a/28300869
tagged with: zend-framework
tagged with: javascript
answer count: 2
upvote count: 1
possible better answer: http://stackoverflow.com/a/28300869
tagged with: jquery
favorite count: 0
has title: Remove id attribute from Zend Form element

http://stackoverflow.com/comment/45089385
type: AnswerComment
type: Comment
has text: Thank, the issue is closed. I have written one function thats deletes all records.
comment on: http://stackoverflow.com/a/28371587
score: 0

http://stackoverflow.com/comment/44975405
type: Comment
has text: Ah sorry, didn't see that. It seems a bit hacky, but what if you changed `item` in your `onchange` to `{{ item }}`?
score: 0
comment on: http://stackoverflow.com/q/28312512
type: QuestionComment

http://stackoverflow.com/comment/44923959
type: QuestionComment
comment on: http://stackoverflow.com/q/28284765
has text: and the host page url?
score: 0
type: Comment

http://stackoverflow.com/comment/45716799
has text: can you check error log in console?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28343464

http://stackoverflow.com/q/28373894
has title: HttpPostedfileBase is null using jQuery Ajax
has comment: http://stackoverflow.com/comment/45088619
has body: I have problem with uploading file In Asp.net Mvc. First of all I should use Ajax to pass the upload file value. In javascript I have model that I fill it, When I check it with debugger is correctly fill the object, but when I send this model to server (Controller ) The httpPostedfileBase value is Always null. I search it on google, in some post I saw that I cant use file uploader with Ajax, but in other I saw that I can. But I can not fix my Code. There is my Javascript Code. $(document).ready(function () { $('#btnUploadFile').on('click', function () { var data= new FormData(); debugger; var files = $("#fileUpload").get(0).files; if (files.length > 0) { data.append("UploadedImage", files[0]); } var ResturantSharingViewModel = { Type: $("#SharingTargetType").val(), SharingTitle: $("#SharingTitle").val(), content: $("#Content").val(), ItemId : $("#ItemId").val(), Photos: files[0] }; $.ajax({ type: 'POST', dataType: 'json', contentType: 'application/json', url: '<%= Url.Action("SaveOneDatabase")%>', data: JSON.stringify(ResturantSharingViewModel), success: function (result) { var rs = result; }, error: function () { alert("Error loading data! Please try again."); } }); My Controller public virtual bool SaveOneDatabase(ResturantSharingViewModel result) My ResturantSharingViewModel View Model public class ResturantSharingViewModel { public Guid SharingPremiumHistoryID { get; set; } public string SharingTitle { get; set; } public string Content { get; set; } public DateTime AddedDate { get; set; } public bool IsSubmit { get; set; } public DateTime SubmitedDate { get; set; } public IEnumerable<SelectListItem> SharingTypes { get; set; } public IEnumerable<SelectListItem> SharingTargetType { get; set; } public short Type { get; set; } public Guid ItemId { get; set; } public HttpPostedFileBase[] Photos { get; set; } } My Html Elements <%--<% =Html.BeginForm("Add","PremiumSharing") %>--%> ارسال خبر <%= Html.HiddenFor(model => model.SharingPremiumHistoryID) %> <%= Html.HiddenF…
upvote count: 23
has comment: http://stackoverflow.com/comment/45088830
has answer: http://stackoverflow.com/a/47567816
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28374183
possible better answer: http://stackoverflow.com/a/47567816
score: 23
type: Question
linked to: http://stackoverflow.com/q/166221
tagged with: asp.net-mvc
downvote count: 0
has comment: http://stackoverflow.com/comment/45088671
tagged with: javascript
linked to: http://stackoverflow.com/q/4526273
accepted answer: http://stackoverflow.com/a/28374183
answer count: 3
has answer: http://stackoverflow.com/a/39053952
favorite count: 0

magnific-popup
tags question: http://stackoverflow.com/q/28308512
tags question: http://stackoverflow.com/q/28342650
tags question: http://stackoverflow.com/q/28325809
tags question: http://stackoverflow.com/q/28356353
type: Tag
tag name: magnific-popup
tags question: http://stackoverflow.com/q/28334242

http://stackoverflow.com/a/28394627
has comment: http://stackoverflow.com/comment/45134481
type: Answer
accepted answer of: http://stackoverflow.com/q/28390564
answers question: http://stackoverflow.com/q/28390564
has body: Had a quick look at things. I think your code isn't working because when you delete a row, it alters the sheets structure, so the next delete will be wrong. Example. You find a match in row 4 of your spreadsheet. Then row 4 is deleted in sheet. So row 5 becomes row 4 now i gets increased by 1, so now it's on row 5 in your data array. If a match is found, Row 5 in sheet is deleted, when it should be Row 4 that's deleted. The only thing I can think to solve this is do the matching first, then deleting afterwards, with something like this. for (var i = 0; i &lt; data.length; i++ ){ if ( data[i][0] == 'recorded') { dest.push(data[i]); }} for (var x = 0; x &lt; data.length; x++ ){ if ( data[x][0] == 'recorded') { ss.deleteRow(x+1) ; }} Perhaps this might work as a solution, it's untested. function moveData(){ var s = SpreadsheetApp.openByUrl('Link1'); var ss = s.getSheetByName('Sheet28'); var t = SpreadsheetApp.openByUrl('Link2'); var ts = t.getSheetByName('Sheet11'); var data = ss.getDataRange().getValues(); var dest = []; for (var i = 0; i &lt; data.length; i++ ){ if ( data[i][22] == 'recorded') { dest.push(data[i]); }} for (var x = 0; x &lt; data.length; x++ ){ if ( data[x][22] == 'recorded') { ss.deleteRow(x+1) ; }} if (dest.length &gt; 0 &amp;&amp; dest[0].length &gt;0){ ts.getRange(ts.getLastRow()+1,1,dest.length,dest[0].length).setValues(dest); } } EDIT an after thought to solve the issue, would be perhaps. If the row is a match, delete the entry from both the data array AND the spreadsheet. Then the i var could be kept in sync with row numbers. Something along these lines, again untested for (var i = 0; i &lt; data.length; i++ ){ if ( data[i][22] == 'recorded') { dest.push(data[i]); ss.deleteRow(i+1) ; delete data[i]; i= i -1 ; } } I hope this helps
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/45134963
has comment: http://stackoverflow.com/comment/45134610
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45073389
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28350683
type: AnswerComment
has text: Okay that's great. However, what if one of my items returned in my Web Service is itself an object such as: Object { 5118="Costa Rica", 5129="Ecuador and Galapagos", 4851="Venezuela"} How would I then loop through these items and output the Key Value pairs?

http://stackoverflow.com/a/28433479
has comment: http://stackoverflow.com/comment/45198019
has comment: http://stackoverflow.com/comment/45197555
has comment: http://stackoverflow.com/comment/45239652
answers question: http://stackoverflow.com/q/28433367
has comment: http://stackoverflow.com/comment/45197580
has comment: http://stackoverflow.com/comment/45198055
has comment: http://stackoverflow.com/comment/45197566
has comment: http://stackoverflow.com/comment/45197531
has comment: http://stackoverflow.com/comment/45198130
type: Answer
has body: Don't perform the conditional check in client-side code, perform it in server-side code. Assuming you have JavaScript implementations of what you want to achieve, let's call them these respectively: navigateToLink(); showPopUp(); Then you'd conditionally emit the code for one or the other depending on a server-side session check. Something like this: &lt;?php if ($_SESSION['someValue'] == 'someKnownValue') { ?&gt; navigateToLink(); &lt;?php } else { ?&gt; showPopUp(); &lt;?php } ?&gt; The idea is that server-side code should determine what the user can or can not do. Anything emitted to client-side code is entirely visible to (and modifiable by) the user.
has comment: http://stackoverflow.com/comment/45197901
score: 2
upvote count: 3
has comment: http://stackoverflow.com/comment/45239125
has comment: http://stackoverflow.com/comment/45197432
has comment: http://stackoverflow.com/comment/45227641
has comment: http://stackoverflow.com/comment/45197500
downvote count: 1

http://stackoverflow.com/comment/45003284
type: AnswerComment
score: 0
type: Comment
has text: and do we need this div3 at all? or could we somehow get the dynamic height of div2, so we know when to stick div1?
comment on: http://stackoverflow.com/a/28324355

http://stackoverflow.com/q/28322079
type: Question
answer count: 1
tagged with: javascript
score: 0
linked to: http://stackoverflow.com/q/23803743
accepted answer: http://stackoverflow.com/a/28322284
has title: Working with promises inside nodejs controller
tagged with: events
tagged with: node.js
tagged with: promise
has answer: http://stackoverflow.com/a/28322284
tagged with: error-handling
type: AnsweredQuestion
has body: I have the following scenario; User requests files to be attached to a project Ctrl first looks to see that the user has access to the project If user has access, then allow the files to be uploaded and attached If something went wrong with the upload then return the error that was found Code projectService.getProject(ID) .then(function (project) { if (!project) { return commonService.sendResponse(res, 404); } fileService.handleFileUpload(ID, [].concat(req.files.file)) .then(function (files) { return commonService.sendResponse(res, 200, assets); }); }) .catch(function (err) { return commonService.sendError(res, err); }) .finally(function cleanup() { console.log('Fileupload completed'); }); Note: happy path flow works however the handleFileUpload can return an error if certain conditions are not met. If this method returns an error the catch returns the correct error but in the logs I see the following: [TypeError: Cannot call method 'then' of undefined] 12:44:30.815 service [ERROR] Cannot call method 'then' of undefined (TypeError) The line that it complains about is the following: .then(function (files) { The handleFileUpload looks like the following: var handleFileUpload = function (projectId, fileList) { var deferred = Promise.defer(); var reject = function (err) { deferred.reject(err); }; if (!(containsThumb(fileList)){ return reject(new Error('Missing thumbnail in request')); } /** some some logic **/ return deferred.promise; }; } exports.handleFileUpload = handleFileUpload; Everything kinda works! But cant figure out the issue with the exception being logged. Any help is appreciated. J

header
type: Tag
tag name: header
tags question: http://stackoverflow.com/q/28382847

http://stackoverflow.com/comment/45082192
comment on: http://stackoverflow.com/q/28370719
type: Comment
type: QuestionComment
score: 3
has text: check value of answer at each submit! alert it and see what it gives!

http://stackoverflow.com/comment/44957429
score: 4
has text: why not just run one after the other in the same callback?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28303059

http://stackoverflow.com/comment/45083329
type: Comment
score: 1
has text: If you're going to set both variables all the time, what's the point of having two variables?
comment on: http://stackoverflow.com/a/28371410
type: AnswerComment

http://stackoverflow.com/q/28393155
answer count: 0
type: UnansweredQuestion
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/63162225
tagged with: javascript
tagged with: jquery
has body: I am using HTML Table Export jquery Plugin for exporting html table to pdf but it is not exporting more than 4 Rows and Colums and also it is not adding border to table colums and row when i am exporting the html table to pdf. Can anyone suggest me how can i do that.. Please Help me... Here is my code for it $('#datatable_example').tableExport({type:'pdf',pdfFontSize:'7',escape:'false'});
tagged with: jquery-plugins
has title: HTML Table Export jquery Plugin is not exporting more than 4 colums and rows PDF
tagged with: http://stackoverflow.com/tag/pdf
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
score: 1
favorite count: 0

http://stackoverflow.com/comment/45135703
has text: @mars It is appended here: `var svg = d3.select("#chart").append("svg")`. I got the code for show at least the axis quite easily. The rest is too much work for 5mins.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28398997
type: Comment

http://stackoverflow.com/comment/44990367
type: AnswerComment
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28320150
has text: You could also use arrow functions which have an implicit `.bind(this)`, e.g. `<SubComponent onStatusChanged={e => this.onChildStatusChanged(e) } />`. These are also often succinct enough to do simple operations inline, e.g. ` this.setState({foo: e.target.value})} />`

http://stackoverflow.com/comment/45150807
comment on: http://stackoverflow.com/q/28408481
has text: This perhaps? https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers.onbeforeunload
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/45119254
has text: I tried putting $('.changer').click inside the first click callback after $(this).hide(); and it didn't work
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28390887

http://stackoverflow.com/q/28407083
type: Question
tagged with: yui
has title: JavaScript YUI Autocomplete Source change
answer count: 1
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28436532
has body: I'm using YUI for an auto completion and I need the data for the auto completion to change dynamically. For example I have an input box which says "user name" and it will autocomplete according to function(userName) which would return an array accordingly. How do I implement that?
type: UnansweredQuestion

http://stackoverflow.com/comment/45060636
type: Comment
score: 1
has text: you are saying if filename is not empty.. I do not see a "filename" field in the javascript form. There for it is evaluating to false I think.
type: QuestionComment
comment on: http://stackoverflow.com/q/28358780

http://stackoverflow.com/a/28320489
has body: timepicker (as the name implies) is designed to pick a time of day (i.e. usually between 0 and 23 hours), not a time interval. Perhaps you should look at jQuery Time Entry. It has an example "unlimited hours" under "Formats".
downvote count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/44990149
has comment: http://stackoverflow.com/comment/44989809
type: Answer
score: 2
answers question: http://stackoverflow.com/q/28320074

http://stackoverflow.com/q/28352169
score: 0
has comment: http://stackoverflow.com/comment/45049024
has title: JSON parse error callback was not called in AJAX request to WCF service
has comment: http://stackoverflow.com/comment/45048345
has comment: http://stackoverflow.com/comment/45048966
type: UnansweredQuestion
tagged with: wcf
has comment: http://stackoverflow.com/comment/45048794
has body: I have created a WCF Service and uploaded to a server and s up and running fine. The problem is when I try to access it via an ajax request. [WebInvoke(Method = "GET", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)] [OperationContract] void UploadPic(string imageData); public void UploadPic(string imageData) { try { string Pic_Path = HttpContext.Current.Server.MapPath("MyPicture.png"); using (FileStream fs = new FileStream(Pic_Path, FileMode.Create)) { using (BinaryWriter bw = new BinaryWriter(fs)) { byte[] data = Convert.FromBase64String(imageData); bw.Write(data); bw.Close(); return; } } } catch (Exception ex) { return; } } The ajax request is being done from another domain, so I'm using jsonp so the request doesn't gets block by CORS issues. But I'm getting this specific error Error: jQuery110107099825242048435_1423163196150 was not called. My ajax call is like this: $.ajax({ type: 'GET', url: 'https://g9w2493g.houston.hp.com/marketing/David/Service1.svc/UploadPic', data: {imageData: dataURL},//'{ "imageData" : "' + dataURL + '" }', contentType: 'application/json; charset=utf-8', jsonp: 'jsonp', dataType: 'jsonp', success: function (jsonData) { var data = JSON.parse(jsonData); }, error: function (request, textStatus, errorThrown) { console.log(request.responseText); console.log(textStatus); console.log(errorThrown); } }); I hope someone can help me with this problem or is someone has experience the same error. Thanks for your help in advance.
answer count: 0
linked to: http://stackoverflow.com/q/11090835
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/45048266
has comment: http://stackoverflow.com/comment/45048575
tagged with: javascript
tagged with: jquery
tagged with: ajax

http://stackoverflow.com/q/28311108
tagged with: express
upvote count: 2
answer count: 1
favorite count: 0
tagged with: node.js
has answer: http://stackoverflow.com/a/28350982
accepted answer: http://stackoverflow.com/a/28350982
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44973190
downvote count: 0
type: Question
has title: TypeError: Object #<ServerResponse> has no method 'send'
has comment: http://stackoverflow.com/comment/44973340
has comment: http://stackoverflow.com/comment/44973128
tagged with: javascript
has body: I've been working on an Express app and I just started getting a super weird error saying TypeError: Object #&lt;ServerResponse&gt; has no method 'send'. It started as I was trying to set up some routing for my app via the router provided by Express. I did some Googling and found that other people that were getting the TypeError: Object #&lt;ServerResponse&gt; has no method __ (fill in the blank) were either not using Express, or they were doing something weird with the router. So, I created a new app file named app-test.js and trimmed out all of the extraneous code, including the router. However, I'm still getting the same error. Here's my setup now while I'm trying to figure out the problem: server.js var app = require("./app-test"); app.set("port", process.env.PORT || 8000); var server = app.listen(app.get("port"), function () { var host = server.address().address; var port = server.address().port; console.log("Example app listening at http://%s:%s", host, port) }); module.exports.app = app; module.exports.server = server; app-test.js var express = require('express'), app = express(), path = require('path'); // view engine setup app.set('views', path.join(__dirname, 'views')); app.set('view engine', 'jade'); app.get('/testing', function(req, res) { res.send('Hello World!'); }); module.exports = app; I know that Express builds on Node.js's http's ServerResponse object. So, certain methods like .end() will still work even if Express isn't setup. However, the really weird thing about this problem is that Express's .render() method still works fine. I'm completely stumped by this one. Any help would be greatly appreciated.

http://stackoverflow.com/comment/45135117
type: AnswerComment
comment on: http://stackoverflow.com/a/28399623
type: Comment
has text: i want to delete this i think its causing issue of not showing. var html = ' Verification Code '; html += ' '; html += ' ';
score: 0

http://stackoverflow.com/comment/44920121
comment on: http://stackoverflow.com/q/28282559
score: 0
type: Comment
type: QuestionComment
has text: Am I too new to upvote or mark as answer? I don't see any UI for that.

http://stackoverflow.com/comment/45103613
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28382408
has text: what is your output code form server?
score: 0

http://stackoverflow.com/comment/45033468
has text: Could you show the part where you actually trying to close the dialog? Where do you call closeThisDialog()?
comment on: http://stackoverflow.com/a/28344546
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45134752
has text: function allowDrop(ev) { ev.preventDefault(); } function drag(ev) { ev.dataTransfer.setData("text", ev.target.id); } function drop(ev) { var data = ev.dataTransfer.getData("text"); this.appendChild(document.getElementById(data)); } document.getElementById("divDrop").addEventListener("drop", drop, false);
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28380886
type: AnswerComment

http://stackoverflow.com/a/28331216
answers question: http://stackoverflow.com/q/28330549
has comment: http://stackoverflow.com/comment/48073459
type: Answer
score: 2
downvote count: 0
has body: look into $ionicScrollDelegate. You can set and get the scroll position
upvote count: 2

http://stackoverflow.com/q/28368039
tagged with: javascript
has answer: http://stackoverflow.com/a/28368664
tagged with: jquery
has comment: http://stackoverflow.com/comment/45077063
has body: I'm not very firm with JS and this whole jQuery thing. This is my actuall HTML Output created in a foreach-loop: $('#ProjectOfferPosition0IsystemTypeVariantId').on('change', function () { var prices = []; prices[1] = 500.00; prices[2] = 600.00; prices[6] = 1000.00 var key = $('#ProjectOfferPosition0IsystemTypeVariantId option:selected').val(); var oldPrice = 800.00; $('#ProjectOfferPosition0Price').val(prices[parseInt(key,10)] + oldPrice); }); I ohne Variante wählen INPUT Basis System Wohnung 60 INPUT System Wohnung 100 INPUT System Haus 300 when i change the value of the dropdown i want the textfield in the same row updated (add a option-price to the existing product). thing is tho, i don't know how to 'read' which row i'm in (the [0]-Part) EDIT got it running. still but still hardcoded, not dynamical responding to multiple rows thank you for your help in advance
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45077027
tagged with: php
has comment: http://stackoverflow.com/comment/45089259
tagged with: cakephp
has comment: http://stackoverflow.com/comment/45077073
type: Question
score: 0
answer count: 2
has title: jQuery change textfield in tablerow by dropdown
has answer: http://stackoverflow.com/a/28368186

http://stackoverflow.com/a/28368034
has comment: http://stackoverflow.com/comment/45079505
type: Answer
has comment: http://stackoverflow.com/comment/45078912
upvote count: 4
has comment: http://stackoverflow.com/comment/45116591
score: 4
accepted answer of: http://stackoverflow.com/q/28364122
has body: Try window.AudioContext instead.
answers question: http://stackoverflow.com/q/28364122
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45362190
comment on: http://stackoverflow.com/a/28488938
type: Comment
score: 1
type: AnswerComment
has text: Cool! Thanks. That helped a lot. I had seen the ! operator but I thought that it just didn't work. I know I understand that I actually had to include something for it to parse.

http://stackoverflow.com/q/28421587
has body: I have a long form that is broken into sections that are in jquery accordion panels. When the user is done filling in the form in one panel they go to the next panel and fill in the form there. The accordion breaks the long form into steps. But, when the user completes the last input on one panel pressing the tab key won't take them to the next field, in the next panel, unless I do it programmaticly. For the inputs that are type text, the following code works well. But, where the inputs are type radio it is not working. This following code first assigns the keydown function to a text box, then fails to assign it to a set of three radio buttons, then succeeds again to assign it to a text box. What's frustrating is that if I copy and paste the middle block into the chrome javascript console then it will work like a charm. So, what's the problem? document.onReady(function(){ $('#f-phone').keydown(function(e){ var code = e.keyCode || e.which; if ( code === 9) { my_accordion.accordion("option", "active", 3); } }); $('input[name=shipping_method]').keydown(function(e){ var code = e.keyCode || e.which; console.log('code is '+code); }); $('#f-special_instructions').keydown(function(e){ var code = e.keyCode || e.which; if ( code === 9) { my_accordion.accordion("option", "active", 5); } }); }); HTML follows: Phone (Recipient)* Shipping Options Times are estimates once shipped. Standard Saver Expedited
has title: jquery: $(input).keydown fails to set handler on radio button, same code works for text
accepted answer: http://stackoverflow.com/a/28613912
possible better answer: http://stackoverflow.com/a/28422202
has answer: http://stackoverflow.com/a/28422202
type: AnsweredQuestion
tagged with: forms
has comment: http://stackoverflow.com/comment/45176558
type: Question
has answer: http://stackoverflow.com/a/28613912
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/28364372
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28364292
has body: This could be the problem flag = flag &amp;&amp; validation_form(event_title); flag = flag &amp;&amp; validation_form(country); flag = flag &amp;&amp; validation_form(state); flag = flag &amp;&amp; validation_form(venue); flag = flag &amp;&amp; validation_form(category); javascript runtime may be smarter and convert above code block to flag=validation_form(event_title)&amp;&amp;validation_form(country)&amp;&amp;validation_form(state)&amp;&amp;validation_form(venue)&amp;&amp;validation_form(category); As you know in &amp;&amp; operations if left side evaluated to false right side is ignored(as false&amp;&amp;whatever is false anyway). Solution is to have something like var val_title = validation_form(event_title); var val_country = validation_form(country); etc and finally flag = val_title&amp;&amp; val_country&amp;&amp;....
type: Answer
answers question: http://stackoverflow.com/q/28364292

http://stackoverflow.com/a/28426498
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28425978
downvote count: 0
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/28425978
has body: You can check if the selected value is the same on the others using val and filter. Filter: Reduce the set of matched elements to those that match the selector or pass the function's test. Code: function inputsHaveDuplicateValues() { var hasDuplicates = false; $('.className').each(function () { var inputsWithSameValue = $(this).val(); hasDuplicates = $('.className').not(this).filter(function () { return $(this).val() === inputsWithSameValue; }).length &gt; 0; if (hasDuplicates) return false }); return hasDuplicates; } $('button').click(function () { alert(inputsHaveDuplicateValues()); }) Demo: http://jsfiddle.net/IrvinDominin/u3czyjt4/

http://stackoverflow.com/a/28418000
has comment: http://stackoverflow.com/comment/45268816
accepted answer of: http://stackoverflow.com/q/28292677
type: AcceptedAnswer
has body: Istanbul let's you define your own custom ignores explicitly in your code here You may use /* istanbul ignore define */ at the top of your file to prevent define(...) from been checked. Hope it'll help
downvote count: 0
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28292677

http://stackoverflow.com/comment/44953032
comment on: http://stackoverflow.com/q/28300586
type: QuestionComment
has text: @epascarello `SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data`
score: 0
type: Comment

http://stackoverflow.com/a/28467151
answers question: http://stackoverflow.com/q/28386910
has body: Here is the final code that does exactly what I want: - the validateForm() function works as it should. If the form is not complete, it returns false, an alert pops up and the form does not submit - if validateForm() returns true, the form gets submitted, the confirmation alert pops up and the page does NOT refresh. Users can then build a new configuration and submit a new request without re-entering all the contact info. The 2 .preventDefault did the trick! $('form').on('submit', function(e) { e.preventDefault(); //prevents page refresh when form is submitted //If form could not be validated var x = validateForm(); if(x == false){ //prevent the form form submitting e.preventDefault(); } //else else { //form input is valid //make the ajax call $.ajax({ type: "post", url: "client_config_send2.php", data: $(this).serialize(), success: function(data){ alert('Thank you! we will get back to you within 24 hours. Please check your junk / spam folder if you do not receive a response within that time.'); } }); } }); Thanks everyone for your help!
score: 0
type: Answer

http://stackoverflow.com/q/28417138
accepted answer: http://stackoverflow.com/a/28417474
has answer: http://stackoverflow.com/a/28417472
tagged with: mysql
linked to: http://stackoverflow.com/q/19027644
type: Question
has title: Displaying MySql data with a html table
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has body: I have a pop-up form which gets data from a user and adds it into the MySQL phpmyadmin table, i want to be able to display this data within a html table once the popup closes, after i click submit i am directed back to the homepage, where I want the data to be displayed on the table. M.html CRN Title Co-Ordinator Coursework Number Contribution Edit Upload Manage Grades add.php $display_query = "SELECT CRN, Title, Co-Ordinator, CourseworkNumber, Contribution FROM Modules"; $displayresult = mysqli_query($con, $display_query); $num = mysql_numrows($displayresult); mysqli_close($con); header("Location: ../views/M.html"); I am new to html and php unsure how I can link this to the html
has answer: http://stackoverflow.com/a/28417474
has comment: http://stackoverflow.com/comment/45168045
tagged with: php
possible better answer: http://stackoverflow.com/a/28417472
type: AnsweredQuestion

http://stackoverflow.com/q/28325645
tagged with: logout
linked to: http://stackoverflow.com/q/20446803
has title: Google+ Oauth 2.0 - Logout works well BUT automatically login after refreshing webpage
upvote count: 2
has answer: http://stackoverflow.com/a/52339732
type: Question
tagged with: javascript
answer count: 2
score: 2
has comment: http://stackoverflow.com/comment/45256222
has comment: http://stackoverflow.com/comment/53721896
has answer: http://stackoverflow.com/a/28334542
downvote count: 0
tagged with: google-plus
favorite count: 0
tagged with: oauth
type: UnansweredQuestion
tagged with: google-app-engine
has body: Heading I'm working on Google App Engine. Using Python with the webbapp2 framework. I use Google API to login e logout. It seems to work well. Login and logout are perfect. This is the Google official guide: https://developers.google.com/+/web/signin/ The problem is that just after being logged out refreshing the page the user will automatically logged-in again. This is Login Button with relative parameters: GOOGLE+ LOGIN This is Logout Button: Disconnect This is the Logout callback function: What do you think? What could be the problem? Something concerning cookies setting?

http://stackoverflow.com/comment/45117461
type: AnswerComment
comment on: http://stackoverflow.com/a/28389911
type: Comment
has text: ok i modify it ,, but still the script will never fire ... i mean if i click on a button with "btn btn-primary" class, the button will not be disabled and the progress will not show !!
score: 0

http://stackoverflow.com/comment/45139227
type: QuestionComment
comment on: http://stackoverflow.com/q/28401952
score: 0
type: Comment
has text: It works for me in Firefox, Chrome, and Opera. All three lines of text are displayed. Is it possible that Javascript is disabled in your browser?

http://stackoverflow.com/comment/44985919
comment on: http://stackoverflow.com/q/28318433
score: 0
type: Comment
type: QuestionComment
has text: i am getting the result i want sir @kevpoccs what i want is to put that result in onclick that will save the data in database

http://stackoverflow.com/a/28430903
type: Answer
score: 2
answers question: http://stackoverflow.com/q/28430733
upvote count: 2
downvote count: 0
has body: Ext.getStore('storeIdHere') is one way to do it

http://stackoverflow.com/q/28432980
tagged with: jsonp
tagged with: javascript
has answer: http://stackoverflow.com/a/28921785
answer count: 1
downvote count: 0
has body: I want to use the Wikipedia API to select a famous person's name from the People category from my Javascript application. Basically, I would like to send the name or partial name and get results that contains the Wikipedia URL, title, an excerpt of the content and if possible the main picture. I have been trying two ways, but I cannot make it work as I want. First I have tried with search, but I cannot find the way of make it return the url. Would sectiontitle be good as unique identifier? Can snippet be plain text somehow? Cannot find how to filter by category. Second, I have tried with opensearch, but the JSON response does not contain images, while the XML response does: JSON: http://en.wikipedia.org/w/api.php?action=opensearch&amp;search=mariano&amp;namespace=0&amp;format=json XML: http://en.wikipedia.org/w/api.php?action=opensearch&amp;search=mariano&amp;namespace=0&amp;format=xml It is not possible to filter by category. Also, some results include a link to the disambiguation page, when I would prefer to get the list of possible matches rather than such link. How could I search by title and get full title, url, small description and a picture link?
favorite count: 0
tagged with: mediawiki-api
tagged with: wikipedia-api
score: 2
has title: Using Wikipedia API for autocomplete search
upvote count: 2
type: UnansweredQuestion
type: Question

http://stackoverflow.com/comment/45163294
type: Comment
has text: This works & answers the question I asked. I asked the question without saying my original array was actually an object. To fix this, I was able to get the keys from the object using `_.keys`, then I was able to sort them using your method `reference_array.indexOf(a) - reference_array.indexOf(b);` I asked a 2nd question with my exact code (http://stackoverflow.com/questions/28395477/javascript-sorting-parsed-json-within-each-loop), but in the end I had to figure out the conversion of object to array. I used this answer and the one over there to finally solve my sorting problem.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28377564

http://stackoverflow.com/comment/45202817
comment on: http://stackoverflow.com/a/28436006
has text: thank u so much. that helps me ;) how can i use the Array now in the html code? i tried $('#name1').html(lines[0]); then in html:
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45040317
has text: Look at using `Date.parse(timeSheet.totalTime)` (http://www.w3schools.com/jsref/jsref_parse.asp) to get the milliseconds for each date. Then, you can calculate the number of minutes, sum them up for all of your totalTimes, and print them nicely.
score: 0
comment on: http://stackoverflow.com/q/28347425
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28354278
score: 0
answers question: http://stackoverflow.com/q/28322819
type: Answer
has body: You should be able to download the whole file with an XMLHttpRequest, turn it into Blob, and get a URL for it with URL.createObjectURL(). Then use that URL in the tag. (I haven't tried this, at least not recently.) This might not be a great idea with very large video files.

http://stackoverflow.com/a/28343105
has body: It doesn't open on first click cause this is the time you BIND it to the element. Hovewer, we see in documentation that we can instantly open MagnificPopup. // Open popup immediately. If popup is already opened - it'll just overwite the content (but old options will be kept). // - first parameter: options object // - second parameter (optional): index of item to open $.magnificPopup.open({ items: { src: 'someimage.jpg' }, type: 'image' // You may add options here, they're exactly the same as for $.fn.magnificPopup call // Note that some settings that rely on click event (like disableOn or midClick) will not work here }, 0); http://dimsemenov.com/plugins/magnific-popup/documentation.html#options
has comment: http://stackoverflow.com/comment/45036499
type: Answer
has comment: http://stackoverflow.com/comment/45039455
answers question: http://stackoverflow.com/q/28342650
has comment: http://stackoverflow.com/comment/45039169
has comment: http://stackoverflow.com/comment/45038214
has comment: http://stackoverflow.com/comment/45064124
has comment: http://stackoverflow.com/comment/45038580
score: 0
has comment: http://stackoverflow.com/comment/45040598
has comment: http://stackoverflow.com/comment/45039439

http://stackoverflow.com/q/28297260
linked to: http://stackoverflow.com/q/12637395
has answer: http://stackoverflow.com/a/28297850
favorite count: 0
has title: How to upload image file from local hard drive in HTMlL5 canvas using fabricjs
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/56841235
has body: &lt;html&gt; &lt;input type="file" name="Image"&gt; &lt;/html&gt; &lt;script&gt; fabric.Image.fromURL('image.jpg', function(img) {enter code here var oImg = img.set({ left: 50, top: 100, angle: 00 }).scale(0.9); canvas.add(oImg).renderAll(); canvas.setActiveObject(oImg); }); &lt;/script&gt; i m trying to upload image file from the hard drive by input tag. This is my sample code. tell me how can i change this script so that i can choose the picture from input.
answer count: 4
has answer: http://stackoverflow.com/a/28297538
downvote count: 1
type: Question
score: 3
tagged with: javascript
tagged with: fabricjs
has answer: http://stackoverflow.com/a/28297323
upvote count: 4
tagged with: html5-canvas

http://stackoverflow.com/comment/45026788
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28332143
has text: You can use [tickPositions](http://api.highcharts.com/highcharts#xAxis.tickPositions) / [tickPositioner](http://api.highcharts.com/highcharts#xAxis.tickPositioner)

http://stackoverflow.com/a/28341119
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28340344
has comment: http://stackoverflow.com/comment/45027965
has comment: http://stackoverflow.com/comment/45028578
has body: Try either a CSS rule or with jQuery: CSS #map-canvas img { max-width: 100%; } jQuery google.maps.event.addListenerOnce(map, 'idle', function () { $('#map-canvas img').css('max-width', '100%'); }); I am not sure whether you should set the max-width to none or 100%. Try both. And maybe try to write your CSS rule with !important if it doesn't work right away. For the jQuery version, I added the css() function within the map idle event listener (therefore you are sure the map is loaded and ready). Edit I can't test your code but you can try this way: jQuery(document).ready(function () { mymap = MapView.initialize(); google.maps.event.addListenerOnce(mymap, 'idle', function () { $('#map-canvas img').css('max-width', '100%'); }); MapView.registerOnChangeEventOfSourceModule(); MapView.registerOnChangeEventOfCustomView(); });
has comment: http://stackoverflow.com/comment/45031464
type: Answer
has comment: http://stackoverflow.com/comment/45028504
has comment: http://stackoverflow.com/comment/45031143
has comment: http://stackoverflow.com/comment/45032585
has comment: http://stackoverflow.com/comment/45029121
has comment: http://stackoverflow.com/comment/45029633
answers question: http://stackoverflow.com/q/28340344
has comment: http://stackoverflow.com/comment/45027847
has comment: http://stackoverflow.com/comment/45031533
has comment: http://stackoverflow.com/comment/45027414
score: 0
has comment: http://stackoverflow.com/comment/45029573

http://stackoverflow.com/q/28338282
has comment: http://stackoverflow.com/comment/45022075
tagged with: angularjs
tagged with: time
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45022213
has comment: http://stackoverflow.com/comment/45022330
has title: Error when subtract date (Can't interpolate)
has comment: http://stackoverflow.com/comment/45022350
type: Question
has answer: http://stackoverflow.com/a/28338771
has comment: http://stackoverflow.com/comment/45023837
tagged with: javascript
tagged with: date
has comment: http://stackoverflow.com/comment/45022769
has body: Hi i made a simple function to subtract dates, but i keeps giving me an error. Code JS: $scope.tosum = function(d1, d2) { var d3 = new Date(d1.getTime() - d2.getTime()); console.log(d3); return d3; }; Console Error: Error: [$interpolate:interr] Can't interpolate: {{tosum(timesheet.startDate,timesheet.endDate )}} TypeError: undefined is not a function View/ html site : &lt;tr data-ng-repeat="timesheet in timesheetsCtrl.timesheets | filter:searchText"&gt; &lt;td&gt;{{tosum(timesheet.startDate,timesheet.endDate )}}&lt;/td&gt; I also have tried without .getTime this gives 'Invalid Date' in console
score: 0
has comment: http://stackoverflow.com/comment/45026192
linked to: http://stackoverflow.com/q/15298663
tagged with: calculated-field
answer count: 1
has comment: http://stackoverflow.com/comment/45024535

http://stackoverflow.com/q/28357606
has comment: http://stackoverflow.com/comment/45058817
has body: Still learning so hopefully i can explain the best i can without confusing everyone! Seems fairly basic, The form i have puts together a package for the user, basically how shopping cart software would work.. The user can select what they need and go to checkout, Well during this process on the (3 out of 5) page, There is a section for the user to ADD Extras to their package. The original designer that helped is no longer able to do so. The code he used is as follows: This is an item selected as an extra (So should add £6.80 to total price instantly when clicked the {ADD} Button or in this exact instance deduct the amount from total price when clicked {Remove} ) Golf Cover Protect against loss or damage up to £1,000 £6.80 This example is one of the extra add ons aviable to the user that has not been selected, If the user was to select this item by clicking {ADD} This would add the price shown in the h4 tags (2.28) to the total price in real time, Same if this was then selected as {Remove} the price would then be deducted. Adventure Pack Select the Adventure Pack £2.28 The problem is.. He no longer can support me so i need to change the code to a basic javascript code, I have seen several out their but all these are done by the user inputting values, As you can see my values are already set so i am just not experienced enough the write a script that will add the value to the total price. could this be done with getelementbyid? Thanks, And very grateful for any input / advice.
has comment: http://stackoverflow.com/comment/45059048
has comment: http://stackoverflow.com/comment/45058988
answer count: 0
has comment: http://stackoverflow.com/comment/45058993
has comment: http://stackoverflow.com/comment/45059026
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45058977
has comment: http://stackoverflow.com/comment/45059112
tagged with: forms
type: Question
has comment: http://stackoverflow.com/comment/45058938
has title: Javascript to do realtime calculations of add ons to custom packages during form stage
tagged with: javascript
has comment: http://stackoverflow.com/comment/45059106
score: 0
has comment: http://stackoverflow.com/comment/45058595
has comment: http://stackoverflow.com/comment/45058832
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28388359
has title: run external javascript within php file
score: 0
has comment: http://stackoverflow.com/comment/45114261
accepted answer: http://stackoverflow.com/a/28388387
has comment: http://stackoverflow.com/comment/45114283
has body: I'm trying to run a function within a external JavaScript code but it doesn't seem to work/launch, I know for sure that exists is greater than 0 but i'm not sure if my implementation of javascript is even correct. Here's part of the code that's relevant $exists = mysqli_num_rows(mysqli_query($con,"SELECT * FROM gu_customer WHERE email='$email'")); echo $exists; if ($exists &gt; 0) { echo "&lt;script type='text/javascript' src='validation.js'&gt;\n"; echo "emailTaken();"; echo "&lt;/script&gt;"; }
tagged with: php
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28388387
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45114329

http://stackoverflow.com/q/28393102
favorite count: 0
has answer: http://stackoverflow.com/a/28393708
has comment: http://stackoverflow.com/comment/45122969
has answer: http://stackoverflow.com/a/28449699
tagged with: http://stackoverflow.com/tag/html
has body: Based on post here on StackOverflow, I am trying to make a drop down menu, which contents depends on the selection of another drop down menu. Fortunately the solution I found, is very applicable to my problem, although I originally do get my drop down menu options from a database. Less fortunately however, is that I cannot seem to get the solution to work. Both menus are correctly read from the database, and converted to the correct HTML-code. So what seems to fail is the JavaScript which is used to filter the options in the second drop down menu. My code is as following: <?php // Top level part selection echo " "; foreach ($category_primary as $category_item): echo " ".$category_item['cat_primary_name']." "; endforeach; echo " "; // Second level part selection (This should be updated, based on selection in top level menu) echo " "; foreach ($category_secondary as $cat_sec_item): echo " ".$cat_sec_item['cat_secondary_name']." "; endforeach; echo " "; ?> I really hope you can help me locating the flaw in my code, I really annoys the heck out of me... Update - Per request, here is the resulting HTML-code, I can't really give you the page url, as it lies behind password protection: Terræn Fundamentsystem Vægsystem Dæksystem Tagsystem Jordprofil Befæstet Areal Beplantning Fundamentkonstruktion Bærelag Åbning Lukning Inddækning Afslutning Afskærmning Fuge Samling Overflade
score: 2
possible better answer: http://stackoverflow.com/a/28393644
upvote count: 2
type: Question
type: AnsweredQuestion
has title: Using JavaScript to filter a drop down menu
linked to: http://stackoverflow.com/q/10570904
accepted answer: http://stackoverflow.com/a/28393708
has answer: http://stackoverflow.com/a/28393644
answer count: 3
downvote count: 0
tagged with: javascript
tagged with: drop-down-menu
tagged with: jquery
has comment: http://stackoverflow.com/comment/45123637

http://stackoverflow.com/q/28342809
has body: I am currently working on this site - http://andersontreesurgery.co.uk/. I used html5 up template and the template already had a sticky header. However when the site is scaled down a gap is created between the header and the banner which looks bad. Also I just dont want the header to move down and always stay at the top on top of everything. The mobile menu I still like as it slides out, however how do I stop the sticky header without remove any other function? Thanks, Gemma
tagged with: sticky
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/45030107
has title: how to remove sticky header and keep it static
has comment: http://stackoverflow.com/comment/45030375
upvote count: 2
type: UnansweredQuestion
score: 1
tagged with: scroll
downvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28346720
has comment: http://stackoverflow.com/comment/45030197
answer count: 1
favorite count: 0

http://stackoverflow.com/a/28288021
has body: function getBarValue(str) { var splitString = str.split('bar:'); // make this `:bar:` if foobar: is an issue if (splitString.length &lt; 2) { return null; // "bar:" does not exist in string } return splitString[1].substring(0, splitString[1].indexOf(':')); } var barVal = getBarValue('foo:bar:1234:something:4321'); console.log(barVal);
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28287532
downvote count: 1
answers question: http://stackoverflow.com/q/28287532
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/28426466
upvote count: 1
has body: I'm missing something about callbacks with Mongoose save function. I am trying to insert a new transaction, then if that is successful, update a user account. The problem, I believe, This cause all people to be updated with the last person's amount. What am I trying to do is update a document after saving another document. Here is the code. Please let me know what I am doing wrong. Thanks in advance. //find all schedules SchedModel.find({ Day_Of_Week: day }, null, null, function (err, Sched) { if (!err) { //iterate through what we find for (var key in Sched) { if (Sched.hasOwnProperty(key)) { var val = Sched[key]; console.log("val : " + val); var Sched_Descr = day || ' Sched Trans'; var this_trans = new TransModel({ mID: val.K_Id, mDate: today, mDescr: Sched_Descr, mAmt: val.mAmt }); //insert the new trans this_trans.save(function (err, trans) { if (!err) { //when we insert new trans, get the update model MyModel.findById(val.K_Id, function (err, Model) { Model.Balance = Model.Balance + val.mAmt; //save model, this update to the last in the list Model.save(function (err) { if (!err) { console.log("updated"); } else { console.log(err); } }); }); } else { return console.log(err); } }); } } } else { console.log(err); }; });
type: Question
tagged with: mongoose
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28427910
has comment: http://stackoverflow.com/comment/45185031
answer count: 1
downvote count: 0
has title: Mongoose update after save
has answer: http://stackoverflow.com/a/28427910
favorite count: 0
tagged with: node.js
type: AnsweredQuestion
score: 1

http://stackoverflow.com/q/28388817
favorite count: 0
tagged with: meanjs
has comment: http://stackoverflow.com/comment/45115443
has comment: http://stackoverflow.com/comment/45115585
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45115283
has title: MEAN stack how to send a user a file
upvote count: 1
has comment: http://stackoverflow.com/comment/45115192
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28470069
score: 1
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45115624
accepted answer: http://stackoverflow.com/a/28470069
has comment: http://stackoverflow.com/comment/45115244
answer count: 1
downvote count: 0
has body: I have some code on the express controller that looks like this: // Correct file path and write data var currentDate = new Date(); var storagePath = path.join(__dirname,'../../public/reports/', 'Risk-Log.csv'); var source = es.readArray(riskLogs); source.pipe(jsonCSV.csv(options)).pipe(fs.createWriteStream(storagePath)); console.log('Completed csv export to ' + storagePath); // Send file back res.sendFile(storagePath); In my angular view (log.client.view.html) I have the following: Download CSV When I click that button... The file gets generated properly, but the file never gets sent back to the user (that they can tell). If I look at the console debugger I get the following: Resource {$promise: Object, $resolved: false, $get: function, $save: function, $query: function…} I haven't done any routing with Angular or anything special since it's hitting the Node (express) controller and generating the file. I'm wondering if this is something that I should be doing in Angular? What I'm trying to achieve is that when the user clicks that button the CSV downloads. Any help would be MUCH appreciated.

http://stackoverflow.com/q/28347014
has comment: http://stackoverflow.com/comment/45038386
has answer: http://stackoverflow.com/a/28347048
upvote count: 11
favorite count: 0
possible better answer: http://stackoverflow.com/a/28347048
downvote count: 2
has comment: http://stackoverflow.com/comment/45038398
tagged with: regex
has answer: http://stackoverflow.com/a/44934971
has comment: http://stackoverflow.com/comment/45038411
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28347239
has title: Remove unwanted part of String. Regex / JS
has comment: http://stackoverflow.com/comment/45038179
score: 9
type: Question
has comment: http://stackoverflow.com/comment/45038801
has comment: http://stackoverflow.com/comment/45038660
has body: If I have a string which looks like this: var myString = '73gf9y::-8auhTHIS_IS_WHAT_I_WANT' What regex would I need to end up with: 'THIS_IS_WHAT_I_WANT' The first part of my String will always be a random assortment of characters. Is there some regex which will remove everything up to THIS?
tagged with: javascript
has comment: http://stackoverflow.com/comment/45038368
answer count: 3
has comment: http://stackoverflow.com/comment/45038479
has answer: http://stackoverflow.com/a/28347239

http://stackoverflow.com/comment/44953354
type: Comment
has text: Ok, I kinda understand now. But, why the rest of the code will fail if I don't put a condition in the if statment? The last function is not part of the other function to proces myform. Tha's why I don't understant why all the code depends if the if statment has a condition.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28300928

http://stackoverflow.com/comment/45165503
score: 0
comment on: http://stackoverflow.com/q/28416073
type: QuestionComment
has text: How does the browser download the PDF?
type: Comment

http://stackoverflow.com/comment/45137659
has text: Makes perfect sense. That's why I could load the tag info by hard coding and when ever I tried to load it dynamically it wouldn't work. Thanks Nick.
type: AnswerComment
comment on: http://stackoverflow.com/a/28401055
score: 0
type: Comment

http://stackoverflow.com/q/28285565
answer count: 1
has comment: http://stackoverflow.com/comment/44928116
has comment: http://stackoverflow.com/comment/44925399
tagged with: regex
type: AnsweredQuestion
has body: I'm doing regular expression in office app for outlook. And the mail body will be something like: Hello, I have the following path need to be translated. Can you help me with that? \\test1 \\test2 \\test3 \\test4 Thanks. And in the code I use getRegExMatches() to get the matched pattern. regular expression: &lt;Rule xsi:type="ItemHasRegularExpressionMatch" PropertyName="BodyAsHTML" RegExName="test" RegExValue='file://[^"]*'/&gt; code: matches=Office.context.mailbox.item.getRegExMatches().test; And the matches is an array with the matched patterns: [file://\\test1,file:///\\test2,file://\\test3,file:///\\test4]; But I want to return the result like: [\\test1,\\test2,\\test3,\\test4] Can regular expression do anything to split the result? Or is there any easy implementation to get the results to get rid of the file://or file:///. Although it's possible to iterate through the array to get the result, I'm wondering whether there's a better solution.
type: Question
has comment: http://stackoverflow.com/comment/44925373
accepted answer: http://stackoverflow.com/a/28287539
tagged with: javascript
has title: javascript regular expression return splited results
has comment: http://stackoverflow.com/comment/44926562
score: 0
has answer: http://stackoverflow.com/a/28287539

http://stackoverflow.com/a/28364031
type: Answer
has body: ]*id)[^>]*>[ ]*|<\/span> Try this.See demo. https://regex101.com/r/vD5iH9/82 var re = /]*id)[^>]*>[ ]*|<\/span>/gim; var str = 'Text abc text def \'; \nText abc text def \nText abc'; var subst = ''; var result = str.replace(re, subst);
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28362982
accepted answer of: http://stackoverflow.com/q/28362982

http://stackoverflow.com/q/28363540
type: Question
has answer: http://stackoverflow.com/a/28364095
tagged with: meta-boxes
tagged with: javascript
has title: "if meta box empty" hide it from front end - WordPress
score: 0
answer count: 1
type: UnansweredQuestion
has body: I'm displaying values for mail and phone in front end. How to either hide this or set to javascript:void(0) This is my current code: section id="page-content" class="col-md-8"> About <?php the_title(); ?> <a href="mailto:<?php echo(types_render_field("person-email", array('raw' => true) )) ; ?>" target="_blank" class="hvr-hang"> <a href="tel:<?php echo(types_render_field("person-phone", array('raw' => true) )) ; ?>" target="_blank" class="hvr-hang"> <?php the_content(); ?>
tagged with: wordpress

http://stackoverflow.com/comment/45023405
has text: I have created a fiddle and it works fine http://jsfiddle.net/9ydn3z3m/ .please update fiddle with your html code generated at client side browser
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28338160

http://stackoverflow.com/q/28415705
has answer: http://stackoverflow.com/a/28416076
has body: This IS a duplicate from Calling a php function by onclick event, but I have a question on it. The answer I had a question on is by timpanix, and basically it won't work. He said to execute some PHP code in a On Click event do this: onclick="document.write('&lt;?php //call a PHP function here ?&gt;');" and call the PHP function. Yet whenever I try it: &lt;button id="profileinformationbutton" input type="submit" value="Login" onclick="document.write('&lt;?php profileupdated() ?&gt;');"&gt; Update Profile &lt;/button&gt; it prints out ');" &gt; Update Profile, yet I have no clue why. It is inside of a form, and the PHP function looks like this: &lt;?php function profileupdated() { ?&gt; &lt;div id="profileupdated"&gt; Profile Updated &lt;/div&gt; &lt;?php } ?&gt; Why would the code be displaying this? Please help! :) Thank You. EDIT The code does not seem to be writing Profile Updated to the page, any idea why?
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45164726
tagged with: php
possible better answer: http://stackoverflow.com/a/28416076
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/13840429
has answer: http://stackoverflow.com/a/28415738
type: Question
linked to: http://stackoverflow.com/q/7451070
tagged with: javascript
has title: PHP Script in OnClick Event
has answer: http://stackoverflow.com/a/28415732
score: 0
has comment: http://stackoverflow.com/comment/45164781
answer count: 3
has comment: http://stackoverflow.com/comment/45164787
accepted answer: http://stackoverflow.com/a/28415732

http://stackoverflow.com/q/28302457
tagged with: phantomjs
score: 0
linked to: http://stackoverflow.com/q/21947982
answer count: 1
tagged with: javascript
tagged with: karma-jasmine
has title: document.readyState is always 'loading' when using karma and jasmine & PhantomJS
type: UnansweredQuestion
type: Question
has body: I have a bunch of commonjs javascript modules. One of them interacts with the document javascript global. To keep everything modular and testable, I've created a couple of modules that contain the document and window objects. // document.js module.exports = document; // window.js module.exports = window; My module placeholderReplacer.js then includes this as a dependency // palceholderReplacer.js var document = require('./document'); var window = require('./window'); // replacePlaceholders() &amp; a bunch of private methods live here... var placeholderReplacer = { replace: function() { var prerequisitesAvailable = function() { return document.addEventListener &amp;&amp; document.getElementsByClassName &amp;&amp; XMLHttpRequest; }; if (prerequisitesAvailable()) { if (document.readyState == "complete") { replacePlaceholders(); } else { window.addEventListener('load', function() { replacePlaceholders(); }, false); } } } }; module.exports = placeholderReplacer; The problem I have is that when I run my unit tests on Karma with PhantomJS and Jasmine, the document.readyState is always loading and replacePlaceholders() is never called. The event listener is not being called either as I'm suspecting it's too late. For simplicity, I've removed all the tests from placeholderReplacerTest.js, and I just have: var $ = require('../vendor/jquery'), placeholderReplacer = require('../modules/placeholderReplacer'); placeholderReplacer.replace(); I'm pretty new at javascript unit testing and CommonJS modules so any help is much appreciated!
has answer: http://stackoverflow.com/a/32648162

http://stackoverflow.com/q/28400207
has comment: http://stackoverflow.com/comment/45136183
favorite count: 0
accepted answer: http://stackoverflow.com/a/28409817
answer count: 3
has title: Most efficient way to delete from array?
upvote count: 4
linked to: http://stackoverflow.com/q/9287441
has answer: http://stackoverflow.com/a/28409817
has answer: http://stackoverflow.com/a/28400264
has body: I have an array containing particles (fire, blood, smoke, etc.) in an HTML5 game. All particles have an expiry/lifespan. I'm creating up to 100 particles per frame at 60fps so I want to keep this array as clean as possible so I can loop through it efficiently. I have heard it's better to use 'splice' rather than 'delete' to remove elements from an array. This makes sense to me as I'd rather not loop through keys of the array that are blank (that 'delete' leaves behind). However, I tested this out and have a higher, more consistent frame rate if I 'delete' keys rather than splicing them to remove expired particles. The downside is the longer the game runs the longer my particles array gets. Is there a better solution to this?
has comment: http://stackoverflow.com/comment/45136141
has comment: http://stackoverflow.com/comment/45136110
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45136166
possible better answer: http://stackoverflow.com/a/28400264
tagged with: arrays
downvote count: 0
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/28400390

http://stackoverflow.com/comment/109466660
comment on: http://stackoverflow.com/a/28350341
has text: @Snr all major interpreters provide efficient accessors for the length of arrays: https://stackoverflow.com/questions/9592241/javascript-is-the-length-method-efficient
type: AnswerComment
score: 1
type: Comment

http://stackoverflow.com/comment/45227949
type: Comment
has text: @SergiuParaschiv yeah i am reading the documentation and trying to understand it. However the custom directive Scope is little confusing.
type: QuestionComment
comment on: http://stackoverflow.com/q/28406239
score: 0

http://stackoverflow.com/a/57155863
score: -1
has body: you can try this project: https://github.com/boylegu/vue-lazyload-text The high performance magic text with lazyload support.
downvote count: 1
answers question: http://stackoverflow.com/q/28401444
type: Answer
upvote count: 0

http://stackoverflow.com/a/28339342
answers question: http://stackoverflow.com/q/28339286
has body: I won't write your homework for you, but this is generally what you want to do: Get user's birthday Create a new Date object with the date set to that birthday Use the getDay method of the date object Convert the number representing the day of the week to the actual string for that day.
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/45024710
downvote count: 0
type: Answer

http://stackoverflow.com/comment/60797589
score: 1
has text: Possible duplicate of [IE 11 Developer Tools Issue - Exception in window.onload](http://stackoverflow.com/questions/27435753/ie-11-developer-tools-issue-exception-in-window-onload)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28301393

http://stackoverflow.com/q/28388029
has answer: http://stackoverflow.com/a/28388518
type: Question
has body: I'm trying to use D3.js to draw rectangles around a circle (think of drawing chairs around a table). I've tried drawing each chair individually by setting it's x and y position and then rotating it, but I haven't had much luck. I thought this might be a good approach: group = container.append("g") table = group.append("circle"). attr("cx", 100). attr("cy", 100). attr("r", 60). attr("fill", "#FFF"). attr("stroke", "#b8b8b8"). attr("stroke-width", "2") group .append("rect") .attr("x", 90) .attr("y", 10) .attr("width", 20) .attr("height", 20) group.attr("transform", "rotate(30, 100, 100)") But I can't figure out how to make a transformation, redraw, and then make another transformation. Any ideas?
tagged with: javascript
has title: D3.js Drawing rectangles around a circle
score: 0
answer count: 1
tagged with: d3.js
type: UnansweredQuestion

http://stackoverflow.com/a/28282369
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28282242
downvote count: 0
has body: @helper MyMethod() { for (int i = 0; i < 5; i++) { } }

http://stackoverflow.com/q/28293159
type: Question
has body: I am trying to access a togetherJS (https://togetherjs.com/docs/contributing.html) module from an external requireJS app. It seems impossible. TogetherJSConfig_noAutoStart = true; var CJS = CJS || {}; CJS.require = require.config({ paths: { togetherjs: 'https://togetherjs.com/togetherjs-min', cjs: 'scripts/c' } }); CJS.require(['togetherjs'], function() { // not working peers = require({context: "togetherjs"})("peers"); // not working // Module name "peers" has not been loaded yet for context: togetherjs. Use require([]) TogetherJS.require = require.config(TogetherJS.requireConfig); TogetherJS.require("peers"); }); If I do not use requireJS in my app, I can access the module I want: // works if I do not use requireJS in my app. var peers = TogetherJS.require('peers').getAllPeers(); Is it possible, and if so, how? I could not find any information anywhere. Thanks
tagged with: javascript
has title: access module of other context in requirejs
has answer: http://stackoverflow.com/a/30726050
score: 0
tagged with: togetherjs
answer count: 1
tagged with: module
type: UnansweredQuestion
tagged with: requirejs

http://stackoverflow.com/comment/45042559
has text: Why mix jQuery if the CKEditor API should be enough to do the task? One of the most common problems that I see is that people try to use jQuery for everything when there's a simple approach available using the correct API.
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28330243

http://stackoverflow.com/q/28358167
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/45059593
has answer: http://stackoverflow.com/a/28358282
answer count: 1
downvote count: 1
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45059569
has title: Parse valid JSON got "SyntaxError: Unexpected token ILLEGAL"
upvote count: 0
tagged with: http://stackoverflow.com/tag/json
type: Question
has body: The JSON is validated. But when I parse it with JSON.parse(), $.parseJSON() or eval(). I got "SyntaxError: Unexpected token ILLEGAL" Here the JSON: https://pastebin.com/cXMTw9Xu I can parse it with php using json_decode() so I tried json_encode() then copy the result to parse in javascript. However I still got this error. To reproduce, try to execute this script in your console on any browser. JSON.parse('{"id":"mindmaps","options":{"id":"mindmaps","instance":"","name":"","description":"","containerStyle":{"width":"auto","height":"auto"},"viewPort":{"width":50000,"height":50000,"allowDrag":true,"left":3819,"top":4422,"originalWidth":50000,"zoom":{"w":50000,"h":50000,"l":3895,"t":4457,"r":1},"originalHeight":50000},"enabled":true,"showBirdsEye":false,"sizeOfBirdsEye":200,"showMultiSelect":false,"showZoom":false,"showStatus":false,"collaboration":{"allow":false,"showPanel":true,"useLongPolling":false,"jsonp":false,"localizedOnly":false,"userName":"","userProfile":"","userIP":"","sizeOfBirdsEye":200,"hubName":"slateHub","url":"","callbacks":{"onCollaboration":null,"onCollaborationStarted":null,"onCollaborationWired":null,"onUnauthorized":null}},"isPublic":false,"imageFolder":"http:\/\/static.slatebox.com\/cursors\/"},"nodes":[{"options":{"id":"first_node","name":"first_node","text":"\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\u0e01\u0e32\u0e23\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23\/\u0e41\u0e19\u0e27\u0e17\u0e32\u0e07","isPinned":false,"isPinnedExact":false,"pinnedRowCount":5,"image":"","imageTiled":false,"xPos":3635.515625,"yPos":4810,"height":74,"width":183.96875,"borderWidth":2,"lineColor":"red","lineWidth":2,"lineOpacity":1,"allowDrag":true,"allowMenu":true,"allowContext":true,"backgroundColor":"90-#ADD8C7-#59a989","foregroundColor":"#000","fontSize":13,"fontFamily":"Trebuchet MS","fontStyle":"normal","vectorPath":"rectangle","rotationAngle":0,"link":{"show":false,"type":"","data":"","thumbnail":{"width":175,"height":175}}},"relationships":{"parents"…

http://stackoverflow.com/comment/45110077
type: QuestionComment
comment on: http://stackoverflow.com/q/28386073
score: 0
type: Comment
has text: when you put in external file, is the external file in correct location and is it loading in your firebug view or something? the example runs fine in jsfiddle. So i guess it must be problem with the location of the file.

http://stackoverflow.com/q/28375557
has comment: http://stackoverflow.com/comment/45091651
has comment: http://stackoverflow.com/comment/45091474
has body: I have a folder structure that looks something similar to the following build/ dist/ app/ js/ third-party/ jquery.min.js js-file1.js js-file2.js view/ js/ js-file.js js-file4.js What I'd like to do is to use uglify to minify all JS files individually (while ignoring third-party javascript files) without bundling it all into a single file using grunt-contrib-uglify and overwrite the respective file. So essentially, if the originally file is build/dist/app/js/js-file1.js, after I ran the grunt task, it'd still be in build/dist/app/js/js-file1.js but minified. The task looks like the following: uglify: { options: { mangle: false, preserveComments: false }, files: [{ expand: true, // Enable dynamic expansion. cwd: 'build/dist/', // Src matches are relative to this path. src: ['**/*.js', '!**/thirdparty/*'], // Actual pattern(s) to match. dest: 'build/dist/', // Destination path prefix. ext: '.js', // Dest filepaths will have this extension. extDot: 'first' // Extensions in filenames begin after the first dot }] } When I run the task, I get the following error and I am not sure what I've done wrong. (node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral. (node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral. (node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral. (node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral. (node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral. util.js:35 var str = String(f).replace(formatRegExp, function(x) { ^ RangeError: Maximum call stack size exceeded Thoughts?
type: Question
linked to: http://stackoverflow.com/q/22285942
score: 0
has title: grunt-contrib-uglify throwing RangeError
has comment: http://stackoverflow.com/comment/45091813
tagged with: grunt-contrib-uglify
answer count: 0
tagged with: javascript
type: UnansweredQuestion
tagged with: gruntjs
has comment: http://stackoverflow.com/comment/45168201

http://stackoverflow.com/a/28299343
type: Answer
upvote count: 3
score: 3
type: AcceptedAnswer
downvote count: 0
has body: I had a similar issue. I don't know which version of fullcalendar you are using, but the latest version at this time (2.2.6) in combination with moment.js and the usage of timezone works completely fine for me: var events_array = [ { title: 'Test1', start: moment('2015-02-03T05:00:00'), end : moment('2015-02-03T12'), tip: 'Test1'}, ]; ... $('#calendar').fullCalendar({ events: events_array, timezone : 'local', eventRender: function(event, element) { element.attr('title', event.tip); } }); See example here.
accepted answer of: http://stackoverflow.com/q/28295474
answers question: http://stackoverflow.com/q/28295474

http://stackoverflow.com/a/28310655
has comment: http://stackoverflow.com/comment/44973967
has comment: http://stackoverflow.com/comment/44972873
accepted answer of: http://stackoverflow.com/q/28310228
upvote count: 2
answers question: http://stackoverflow.com/q/28310228
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44974010
type: Answer
has comment: http://stackoverflow.com/comment/44972271
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/44972399
has body: It would be a lot cleaner to simply do this with Angular: Selected: {{selected}} Controller var myApp = angular.module('TestApp',[]); myApp.controller('TestController', ['$scope', function($scope) { $scope.options = ['x6', 'P4']; $scope.selected = 'P4'; }]); Fiddle: here EDIT From your comment, it sounds like you want to switch the whole URL to something else depending on the selection. You could save that data as a property in an array of objects, like this: myApp.controller('TestController', ['$scope', function($scope) { $scope.options = [ { title: 'x6', urlPrefix: 'http://test1.com/' }, { title: 'P4', urlPrefix: 'http://test2.com/' }]; $scope.selected = $scope.options[1]; }]); You'll need to change the HTML a little: Selected: {{selected.title}} Updated fiddle: here
has comment: http://stackoverflow.com/comment/44973713
has comment: http://stackoverflow.com/comment/44973929

http://stackoverflow.com/q/28403518
has comment: http://stackoverflow.com/comment/45141970
tagged with: css
tagged with: ms-word
type: AnsweredQuestion
score: 2
has title: Word smartart realization with HTML/CSS/JavaScript (geometric shapes)
upvote count: 2
type: Question
has comment: http://stackoverflow.com/comment/45155460
tagged with: javascript
has answer: http://stackoverflow.com/a/28502941
accepted answer: http://stackoverflow.com/a/28502941
has comment: http://stackoverflow.com/comment/45141996
answer count: 1
downvote count: 0
favorite count: 0
has body: I'm sure there are a lot of you knowing the following element created as "smart art" with Microsoft Word: Is there any framework for web realization of this graphic (pure HTML, CSS, JavaScript)? Or can you imagine how this could be realized as a "clean" web element?
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/44924667
has text: I think I've got it; 'out hit' instead of 'hit' at the end? would that work?
comment on: http://stackoverflow.com/q/28284702
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28336570
accepted answer: http://stackoverflow.com/a/28336688
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/13333683
score: 1
has title: jQuery destroying `detail` of custom Polymer events in Meteor
upvote count: 1
has answer: http://stackoverflow.com/a/28336688
type: Question
tagged with: polymer
tagged with: javascript
has body: I am defining a Polymer component in Meteor that does a custom fire: ... content ... Good! Easy! This seems to work great and I can catch the event in Meteor: {{question}} {{answer}} Template.reviewItem.events 'rated': (evt, tmpl) -> console.log 'item rated' console.log evt.detail # undefined console.log evt.originalEvent.detail # {rating: "easy"} But as you can see the event detail is lost (in the "outer" event). The outer event is a jQuery.event and the originalEvent is the CustomEvent that is fired by Polymer. The jQuery docs state that: "The following properties are also copied to the event object, though some of their values may be undefined depending on the event: ... detail, ..." But the docs don't say how custom event types are handled. Is this normal jQuery behaviour? Is Meteor wrapping the events in jQuery.event for my convenience?
downvote count: 0
answer count: 1
tagged with: jquery
tagged with: meteor
tagged with: dom-events
favorite count: 0

http://stackoverflow.com/comment/45066790
type: AnswerComment
score: 0
type: Comment
has text: ....but probably shouldn't ;-) I meant my comment as a reply to Memphistoles' comment and to the downvote.
comment on: http://stackoverflow.com/a/28362008

http://stackoverflow.com/q/28436271
accepted answer: http://stackoverflow.com/a/28436781
downvote count: 1
has body: I have a JavaScript object that I'm trying to compare to an array of objects: var builtVehicle = {pattern: "../images/fire1192015.png", vehicle: "../images/van1192015.png", wheel: "../images/wheels3.png"}; var createdVehicles = [ {pattern:"../images/checkerboard1192015.png", vehicle:"../images/car1192015.png", wheel:"../images/wheels1.png"}, {pattern:"../images/fire1192015.png", vehicle:"../images/truck1192015.png", wheel:"../images/wheels4.png"},] I am attempting to loop through both the JavaScript object and the createdVehicles array of objects looking for an exact match. If there is not an exact match, I want to add the builtVehicle object to the createdVehicles array. My thought is to compare each key/value pair of the objects in the array with the builtVehicle object, but I was having some problems pulling out the key/value pairs within the array. My loops look like this: for(var key in builtVehicle) { console.log('builtVehicle key: ' + key + '\n' + 'builtVehicle value: ' + builtVehicle[key]); } for(var b=0; b &lt; createdVehicles.length; b++){ alert(createdVehicles[b]); } Is this the best approach to take? I was also looking into 2D arrays to accomplish this, but any suggestions are appreciated. Thanks!
type: Question
tagged with: object
has comment: http://stackoverflow.com/comment/45203080
tagged with: for-loop
tagged with: arrays
has comment: http://stackoverflow.com/comment/45202654
tagged with: javascript
score: -1
possible better answer: http://stackoverflow.com/a/28436601
answer count: 2
has answer: http://stackoverflow.com/a/28436601
has comment: http://stackoverflow.com/comment/45202866
upvote count: 0
has comment: http://stackoverflow.com/comment/45202769
favorite count: 0
has answer: http://stackoverflow.com/a/28436781
has title: Comparing an object to an array of objects
type: AnsweredQuestion

http://stackoverflow.com/q/28395022
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28395051
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/28395138
has answer: http://stackoverflow.com/a/28395138
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has title: Click of any button submits form.how to stop this?
type: AnsweredQuestion
has body: I am trying to create a form which will take the user input to create a query for database. I have three buttons: And, Or, Run. I am creating dynamic elements on click of buttons And and Or. The div search_list is the container for containing the elements. I need the form to be submitted on click of Run. The weird thing is, whenever I click on any button the form gets submitted. How do I stop it ? Please let me know If you need more info. Thanks &lt;html&gt; &lt;head&gt; &lt;script type="text/javascript"&gt; var count = 0; function loadfirst(){ count=1; addFilter(''); } function addFilter(flag){ var div = document.querySelector("#search_list"); tr = document.createElement("tr"); select = document.createElement("select"); var sear_value = document.createElement("input"); var and_or = document.createTextNode(flag); tr.id='tr_'+count; select.id='sl_'+count; sear_value.id='sear_value_'+count; select.options.add( new Option("user id","user_id", true,true) ); select.options.add( new Option("First name","first_name")); select.options.add( new Option("Last name","last_name")); select.options.add( new Option("Course","course")); sear_value.type="text"; if(count&lt;=1){ var bt_and= document.createElement("button"); bt_and.id='and'; var bt_label = document.createTextNode("And"); bt_and.appendChild(bt_label); bt_and.addEventListener('click', function() { addFilter('and'); return false; }); var bt_or= document.createElement("button"); bt_or.id='or'; var bt_label = document.createTextNode("Or"); bt_or.appendChild(bt_label); bt_or.addEventListener('click', function() { addFilter('or'); return false; }); } else{ var bt_rem= document.createElement("button"); bt_rem.id='rem_'+count; var bt_label1 = document.createTextNode("x"); bt_rem.appendChild(bt_label1); var tr_id = 'tr_'+count; bt_rem.addEventListener('click', function() { var element= document.getElementById(tr_id); element.parentNode.removeChild(element); return false; }); } tr.appendChild(and_or); tr.appendChild(select); tr.a…
tagged with: forms
type: Question
has answer: http://stackoverflow.com/a/28395051

phonegap-plugins
tags question: http://stackoverflow.com/q/28389912
tags question: http://stackoverflow.com/q/28425924
tags question: http://stackoverflow.com/q/28343124
tags question: http://stackoverflow.com/q/28355957
type: Tag
tags question: http://stackoverflow.com/q/28431935
tag name: phonegap-plugins
tags question: http://stackoverflow.com/q/28369123

http://stackoverflow.com/a/28359725
answers question: http://stackoverflow.com/q/28298163
has body: The reason for this was that React was making the inputs controlled components because the values for each input are set from the server side. Quoting from Brandon's answer: If you add a value={whatever} property to the input, which makes it a controlled component, then it is read-only uness you add an onChange handler that updates the value of whatever. From the React docs: Why Controlled Components? Using form components such as in React presents a challenge that is absent when writing traditional form HTML. For example, in HTML: This renders an input initialized with the value, Untitled. When the user updates the input, the node's value property will change. However, node.getAttribute('value') will still return the value used at initialization time, Untitled. Unlike HTML, React components must represent the state of the view at any point in time and not only at initialization time. For example, in React: render: function() { return ; } Since this method describes the view at any point in time, the value of the text input should always be Untitled. The simplest solution I found is to add onChange={function(){}} to the inputs.
score: 4
upvote count: 4
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/73185599
type: Answer
accepted answer of: http://stackoverflow.com/q/28298163

http://stackoverflow.com/a/28387519
upvote count: 5
downvote count: 0
has comment: http://stackoverflow.com/comment/45113042
has comment: http://stackoverflow.com/comment/45112652
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45113001
accepted answer of: http://stackoverflow.com/q/28387312
type: Answer
has body: You are missing to define $http as a parameter app.controller( "customersController", function( $scope, $window, $http) { Also make sure you are testing in a web server. You cann't make ajax request from file:// protocol Also change your request from POST to GET and it should work fine. Here is a Punklr method: 'GET',
answers question: http://stackoverflow.com/q/28387312
has comment: http://stackoverflow.com/comment/45112887
score: 5

http://stackoverflow.com/q/28394962
score: 0
answer count: 2
tagged with: jquery
has answer: http://stackoverflow.com/a/28394999
type: UnansweredQuestion
tagged with: css
has body: If I have 4 possible urls ending as shown: /users/username/bad /users/username/average /users/username/good /users/username/great Is there a way to add a class to an element depending on the ending of the URL when a page loads? So when /users/username/bad loads the element div#bad is given the css class .highlight. And when /users/username/good loads the element div#good is given the css class .highlight, so on and so forth for all 4 URLs. If this possible through query? Thank you
has answer: http://stackoverflow.com/a/28394989
type: Question
has comment: http://stackoverflow.com/comment/45126299
has title: Jquery: add a css class to specific html element by examining the URL
tagged with: javascript

http://stackoverflow.com/a/28400032
downvote count: 0
has comment: http://stackoverflow.com/comment/45136344
has comment: http://stackoverflow.com/comment/45136222
has body: Windows does not support signals. As such, your signal handlers are never triggered and instead your exit handler is called. Since in that handler you call terminator() without any arguments, the check for sig being a string fails, thus nothing is printed. Also note that calling process.exit() within the exit event is redundant - the process is about to exit and there is no stopping that. I understand that you wanted to use this logic for the signal handlers where the process is not required to exit in all cases, but since you cannot use signals on Windows...
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/28399838

http://stackoverflow.com/a/28350064
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28349593
has comment: http://stackoverflow.com/comment/45046728
upvote count: 1
type: Answer
has body: Facebook recently released Flow, a static type-checker for JavaScript. This seems like it might fit what you're looking for.

http://stackoverflow.com/a/28421569
answers question: http://stackoverflow.com/q/28419597
score: 0
type: Answer
has body: I managed to fix my problem by keeping the hidden element out of the html flow all together by setting its css position property to fixed. I simulate page scrolling by changing the elements style.left value with some custom touch event handlers. The page has no need to resize or zoom with the addition of the off screen element because fixed position elements do not effect layout. This doesn't answer my question about resetting the zoom level, however, and I would still appreciate any insight anyone may have.

http://stackoverflow.com/comment/45032276
comment on: http://stackoverflow.com/q/28343723
score: 0
has text: yes I use chrome, and I have also checked it in Firefox, and IE 11
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28281834
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44926531
answers question: http://stackoverflow.com/q/28281730
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/44918153
has body: Yes, there is a cleaner alternative! numArr.forEach(function (x) { arr.push(x); }); Note that apply stops working at several thousand elements. Underscore doesn’t have anything to do this, as far as I know (don’t use _.extend for it).
has comment: http://stackoverflow.com/comment/44918457
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28281730

http://stackoverflow.com/comment/46572811
type: QuestionComment
comment on: http://stackoverflow.com/q/28280355
has text: So, what's the problem? Why you're not able to access it in IE9? Did you do any troubleshooting? The fallback is correct, as we can see at the documentation.
score: 0
type: Comment

mongodb
tags question: http://stackoverflow.com/q/28283769
tags question: http://stackoverflow.com/q/28334601
tags question: http://stackoverflow.com/q/28417860
tags question: http://stackoverflow.com/q/28425681
tags question: http://stackoverflow.com/q/28344272
tags question: http://stackoverflow.com/q/28404430
tags question: http://stackoverflow.com/q/28300395
tags question: http://stackoverflow.com/q/28375386
tags question: http://stackoverflow.com/q/28409377
tags question: http://stackoverflow.com/q/28307493
tags question: http://stackoverflow.com/q/28296348
tags question: http://stackoverflow.com/q/28378112
tag name: mongodb
tags question: http://stackoverflow.com/q/28389906
tags question: http://stackoverflow.com/q/28345065
tags question: http://stackoverflow.com/q/28358735
tags question: http://stackoverflow.com/q/28390838
tags question: http://stackoverflow.com/q/28390714
tags question: http://stackoverflow.com/q/28357965
tags question: http://stackoverflow.com/q/28328768
tags question: http://stackoverflow.com/q/28297566
type: Tag
tags question: http://stackoverflow.com/q/28421505
tags question: http://stackoverflow.com/q/28405410
tags question: http://stackoverflow.com/q/28435203
tags question: http://stackoverflow.com/q/28310145
tags question: http://stackoverflow.com/q/28383589
tags question: http://stackoverflow.com/q/28311408
tags question: http://stackoverflow.com/q/28392995
tags question: http://stackoverflow.com/q/28348167
tags question: http://stackoverflow.com/q/28361427
tags question: http://stackoverflow.com/q/28390524
tags question: http://stackoverflow.com/q/28283963
tags question: http://stackoverflow.com/q/28372285
tags question: http://stackoverflow.com/q/28359243
tags question: http://stackoverflow.com/q/28378197
tags question: http://stackoverflow.com/q/28303188
tags question: http://stackoverflow.com/q/28305460
tags question: http://stackoverflow.com/q/28390357
tags question: http://stackoverflow.com/q/28310767
tags question: http://stackoverflow.com/q/28288040
tags question: http://stackoverflow.com/q/28292434
tags question: http://stackoverflow.com/q/28365433
tags question: http://stackoverflow.com/q/28294515
tags question: http://stackoverflow.com/q/28391482
tags question: http://stackoverflow.com/q/28346874
tags question: http://stackoverflow.com/q/28338891
tags question: http://stackoverflow.com/q/28423415
tags question: http://stackoverflow.com/q/28291516
tags question: http://stackoverflow.com/q/28283524
tags question: http://stackoverflow.com/q/28394625
tags question: http://stackoverflow.com/q/28376058
tags question: http://stackoverflow.com/q/28285343
tags question: http://stackoverflow.com/q/28336601
tags question: http://stackoverflow.com/q/28395681

http://stackoverflow.com/q/28434646
accepted answer: http://stackoverflow.com/a/28434965
has body: I have got a localStorage record with name homeCookie and it's content: Value1 | 1423415640 | Value3 | Value3 I need to delete it by jQuery if it's older then it's timestamp which is 1423415640 To get its values I am using the following code: var values = window.localStorage.getItem('homeCookie'); values = values.split('|'); window.opt1 = values[0]; window.opt2 = values[1]; window.opt3 = values[2]; window.opt4 = values[3]; Can anyone help me to achieve my task? Remove the whole homeCookie record if the timestamp older than now.
upvote count: 0
tagged with: javascript
tagged with: jquery
has title: Delete a localStorage record based on its timestamp
has answer: http://stackoverflow.com/a/28435095
favorite count: 0
has answer: http://stackoverflow.com/a/28434965
answer count: 3
possible better answer: http://stackoverflow.com/a/28434959
has comment: http://stackoverflow.com/comment/45199380
type: AnsweredQuestion
tagged with: local-storage
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45199511
has answer: http://stackoverflow.com/a/28434959
score: -1

http://stackoverflow.com/comment/45137820
has text: I forgot to mention I changed the date format in the json from 1/1/2015 style to 1.1.2015 style
score: 0
comment on: http://stackoverflow.com/q/28398997
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28431142
answers question: http://stackoverflow.com/q/28386386
type: AcceptedAnswer
downvote count: 0
has body: You can change the color of a bar element after you have created your chart. After new Chart() statement you can access and modify the chart element properties and update the chart like this : var wpChartChartTitleBar = new Chart(document.getElementById("myChart").getContext("2d")).Bar(ChartTitleData, ChartTitleOps); // Change 2nd bar to red (display). wpChartChartTitleBar.datasets[0].bars[1].fillColor = "rgba(229,12,12,0.7)"; wpChartChartTitleBar.datasets[0].bars[1].strokeColor = "rgba(229,12,12,1)"; // Change 2nd bar to red (highlight setting on mouse over) wpChartChartTitleBar.datasets[0].bars[1].highlightFill = "rgba(0,229,0,0.7)"; wpChartChartTitleBar.datasets[0].bars[1].highlightStroke = "rgba(0,229,0,1)"; wpChartChartTitleBar.update(); See a fiddle of it here.
type: Answer
upvote count: 6
has comment: http://stackoverflow.com/comment/45276607
accepted answer of: http://stackoverflow.com/q/28386386
score: 6

http://stackoverflow.com/q/28418048
score: -1
type: Question
has body: I want to redirect by geolocation and i try with this javascript function and it works fine: function showPosition(pos) { if (pos.coords.latitude &gt;= 10.4696404 &amp;&amp; pos.coords.longitude &lt;= -66.8037185) { window.location = 'http://www.website.com/page1.html'; } else{ window.location = 'http://www.website.com/page2.html'; } } but when i try to use a switch case do not work, what is wrong here? function showPosition(pos) { var lat = position.coords.latitude; var lon = position.coords.longitude; switch(lat + "|" + lon){ case lat &gt;="10.4696404"|lon &lt;="-66.8037185"://Caracas window.location = 'http://www.website.com/page1.html'; break; case lat &gt;="10.0618663"|lon &lt;="-69.3628479"://BARQUISIMETO window.location = 'http://www.website.com/page2.html'; break; case lat &gt;="10.6335502"|lon &lt;="-71.6769433": //MARACAIBO window.location = 'http://www.website.com/page3.html'; break; default window.location = 'http://www.website.com/'; } }
tagged with: google-maps
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45169950
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28418423
type: UnansweredQuestion
downvote count: 1
linked to: http://stackoverflow.com/q/5464362
has comment: http://stackoverflow.com/comment/45192430
tagged with: geolocation
has title: switch case redirect by geolocation latitude and longitude

http://stackoverflow.com/a/28782406
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28335147
score: 6
type: Answer
accepted answer of: http://stackoverflow.com/q/28335147
upvote count: 6
has body: OK, we've had this exact same problem and devised a pretty elegant solution to it, that doesn't require timeouts and is the fastest way to run your tests. Basically, we use one of two strategies, depending on what screen elements you're waiting for. All code goes into tests/mocha/client/lib.coffee, not 100% what the Jasmine equivalent is, but it should be available to all client test code. I've left it in Coffeescript, but you can compile it on coffeescript.org into Javascript, it should work fine as well. If whatever you do (routing or something else like changing a reactive variable) causes a Template to (re)render, you can use the Template.&lt;your_template&gt;.rendered hook to detect when it is finished rendering. So, we've added the following function in lib.coffee: @afterRendered = (template,f)-&gt; cb = template.rendered template.rendered = -&gt; cb?() template.rendered = cb f?() return return What does it do? It basically "remembers" the original rendered callback and temporarily replaces it with one that calls an extra function after the template is rendered and the original callback is called. It needs to do this sort of housekeeping to avoid breaking any code that may have depended on the rendered callback, as you're basically messing with the Meteor code directly. In your test, you can then do something like this: it.only "should check stuff after routing", (done)-&gt; try Router.go "&lt;somewhere&gt;" afterRendered Template.&lt;expected_template&gt;, -&gt; &lt;your tests here&gt; done() catch e done(e) I'd recommend the try-catch as well, as I've noticed asynchronous errors don't always make it into the velocity system, merely giving you a timeout failure. OK, then there are things that don't actually re-render, but are generated with JS or by some kind of "show/hide" mechanism. For that, you do need some kind of timeout, but you can reduce the "time cost" of the timeout by using a polling mechanism. # evaluates if a JQuery element is visible or not $.f…
has comment: http://stackoverflow.com/comment/55121407
has comment: http://stackoverflow.com/comment/45853393

http://stackoverflow.com/a/28300001
has body: The requests you make are async, and the response time will vary. What happens is that the done handler will be executed when in a random order and at that time is not possible to put the responses in the order you are looking for. For this I see 2 possible solutions: reorder the array after you get all responses make a queue of sync requests, one request after the other
type: Answer
has comment: http://stackoverflow.com/comment/44951995
answers question: http://stackoverflow.com/q/28299792
has comment: http://stackoverflow.com/comment/44951716
score: 0

http://stackoverflow.com/a/75882375
answers question: http://stackoverflow.com/q/28413880
downvote count: 0
type: Answer
upvote count: 1
has body: You can try this JSONCrush - Compress JSON into URL friendly strings .
score: 1

http://stackoverflow.com/a/28439433
has body: If you deal with custom elements like &lt;element&gt; they will likely be rendered as inline elements by default. For this not to happen, either set the CSS of the tag for display:block or make these element a div with replace:true in directive definition (if this doesn't affect other things). Other thing to do is to do as the commenter Tahsis said, restrict the directive as an element.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28437009

http://stackoverflow.com/comment/45162369
type: Comment
type: QuestionComment
has text: can you provide a fiddle?
score: 0
comment on: http://stackoverflow.com/q/28414530

http://stackoverflow.com/q/28413007
tagged with: javascript
tagged with: web-crawler
score: 0
answer count: 1
has body: While writting spider,I always have to find out which function send the Http requset on the javascript page after I click it. As there may be so many functions involved,I have to jump from one to another,guessing which is the key one. while we run an incorrect program written in Python,the IDE will show the as the following Traceback (most recent call last): File "/Users/milu/PycharmProjects/spider/html prase.py", line 42, in &lt;module&gt; driver.page_source = html AttributeError: can't set attribute Process finished with exit code 1 Anything similliar in Chrome Developer Tools to help me list all the functions called after I click on a page ?
accepted answer: http://stackoverflow.com/a/28421818
has title: Is it possible to list all the functions called after clicking the page with the use of Chrome Developer Tools
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28421818
tagged with: google-chrome
type: Question
tagged with: debugging

http://stackoverflow.com/comment/44938382
type: Comment
type: QuestionComment
has text: the code is as above,edited later.
score: 0
comment on: http://stackoverflow.com/q/28292153

http://stackoverflow.com/comment/45445002
comment on: http://stackoverflow.com/a/28424135
has text: This url: myproject.com/apartments?location=123&arrival=123 is it part of your angular application or some server-side application?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45045958
type: Comment
type: QuestionComment
has text: No, but you have to _read_ them back from storage, so that your arrays are filled with the previous values already before you push a new one into them – otherwise you just push one element into an empty array, and when you store that, all previous values are lost.
comment on: http://stackoverflow.com/q/28349596
score: 0

dialog
tag name: dialog
tags question: http://stackoverflow.com/q/28355726
tags question: http://stackoverflow.com/q/28343113
type: Tag

http://stackoverflow.com/comment/45071185
has text: log/alert it and you'll see
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28364920

http://stackoverflow.com/q/28410250
score: 0
answer count: 3
accepted answer: http://stackoverflow.com/a/28410513
has title: jQuery apend a div to an existing element including that element inside apended div
has answer: http://stackoverflow.com/a/28410525
has body: I have this scenario : User comments So how can I append a div that will include the existing textarea, but I don't want to remove the existing and add again because that si created dinamyc and has some clases and id's dinamically added.
has comment: http://stackoverflow.com/comment/45154078
possible better answer: http://stackoverflow.com/a/28410525
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28410646
has answer: http://stackoverflow.com/a/28410513
type: Question
has comment: http://stackoverflow.com/comment/45153986
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/28412658
has comment: http://stackoverflow.com/comment/45158747
type: AcceptedAnswer
downvote count: 0
has body: try this Page.RegisterClientScriptBlock("Pass", " ");
type: Answer
accepted answer of: http://stackoverflow.com/q/28412564
answers question: http://stackoverflow.com/q/28412564
score: 1
upvote count: 1

http://stackoverflow.com/a/28416355
accepted answer of: http://stackoverflow.com/q/28416164
has body: By the time the contents of #testCodeScriptTag are executing they have already been fetched from the DOM, loaded into the JavaScript engine, and parsed. The text in the DOM is no longer in any way connected to the executing code, as required by the HTML 5 specification: 1. Initialize the script block's source as follows: ... If the script is inline and the script block's type is a text-based language The value of the text IDL attribute at the time the element's "already started" flag was last set is the script source. ... 4. Create a script, using the script block's source, the URL from which the script was obtained, the script block's type as the scripting language, and the script settings object of the script element's Document's Window object. ... Note: This is where the script is compiled and actually executed. See Also: http://www.w3.org/TR/html5/webappapis.html#creating-scripts
type: Answer
score: 11
upvote count: 11
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28416164
downvote count: 0

http://stackoverflow.com/comment/44926600
type: AnswerComment
comment on: http://stackoverflow.com/a/28286158
has text: @AkshayDhalwala i'm trying to implement this solution, but there is a small problem. Since the response from the server will be `sayHello1(response.object)` ... it will throw an error because sayHello1() doesn't exist, what actually exists as per your code is `dynamicFunctions['sayHello1']()`
type: Comment
score: 0

http://stackoverflow.com/comment/45093458
type: QuestionComment
comment on: http://stackoverflow.com/q/28376655
score: 6
has text: If you post this much code you haven't narrowed the problem sufficiently.
type: Comment

http://stackoverflow.com/q/28394046
type: AnsweredQuestion
tagged with: javascript
tagged with: flask
has comment: http://stackoverflow.com/comment/45125013
has comment: http://stackoverflow.com/comment/45124899
type: Question
has title: Understanding Why Request Doesn't work in Flask
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28394276
has comment: http://stackoverflow.com/comment/45124994
score: 0
tagged with: python
tagged with: request
answer count: 1
has comment: http://stackoverflow.com/comment/45124741
has comment: http://stackoverflow.com/comment/45124885
has body: I have built a small flask server and associated website. I am able to use the flask server to successfully local host the page and furthermore I am able to use the code return str(request.form) to view text that I placed in a text field after clicking a button. Now I have written in my code that upon clicking the button of the FIRST html page one finds on my local host that they are redirected to another html page with almost identical code. For some reason however: return str(request.form) No longer displays values that I have inputted to the site. I kept trying to debug why and have ultimtely come to the conclusion that the flask request object DOES NOT behave the same way when called multiple times. Beyond that, I have no idea how to repair this. Here it is: (Flask Python Code: ) from flask import Flask from flask import request from flask import render_template from flask import abort, redirect, url_for import pymongo from pymongo import MongoClient import smtplib from email.mime.text import MIMEText app = Flask(__name__) @app.route('/') def my_form(): return render_template('minifile.html') @app.route('/', methods=['POST']) def my_form_post(): return redirect(url_for('my_form2')) @app.route('/a/') def my_form2(): return render_template('minifile2.html') @app.route('/a/', methods=['POST']) def my_form2_post(): return str(request.form) if __name__ == '__main__': app.run(debug=True) HTML for minifile.html HTML for minifile2.html This is text
has answer: http://stackoverflow.com/a/28394276
has comment: http://stackoverflow.com/comment/45125051

http://stackoverflow.com/comment/44970707
type: AnswerComment
has text: Than you @Mark. Perfect answer and well stated. And it confirms what I thought, there's a pattern here I'm not seeing to mod this, thank you, and..yeah, isn't it better to tweak the custom data model to begin with rather than NOT letting D3 do its thing.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28309036

http://stackoverflow.com/comment/45014039
has text: Yeah I want to see the results at the end of the whole test, the original is 50 files so after those 50 files it will show how he/she did on the test. So when you have pressed a key in the first file it will send the key to the last page after the 50 tests and save it there so that the user can see how she or he did
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28332825

http://stackoverflow.com/a/28316845
answers question: http://stackoverflow.com/q/28316756
downvote count: 0
has comment: http://stackoverflow.com/comment/44982784
has body: You are referencing to rateYo in your jQuery code, while the class attribute contains rateyo without a capital 'Y'.
score: 1
upvote count: 1
type: Answer

http://stackoverflow.com/q/28381570
tagged with: javascript
has comment: http://stackoverflow.com/comment/45105444
tagged with: http://stackoverflow.com/tag/html
has title: Javascript onclick issue with a draggable div
type: UnansweredQuestion
tagged with: draggable
has body: If a create a div element with var newdiv = document.createElement('div') newdiv.className = 'jsplumb-draggable _jsPlumb_endpoint_anchor_ jsplumb-drag' (I use the jsplumb lib) and want to bind a onlick event with newdiv.onclick = function(e) { console.log("ONCLICK FIRED!!") newdiv.style.backgroundImage = "linear-gradient(to bottom, #FFFFFF 0%, #FFFF00 20%, #FF0000 100%" } I get a "strange" behavior with it.... i.e. the click event is fired but the codeblock inside the function prints on the console but chan ges the color of the div ONLY IF I DRAG THE DIV, AND ONLY THE FIRST TIME!! What could be the reason?
answer count: 0
score: 0
type: Question
has comment: http://stackoverflow.com/comment/45101886

http://stackoverflow.com/comment/45105120
score: 0
type: Comment
has text: Sure , I'll try that out and let you know if that works for me.
type: AnswerComment
comment on: http://stackoverflow.com/a/28364110

http://stackoverflow.com/comment/44991924
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28322026
type: AnswerComment
has text: But the idea is to build the labels dynamically. I am not suppose to know what the properties are.

http://stackoverflow.com/q/28400253
upvote count: 1
has answer: http://stackoverflow.com/a/28400254
has title: How can i get Object.assign() to work in the browser when using 6to5?
type: AnsweredQuestion
score: 1
possible better answer: http://stackoverflow.com/a/28400254
type: Question
accepted answer: http://stackoverflow.com/a/28947180
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: babeljs
has answer: http://stackoverflow.com/a/28947180
has body: I'm using the 6to5 transpiler. When I try to use Object.assign() in my code, I get the following error: Uncaught TypeError: Object.assign is not a function. How can I enable this functionality?

http://stackoverflow.com/comment/45400775
type: QuestionComment
comment on: http://stackoverflow.com/q/28309968
score: 1
has text: Sorry for the late reply on this. The problem was caused by not adding all the files I needed into the zip file (a very obvious mistake)
type: Comment

http://stackoverflow.com/q/28398997
has comment: http://stackoverflow.com/comment/45135703
has comment: http://stackoverflow.com/comment/45135639
has comment: http://stackoverflow.com/comment/45134870
tagged with: d3.js
has body: I have a json object that I am trying to visualize with D3.js. I want the x axis to represent the date in the json object which is stored as a string and the y axis to represent sales projections which is also a number in a string i.e "85,000.00" example of my json object: [{"Num":78689,"Client":"Health Services" ,"TotalEstSales":"85,000,000.00","Date ":"2/15/2015","RFP Receipt Date":null,"Exp. Proposal Due Date":"3/6/2015","Proposal Submission Date":null,"estAwardDate":"4/15/2015","Procurement Type":"New - Incumbent","Bid Type":"Standalone Contract"}] and my d3 code: // Various accessors that specify the four dimensions of data to visualize. function x(d) { return d.date; } function y(d) { return d.TotalEstSales; } function radius(d) { return parseFloat(d.TotalEstSales);} function color(d) { return d.region; } function key(d) { return d.Title;} // Chart dimensions. var margin = {top: 19.5, right: 19.5, bottom: 19.5, left: 39.5}, width = 960 - margin.right, height = 500 - margin.top - margin.bottom; // Various scales. These domains make assumptions of data, naturally. var xScale = d3.scale.log().domain([300, 1e5]).range([0, width]), yScale = d3.scale.linear().domain([10000, 85000000]).range([height, 0]), radiusScale = d3.scale.sqrt().domain([0, 5e8]).range([0, 40]), colorScale = d3.scale.category10(); // The x &amp; y axes. var xAxis = d3.svg.axis().orient("bottom").scale(xScale).ticks(12, d3.format(",d")), yAxis = d3.svg.axis().scale(yScale).orient("left"); // Create the SVG container and set the origin. var svg = d3.select("#chart").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 + ")"); // Add the x-axis. svg.append("g") .attr("class", "x axis") .attr("transform", "translate(0," + height + ")") .call(xAxis); // Add the y-axis. svg.append("g") .attr("class", "y axis") .call(yAxis); // Add an x-axis label. svg.append("t…
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45136802
has comment: http://stackoverflow.com/comment/45137493
type: Question
has comment: http://stackoverflow.com/comment/45148501
has comment: http://stackoverflow.com/comment/45137820
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45135623
has title: I am trying to visualize my json object with D3. I want date to be the x axis and y to be sales. number values stored a string
score: 0
has comment: http://stackoverflow.com/comment/45135691
has comment: http://stackoverflow.com/comment/45133852
answer count: 1
has answer: http://stackoverflow.com/a/28423663
tagged with: javascript
has comment: http://stackoverflow.com/comment/45139242
has comment: http://stackoverflow.com/comment/45137113
has comment: http://stackoverflow.com/comment/45133645

http://stackoverflow.com/q/28320062
has title: elasticsearch aggregation bucket sort order
has body: In elasticsearch, is there a way to sort/order the aggregation bucket using a custom score? I am bucketing by customername. Each customer has several orders which has a delivery date field (delivdate). I want to sort the buckets based on the distance (closeness) to the current date. For example sort the customername that has delivery date closer to today's date. "aggs": { "mygroup": { "terms": { "field": "customername", "order" : { "_term" : "asc" } } } } Thank you
has answer: http://stackoverflow.com/a/35122676
upvote count: 2
type: UnansweredQuestion
type: Question
score: 2
has answer: http://stackoverflow.com/a/28322967
answer count: 2
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44992214
favorite count: 0
tagged with: elasticsearch

http://stackoverflow.com/a/28323451
upvote count: 5
has comment: http://stackoverflow.com/comment/44995239
score: 5
type: AcceptedAnswer
downvote count: 0
has body: No, it is not possible to include JavaScript in Application.cfc. The code inside the methods of Application.cfc occur server side and has no way to call code on the client side. Specifically, onRequestStart() runs once the request is made to the server. There is no response from the server at this point, so there is nothing for the client to be able to display/act on.
type: Answer
has comment: http://stackoverflow.com/comment/44995599
has comment: http://stackoverflow.com/comment/45000218
accepted answer of: http://stackoverflow.com/q/28321604
answers question: http://stackoverflow.com/q/28321604

http://stackoverflow.com/q/28318633
has comment: http://stackoverflow.com/comment/45228551
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28501384
type: AnsweredQuestion
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/45124765
linked to: http://stackoverflow.com/q/13881834
tagged with: angularjs
type: Question
has body: In an AngularJS application (main) I have an iframe inside which there is another AngularJS application (iframe) also under my control. I would like to share data between two services, one in the main application and one in the iframe application. They both need to read and write to the same object. // main // ... routes ... views: { main: { controller: function ($scope, serviceA) { $scope.serviceA = serviceA; }, templateUrl: 'iframe.html' } // ... function ServiceA () { this.sharedData; // exposed to controllers in main app } // ... // iframe // ... function ServiceB () { this.sharedData; // exposed to controllers in iframe app } // ... When inside a controller in iframe application I managed to reference serviceA.sharedData like this: var self = this; var parentScope = $window.parent.angular.element($window.frameElement).scope(); parentScope.$watch('serviceA.sharedData', function (newValue, oldValue) { self.sharedData = newValue; } Can this be achieved and how? I have read the following, but could not turn it into a solution, yet: Bind angular cross iframes, possible? Angularjs: call other scope which in iframe
score: 10
has comment: http://stackoverflow.com/comment/45300869
possible better answer: http://stackoverflow.com/a/28407910
has answer: http://stackoverflow.com/a/28501384
linked to: http://stackoverflow.com/q/18437594
has title: Access AngularJS service from a service inside a different frame
has answer: http://stackoverflow.com/a/28407910
tagged with: iframe
answer count: 2
upvote count: 10

http://stackoverflow.com/q/28292367
has body: I have been struggling with reliably getting the client public IP in an asp.net 2.0 application. When i use this http://jsonip.appspot.com/?callback=getip service, i have found that it can randomly become unreachable &amp; will through the following message &amp; this becomes a show stopper for my application. "Over Quota This application is temporarily over its serving quota. Please try again later." I have tried another alternative service here http://l2.io/ip.js?var=userip. This isn't reliable either as it also can randomly be unreachable. Has any one here ever hard a requirement to get the client public IP and implemented a reliable solution?
answer count: 1
has answer: http://stackoverflow.com/a/28326641
tagged with: asp.net
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/19285957
tagged with: geolocation
type: Question
tagged with: ip-geolocation
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44937946
has title: Most reliable way to get client public IP

http://stackoverflow.com/a/28332273
accepted answer of: http://stackoverflow.com/q/28332236
has comment: http://stackoverflow.com/comment/45050029
answers question: http://stackoverflow.com/q/28332236
type: AcceptedAnswer
score: 0
has comment: http://stackoverflow.com/comment/45037295
type: Answer
has comment: http://stackoverflow.com/comment/45045301
has body: class is a reserved word in javascript. Change the variable name to something valid and select multiple elements by separating them with a comma: var $class = $('.dvData, .dvData1'); Here is one solution to get this working the way you expect: HTML: Account System Market Code Payment Amount RED 222 $103.00 BLUE 111 $13.00 GREEN 555 $143.00 Billing System Market Code Payment Amount RED 222 $103.00 BLUE 111 $13.00 GREEN 555 $143.00 JAVASCRIPT: $(document).ready(function() { $(".toExcelButton").click(function() { var table = $("." + $(this).data('target')); var strCopy = $(' ').html(table.clone()).html(); window.clipboardData.setData("Text", strCopy); var objExcel = new ActiveXObject("Excel.Application"); objExcel.visible = false; var objWorkbook = objExcel.Workbooks.Add; var objWorksheet = objWorkbook.Worksheets(1); objWorksheet.Paste; objExcel.visible = true; }); });
has comment: http://stackoverflow.com/comment/45046320

http://stackoverflow.com/comment/45049410
comment on: http://stackoverflow.com/a/28351712
score: 0
type: AnswerComment
has text: Hello. I'm not sure I follow you, sorry. The nature of getElementById is a function, for sure (it's not a string or a number). However, it is a member of the Document interface, as per the W3 DOM Core Level 2 specification, which means it should be called in relation to a Document instance. To put it differently, your alias would work only in the current window, but wouldn't be usable, would you like to retrieve an element from another document (say, in an iframe).
type: Comment

http://stackoverflow.com/q/28319490
has title: How to manipulate cytoscape.js graph data before rendering
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28321375
upvote count: 1
type: Question
tagged with: graph
tagged with: cytoscape.js
score: 1
has body: I have relatively big amount of graph data (over 1000 nodes, over 2000 edges). Cytoscape.js is failing to render this amount of data, so I decided I will cook some interactive graph exploration. I want to start with graph roots (it is DAG) and user will be able to explore nodes after clicking on them. I know I can do it outside of cytoscape.js, but I wanted to know if I can create a node/edge collection that I would manipulate (remove all nodes but roots and their neighbours) and then use as data source (get child nodes of nodes). Cytoscape makes graph processing quite easy and it would be great to not need to reinvent the wheel. I tried creating cy.collection based on the JSON data I was feeding to the graph, but it seems like it doesn't accept the same data format as cy.load.
accepted answer: http://stackoverflow.com/a/28321375
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0

reserved-words
tag name: reserved-words
type: Tag
tags question: http://stackoverflow.com/q/28395956

http://stackoverflow.com/comment/45193113
score: 0
type: AnswerComment
has text: Unfortunately (for my use-case) developer tools also show a "request" when setting the decrypted string to the src of the image, even though this is not a real network request that transfers the data. I modified your fiddle to illustrate this: http://jsfiddle.net/ef3d1v2q/4/ - Just run the fiddle and open the network tab in Chrome dev tools. You will see a preview of the image ...
comment on: http://stackoverflow.com/a/28429523
type: Comment

http://stackoverflow.com/a/43949823
answers question: http://stackoverflow.com/q/28365737
upvote count: 0
type: Answer
downvote count: 1
has body: This below code worked for me for(i= 0; i&lt; n; i++){ col = i; for(j = 0; j&lt; n- col;j++){ process.stdout.write(''); } for (j = 1;j&lt; col+2;j ++){ process.stdout.write('#'); } process.stdout.write('\n'); }
score: -1

http://stackoverflow.com/q/28370178
has comment: http://stackoverflow.com/comment/69388854
has comment: http://stackoverflow.com/comment/45083336
has comment: http://stackoverflow.com/comment/45083598
has comment: http://stackoverflow.com/comment/45081019
type: Question
tagged with: polymer
tagged with: reactjs
has comment: http://stackoverflow.com/comment/45083706
upvote count: 6
tagged with: javascript
has title: Stable webcomponent-like templating engine with data binding?
has comment: http://stackoverflow.com/comment/45084440
has comment: http://stackoverflow.com/comment/45084223
tagged with: web-component
tagged with: template-engine
favorite count: 0
has comment: http://stackoverflow.com/comment/45081760
type: UnansweredQuestion
score: 6
has comment: http://stackoverflow.com/comment/45082085
has body: I'm looking for good frontend "template engine" of some sort. I've spent 2 days researching. I've looked into Polymer (by Google), Reactjs (by Facebook), Skatejs (by Atlassian), Rivet (used by Dell) and Angularjs directives (by Google). Now, I need some help. Desired features: data binding (one or two directional) parsing custom elements, ex: that output some predefined html the custom elements should have the ability to wrap around nested elements, ex: My title that output the predifed html with the nested tag at the specified location inside that html (similar to webcomponents and Polymer) minimum abstraction and no new syntax if possible (except some mustache-like templating may be) a bonus would be html imports Additionally: should be stable should be simple to use, simply drop in (not-in-the-way), not requiring some certain app structure should do just template-engine things (bad example: Angular does abstract things too much, also include some jquery-like thing, etc) My findings so far: I found that Polymer is unstable with the shadow-dom and not working properly without it. Reactjs defines its own language which is unnecessary for me, react also requires nested components to be react components again, and don't allow to be html (limitation due to the custom language). Skatejs doesn't have data binding. Rivet has unstable custom elements and no ability to wrap nested elements. Angular directives are introducing the whole angular js abstraction, which is a bit too much only to get nice templating working. My question Is there alternative to the libraries I've tried that match the desired features listed above? If not, can you think of a way to mash some libraries together and achieve such functionality?
has comment: http://stackoverflow.com/comment/45081611
answer count: 0
downvote count: 0

http://stackoverflow.com/comment/45004242
comment on: http://stackoverflow.com/a/28316240
type: Comment
has text: still not undersand, why not use http connection and use `response.socket` to continue ws handshake.
score: 0
type: AnswerComment

http://stackoverflow.com/a/28301685
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/44996282
has body: Here is a very general guideline: Use classes to define some styles (or even just one style), if it actually means something. For instance, if you want JavaScript to designate an element as a selected item, use a .selected-item class and set that on the element. This lets you do design work in the CSS file. However, if you are doing one-off modifications, especially those involving calculations, such as setting the height of an element relative to another element... then you should modify the element.style object with those specific properties. In summary: Use a class if it's got meaning. Modify properties directly if it's a one-off thing. In fact, this applies to the base HTML as well. You can easily define a class .center {text-align:center} and apply that to center-aligned elements, because it's not a one-off deal. But if you need for a particular element to have some extra bottom margin, use style="margin-bottom:20px" instead of defining a class just for that.
accepted answer of: http://stackoverflow.com/q/28301356
has comment: http://stackoverflow.com/comment/44957502
type: Answer
answers question: http://stackoverflow.com/q/28301356
has comment: http://stackoverflow.com/comment/44955100
upvote count: 3
has comment: http://stackoverflow.com/comment/44996263
score: 3
has comment: http://stackoverflow.com/comment/44996484

http://stackoverflow.com/a/28282216
type: Answer
has comment: http://stackoverflow.com/comment/44920110
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/44919073
has body: Serialize out your model and pass it to your view model. Use ko.mapping to map it from your model dynamically within your view model. Providing that your collection contains an array that is books it will become an observable array automatically. View model var app = (function (app) { app.FilterBooks = function (data) { var self = this; ko.mapping.fromJS(data, {}, self); }; return app; }(app || {})); Index js &lt;script type="text/javascript"&gt; $(document).ready(function () { var data = @Html.Raw(Json.Encode(Model)); var e = new app.FilterBooks(data); ko.applyBindings(e); }); &lt;/script&gt; Update Also as mentioned by @james14 make sure you include the mapping plugin. http://knockoutjs.com/documentation/plugins-mapping.html PM&gt; Install-Package Knockout.Mapping https://www.nuget.org/packages/Knockout.Mapping
answers question: http://stackoverflow.com/q/28282043
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28282043
upvote count: 3

http://stackoverflow.com/a/28326175
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28326102
answers question: http://stackoverflow.com/q/28326102
has comment: http://stackoverflow.com/comment/44999918
has body: Well if you do not want it than cancel it with preventDefault $('.inputs').keydown(function (e) { if (e.which === 13) { e.preventDefault(); //put focus code here } });
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/a/28349144
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28348538
answers question: http://stackoverflow.com/q/28348538
type: AcceptedAnswer
downvote count: 0
has body: Take a look at jQuery's ajax function. Here is a simple example: // Servlet @SuppressWarnings("serial") public class AjaxHandler extends HttpServlet { @Override public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException { resp.setContentType("text/plain"); resp.getWriter().print("Hello jQuery!"); } } // View.jsp <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> Insert title here Servlet's message:
type: Answer
score: 1

http://stackoverflow.com/comment/44993511
score: 0
has text: Something like this: http://jsfiddle.net/om4b7ch1/1/
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28322601

webcam
tags question: http://stackoverflow.com/q/28327877
tag name: webcam
type: Tag

http://stackoverflow.com/a/28441896
has body: Have you tried to replace Geolocation.latLng() by Geolocation.currentLocation() to check if it returns a position or null ? Is there a git repo ?
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45228257
accepted answer of: http://stackoverflow.com/q/28435847
has comment: http://stackoverflow.com/comment/51116713
answers question: http://stackoverflow.com/q/28435847
upvote count: 2
has comment: http://stackoverflow.com/comment/45219882
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/28372461
has answer: http://stackoverflow.com/a/28372666
accepted answer: http://stackoverflow.com/a/28372791
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Insert text using jQuery if non-breaking space is found within an element?
linked to: http://stackoverflow.com/q/5237989
has body: I'm using a plugin that is generating some additional markup that needs to be removed. I can detect if the HTML entity &amp;nbsp; exists in a specific element, but I cannot seem to change it using html(). Can anyone spot the issue that's preventing the element from being changed? HTML &lt;div class="quote"&gt; &lt;blockquote&gt;John Doe wrote: &lt;p&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;Jane Doe wrote: This is awesome!&lt;/p&gt; &lt;/blockquote&gt; &lt;/blockquote&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;/div&gt; jQuery if ($('.quote').find('p:contains("&amp;nbsp;")')) { console.log('&amp;nbsp; detected'); $('.quote').find('p:contains("&amp;nbsp;")').html("inserted text"); } Here's my fiddle.
answer count: 3
favorite count: 0
has answer: http://stackoverflow.com/a/28372598
has comment: http://stackoverflow.com/comment/45085445
has answer: http://stackoverflow.com/a/28372791
upvote count: 1
has comment: http://stackoverflow.com/comment/45085589
has comment: http://stackoverflow.com/comment/45085813
type: AnsweredQuestion
score: 1
possible better answer: http://stackoverflow.com/a/28372666
type: Question

jquery-mobile
tags question: http://stackoverflow.com/q/28310572
tags question: http://stackoverflow.com/q/28311398
tags question: http://stackoverflow.com/q/28407628
type: Tag
tags question: http://stackoverflow.com/q/28335858
tags question: http://stackoverflow.com/q/28383017
tags question: http://stackoverflow.com/q/28414052
tags question: http://stackoverflow.com/q/28388995
tags question: http://stackoverflow.com/q/28356523
tags question: http://stackoverflow.com/q/28337537
tags question: http://stackoverflow.com/q/28404667
tags question: http://stackoverflow.com/q/28311859
tags question: http://stackoverflow.com/q/28434344
tags question: http://stackoverflow.com/q/28334286
tags question: http://stackoverflow.com/q/28411516
tags question: http://stackoverflow.com/q/28345272
tags question: http://stackoverflow.com/q/28301358
tags question: http://stackoverflow.com/q/28392301
tags question: http://stackoverflow.com/q/28312693
tags question: http://stackoverflow.com/q/28286554
tags question: http://stackoverflow.com/q/28373349
tags question: http://stackoverflow.com/q/28309433
tags question: http://stackoverflow.com/q/28327182
tags question: http://stackoverflow.com/q/28436603
tags question: http://stackoverflow.com/q/28341742
tags question: http://stackoverflow.com/q/28425978
tags question: http://stackoverflow.com/q/28377138
tags question: http://stackoverflow.com/q/28343338
tag name: jquery-mobile

http://stackoverflow.com/q/28382848
has body: So I have a scenario where I am constantly getting a good number of self-referral traffic to my website. I investigated it further and believe it to be a case of an issue with my cross domain tracking (as I use a 3rd party shopping cart). What I can't seem to figure out is what I have wrong and why it isn't working. My specific scenario looks like the following MainSite.com Analytics Code &lt;script&gt; (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-XXXXX210-1', 'auto', {'allowLinker': true}); ga('require', 'linker'); ga('linker:autoLink', ['mainsite.com','checkoutsite.com'], true, true); ga('require', 'displayfeatures'); ga('send', 'pageview'); &lt;/script&gt; CheckoutSite.com Analytics Code &lt;script type="text/javascript"&gt; (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-XXXXX210-1', 'auto', { 'allowLinker': true }); ga('require', 'ec'); &lt;/script&gt; As for the setup options: The following domains are added to the exclusion referral list in GA mainsite.com checkoutsite.com (the actual checkout is on a subdomain of kiosk.checkoutsite.com but this shouldn't make a difference AFAIK) mainsite.com 301 redirects to www.mainsite.com As far as I can tell the 3rd party checkout JS script is adding link decorators as seems to be required Edit: Have confirmed as per the comments below The links to the checkout cart are Javascript based which result in a iframe popover. They look like the follwing: &lt;a class="ezt…
answer count: 1
tagged with: javascript
tagged with: analytics
has comment: http://stackoverflow.com/comment/45120094
score: 0
tagged with: universal-analytics
type: UnansweredQuestion
has title: Cross Domain Tracking in Google Universal Analytics with Javascript Links
tagged with: google-analytics
tagged with: web-analytics
has answer: http://stackoverflow.com/a/28390295
type: Question

http://stackoverflow.com/q/28396735
has title: Karma + Jasmine + nano.jar : how to configure?
type: UnansweredQuestion
has body: I'm using grunt with karma and jasmine for unit tests. I want to use the nano.jar java applet to test timing of some code (as seen on benchmark.js). But I can't figure out how to tell karma to load the html of the applet to the page. &lt;applet code="nano" archive="nano.jar"&gt;&lt;/applet&gt; I read about fixtures in karma and also about jasmine-jquery fixtures but I can't seem to get them to work. currently I have this karma.conf: config.set({ basePath: '', frameworks: ['jasmine'], files: [ {pattern: '../tests/fixtures/bla.htm', watched: true, served: true, included: false}, '../tests/**/*.js' ] } And this in bla.htm: &lt;applet code="nano" archive="nano.jar"&gt;&lt;/applet&gt; And this in my test file: describe("testing perf", function() { beforeEach(function() { jasmine.getFixtures().fixturesPath = 'base/tests/fixtures'; loadFixtures('bla.htm'); }); it("lalala", function() { // use nanoseconds here }); }); But for some reason jasmine-jquery throws a 404 exception when trying to load base/tests/fixtures/bla.htm How can this be done? I would prefer a solution using only karma, I used jasmine-jquery only because I had no success with just karma.
tagged with: karma-runner
answer count: 0
tagged with: java
upvote count: 1
type: Question
downvote count: 0
tagged with: javascript
tagged with: karma-jasmine
tagged with: applet
score: 1
favorite count: 0

http://stackoverflow.com/a/28666990
answers question: http://stackoverflow.com/q/28416442
has body: You need to add a 'displayKey' within the typeahead call. Displaykey should be 'name' in your case. Something like this: // instantiate the typeahead UI $( '#companySearch').typeahead(null, { displayKey: 'name', source: companies.ttAdapter() });
score: 0
type: Answer

http://stackoverflow.com/q/28363363
linked to: http://stackoverflow.com/q/18020950
answer count: 0
tagged with: angularjs
tagged with: twitter-bootstrap
type: UnansweredQuestion
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45068899
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45068568
has comment: http://stackoverflow.com/comment/49251436
has title: Using Native Datepicker in Angular webApplication
upvote count: 1
tagged with: datepicker
has body: Is there a way for a AngularJs based application to use native datepicker when running on a device ? For example in a android device i want to show the native datepicker so that user can swipe up and down. Because in desktop there is no native datepicker, i'm thinking about to check the target that web application is running and show bootsrap-ui datepicker.
favorite count: 0

http://stackoverflow.com/q/28360149
tagged with: jquery
tagged with: ajax
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I've a sign up form which has submit button with value "GET INSTANT ACCESS!" : &lt;input type="submit" class="wf-button" name="submit" value="GET INSTANT ACCESS!"&gt; After submit, the value gets change to 'Thank You!': &lt;input type="button" class="wf-button" value="Thank You!"&gt; I need to detect the button value. If it becomes "Thanks You!" then I have to show a popup. And this value gets change by some Ajax (GetResponse form). There is no page refresh. I've tried below code but it is only working in FireFox &amp; not working in Chrome. &lt;script&gt; $(function() { $(".modalbox").fancybox(); }); $(function() { $('.wf-button').bind("DOMSubtreeModified",function(){ //if btn valu is 'Thank You! trigger popup' $(".modalbox").trigger('click'); }); }); &lt;/script&gt; Live URL: http://www.idynbiz.com/web/html/gold_ira_vf/? (just to show how the button changes its value) Can some one help how can I detect the button value and show my popup? The button change its value in real time (Ajax). There is not page refresh. Is there any JQuery approach with bind() Or on() function to detect the value?
has comment: http://stackoverflow.com/comment/45063170
has comment: http://stackoverflow.com/comment/45063430
has title: How to detect button value change in JQuery?
type: Question
has answer: http://stackoverflow.com/a/44698349
has answer: http://stackoverflow.com/a/28360667
has answer: http://stackoverflow.com/a/28360617
tagged with: javascript
has comment: http://stackoverflow.com/comment/45063091
linked to: http://stackoverflow.com/q/7837510
has comment: http://stackoverflow.com/comment/45420538
score: 0
has comment: http://stackoverflow.com/comment/45063394
answer count: 3
has comment: http://stackoverflow.com/comment/45063064

http://stackoverflow.com/q/28416775
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 3
has answer: http://stackoverflow.com/a/28416889
score: 3
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28416821
has body: I would like to use the scroll() function to detect when I scrolldown the page. for example, this code : $(window).scroll(function () { alert(); }); My problem is that this code works when I'm at the top of the page and scrolldown, but when I'm not at the top of the page and I refresh the page, I have the alert BEFORE any scroll. I would like it to work only when I scroll. NOT when I'm already at the middle of the page without scrolling yet. Do you have any advice? I hope I'm clear. Tim
has answer: http://stackoverflow.com/a/28416821
favorite count: 0
has answer: http://stackoverflow.com/a/28417280
upvote count: 3
tagged with: scroll
has title: Scroll() function when refreshing pages
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28416889
type: Question

amazon-elastic-beanstalk
tag name: amazon-elastic-beanstalk
type: Tag
tags question: http://stackoverflow.com/q/28313842

http://stackoverflow.com/a/52718522
upvote count: 1
score: -2
has comment: http://stackoverflow.com/comment/108301132
answers question: http://stackoverflow.com/q/28357965
type: Answer
has body: var CounterSchema = Schema({ _id: { type: String, required: true }, seq: { type: Number, default: 0 } }); var counter = mongoose.model('counter', CounterSchema); var entitySchema = mongoose.Schema({ testvalue: { type: String } }); entitySchema.pre('save', function(next) { if (this.isNew) { var doc = this; counter.findByIdAndUpdate({ _id: 'entityId' }, { $inc: { seq: 1 } }, { new: true, upsert: true }) .then(function(count) { doc.testvalue = count.seq; next(); }) .catch(function(error) { throw error; }); } else { next(); } });
downvote count: 3

http://stackoverflow.com/a/28402488
type: AcceptedAnswer
downvote count: 0
has body: Solution: @JavaScript(Json.stringify(TaskType.valuesJson())); Explanation: Play use a JavaScript template format for files "*.js", so you need to use @JavaScript rather than @Html. It's clear after understanding how the templates engine works... Sources: Helped to get there: playframework JsValue in HTML Template Helped to get there: Render a Play!Framework2 javascript as template? There: https://www.playframework.com/documentation/2.3.x/JavaCustomTemplateFormat There: https://www.playframework.com/documentation/2.2.x/api/scala/index.html#play.api.templates.JavaScriptFormat$
answers question: http://stackoverflow.com/q/28401423
type: Answer
accepted answer of: http://stackoverflow.com/q/28401423
upvote count: 2
score: 2

http://stackoverflow.com/q/28348391
answer count: 1
has title: Knockout observable not getting bound
tagged with: asp.net-mvc-4
type: AnsweredQuestion
score: 0
has answer: http://stackoverflow.com/a/28348531
has body: I am using a form for editing purposes.The Taxonomy Code gets populated when the form is getting loaded.The fields are bound to knockout observables in HTML using the data-bind attribute.The only issue I am facing is this particular field(Taxonomy Code) is NULL when the data is sent to the controller. The HTML is Certification: Specialization: Taxonomy Code: JavaScript is var provider = function() { var self = this; if ((providerEditInfo.Certification == "M.D.") || (providerEditInfo.Certification == "M.B.B.S")) { specialities = ["Dermatology", "Hematology", "Neurology"]; } else if ((providerEditInfo.Certification == "R.N.") || (providerEditInfo.Certification == "M.S.N.")) { specialities = ["Pediatric Nursing", "Critical Care Nursing", "Occupational Health Nursing"]; } self.certificationArray = ko.observableArray(["M.B.B.S", "M.D.", "R.N.", "M.S.N."]); self.certification = ko.observable(providerEditInfo.Certification); self.specializationArray = ko.observableArray(specialities); self.specialization = ko.observable(providerEditInfo.Specialization); self.taxonomyCode = ko.observable(providerEditInfo.TaxonomyCode); self.certification.subscribe(function(val) { self.specializationArray([]); if (val == "M.D." || val == "M.B.B.S") { self.specializationArray(["Dermatology", "Hematology", "Neurology"]) } else if (val == "R.N." || val == "M.S.N.") { self.specializationArray(["Pediatric Nursing", "Critical Care Nursing", "Occupational Health Nursing"]) } else { self.specializationArray([]); } }); self.specialization.subscribe(function(val) { self.taxonomyCode(""); if (val == "Dermatology") self.taxonomyCode("207N00000X"); else if (val == "Hematology") self.taxonomyCode("207RH0000X"); else if (val == "Neurology") self.taxonomyCode("2084N0400X"); else if (val == "Pediatric Nursing") self.taxonomyCode("363LP0200X"); else if (val == "Critical Care Nursing") self.taxonomyCode("363LC0200X"); else if (val == "Occupational Health Nursing") self.taxonomyCode("363LX0106X"); }); }; $(docu…
tagged with: knockout.js
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28348531

http://stackoverflow.com/comment/45034703
comment on: http://stackoverflow.com/q/28344102
score: 0
type: Comment
type: QuestionComment
has text: i'm not having any response when use `CVarDumper::Dump($_POST,100,true);` or `print_r($_POST)` it's just blank. By the way changing hhmm into data there's not any response just: **{"total":null,"status":"OK"}**

http://stackoverflow.com/q/28404980
tagged with: angularjs
has title: Angular Error: [$rootScope:inprog] $apply already in progress on document.click()
has answer: http://stackoverflow.com/a/28405847
upvote count: 1
answer count: 1
tagged with: typescript
has body: I often recive the " $apply already in progress" Error at this peace of code: public addFile(): void { if (window["File"]) { $("#fileSelector").click(); } } the addFile function is called by ng-click, has someone an idea how to avoid it?
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
score: 1
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: web
favorite count: 0

http://stackoverflow.com/a/28411477
has comment: http://stackoverflow.com/comment/45158503
has comment: http://stackoverflow.com/comment/45158284
has body: Instead of directive I would suggest simpler approach: to read route configuration seo information directly. For this you need to store seo data in route config: $routeProvider .when("/", { templateUrl: "page1.html", controller: "Page1Controller", seo: { metaDescription: "My SEO Meta Description" } }) and then in run block of your application you can add $routeChangeSuccess event listener that would set $rootScope.seo based on current $route: app.run(['$rootScope', '$route', function($rootScope, $route) { $rootScope.$on('$routeChangeSuccess', function(newVal, oldVal) { if (oldVal !== newVal) { $rootScope.seo = $route.current.seo; } }); }]); Demo: http://plnkr.co/edit/fzm6FknfOO8I6vdAO39g?p=preview
upvote count: 1
answers question: http://stackoverflow.com/q/28411256
score: 1
has comment: http://stackoverflow.com/comment/45158075
downvote count: 0
has comment: http://stackoverflow.com/comment/45158175
has comment: http://stackoverflow.com/comment/45157896
type: Answer
has comment: http://stackoverflow.com/comment/45158380

http://stackoverflow.com/a/28335466
has comment: http://stackoverflow.com/comment/45045582
downvote count: 0
type: Answer
score: 2
upvote count: 2
has body: The easiest way to do it: &lt;input placeholder="hello" onchange="if (this.value == '') {this.placeholder = 'hello';}" /&gt;
answers question: http://stackoverflow.com/q/28335382
has comment: http://stackoverflow.com/comment/45070790

http://stackoverflow.com/a/28357416
score: 0
type: Answer
has body: If you are going to use JQuery I would suggest the code below. I believe it is what your are attempting to accomplish with your code. jsfiddle example: http://jsfiddle.net/larryjoelane/bazma5st/29/ Javascript/Jquery: //set the limit var limit = 765; //the column class var colClass = $(".3-col-force"); //window resize event $(window).on("resize",function(){//begin on resize event //if the window is greater than the limit if ($(this).width() &gt; limit) {//begin if then else //set its width to 33% colClass.width("33%"); } else { //set its width to 33% colClass.width("100%"); }//end if then else //end of window on resize event }).on("load",function(){//begin on load event for window load //if the window is greater than the limit if ($(this).width() &gt; limit) {//begin if then else //set its width to 33% colClass.width("33%"); } else { //set its width to 33% colClass.width("100%"); }//end if then else });//end on window load event
answers question: http://stackoverflow.com/q/28357116

http://stackoverflow.com/q/28375124
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/28375462
downvote count: 2
score: -1
type: AnsweredQuestion
has body: i have this html code Posted Posted-Date And this sample JS code var one = document.getElementById("pox").value-=5; var one = document.getElementById("pox1").value+=5; the problem is the -=5 returns a 5 value which is what i wanted. but +=5 return 105, how do i make it return 15. my purpose of adding -=5 or += 5 is to add or subtract 5 each time the button is clicked
has title: the correct way to use Javascript += operator
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28375462
tagged with: javascript
has comment: http://stackoverflow.com/comment/45090719

http://stackoverflow.com/q/28430701
type: Question
has comment: http://stackoverflow.com/comment/45197647
has comment: http://stackoverflow.com/comment/45198088
tagged with: javascript
has comment: http://stackoverflow.com/comment/45270481
has comment: http://stackoverflow.com/comment/45198373
upvote count: 2
has comment: http://stackoverflow.com/comment/45201267
has title: Parse.com: Script error 'undefined'
favorite count: 0
tagged with: parse-platform
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45197128
tagged with: backend
score: 2
answer count: 0
downvote count: 0
has body: I'm new to Parse.com cloud jobs and I have an error. I need to make a cloud job that compute statistics out of all registered games in the database ( ~500K ). My script first draft is : Parse.Cloud.job("dostats", function(request, status) { Parse.Cloud.useMasterKey(); var max_score_query = new Parse.Query("ScoreData"); max_score_query.descending('score'); max_score_query.first( { success: function(result) { var stat_size = 40; var count = 0; var stats = new Array(stat_size); for ( i = 0; i &lt; stat_size; ++i) { stats[i] = 0; } var max_score = result.get('score'); var promise = Parse.Promise.as(); promise = promise.then( function() { var stats_query = new Parse.Query("ScoreData"); return stats_query.each( function(line) { var score = line.get('score'); var id = parseInt((stat_size - 1) * ( score / max_score)); stats[id] = stats[id] + 1; count = count + 1; }).then( function() { status.success("lol"); }, function(error) { status.error("error"); }); }); return promise; }, error: function() { status.error("Unable to get max score"); } }); }); }); If I console.log(stats.toString()) in the each loop data is correct. However job fails with this message : E2015-02-10T11:16:54.296Z] v137: Ran job dostats with: Input: {} Failed with: undefined Any idea what I do wrong?

http://stackoverflow.com/a/28402815
answers question: http://stackoverflow.com/q/28402779
score: 0
type: Answer
has body: Since there is no jQuery used in your js method, I'm assuming you are not really using jQuery. In that case &lt;select name="var4" onchange="submitForm();"&gt; then function submitForm() { //get the input elements by name and then read its value var OAjax, var1 = document.getElementsByName('var1')[0].value, var2 = document.getElementsByName('var2')[0].value, var3 = document.getElementsByName('var3')[0].value, var4 = document.getElementsByName('var4')[0].value; if (window.XMLHttpRequest) OAjax = new XMLHttpRequest(); else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); OAjax.open('POST', "return.php", true); OAjax.onreadystatechange = function () { if (OAjax.readyState == 4 &amp;&amp; OAjax.status == 200) { if (document.getElementById) { document.getElementById('msg').innerHTML = '' + OAjax.responseText + ''; } } } OAjax.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); //create a parma string using the input values OAjax.send('var1=' + var1 + '&amp;var2=' + var2 '&amp;var3=' + var3 '&amp;var4=' + var4); }
has comment: http://stackoverflow.com/comment/45175473
accepted answer of: http://stackoverflow.com/q/28402779
type: AcceptedAnswer

http://stackoverflow.com/q/28434443
type: UnansweredQuestion
tagged with: iframe
type: Question
has answer: http://stackoverflow.com/a/28434893
has comment: http://stackoverflow.com/comment/45199853
answer count: 1
tagged with: javascript
has body: I have two paramers (longitude and latitude) already saved in database , how to generate a maps (google) in an iframe using only html5 widhout jQuery or javascript
has title: how to display map in iframe having latitude and longitude
score: 0
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/10886416

http://stackoverflow.com/q/28335443
type: Question
has title: I cannot get php to redirect with onclick()
has body: I have a button in php that will not redirect. Assume the page destination is correct, is anything else wrong with this line? echo " Create Team "; thanks!
type: AnsweredQuestion
tagged with: onclick
has comment: http://stackoverflow.com/comment/45017127
possible better answer: http://stackoverflow.com/a/28335484
has answer: http://stackoverflow.com/a/28335454
has answer: http://stackoverflow.com/a/28335484
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28335454
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28335580
answer count: 4
has answer: http://stackoverflow.com/a/28335558
tagged with: http-redirect
tagged with: php
has comment: http://stackoverflow.com/comment/45017144

http://stackoverflow.com/a/28433126
has comment: http://stackoverflow.com/comment/45196348
score: 0
has comment: http://stackoverflow.com/comment/45196314
has body: Yes you can. submit button has class wpcf7-submit. you can use class selector to target it: $('.wpcf7-submit').css('right','10px');
answers question: http://stackoverflow.com/q/28433061
has comment: http://stackoverflow.com/comment/45196558
has comment: http://stackoverflow.com/comment/45196372
type: Answer

http://stackoverflow.com/comment/46700910
type: AnswerComment
comment on: http://stackoverflow.com/a/29242607
has text: Refal: Can you explain how the child of a category is considered in filtering. I mean if cat id 1 has child with cat id 4,5. If I select category 1 then filter should consider 1,4,5 categories in filtering the files.
score: 0
type: Comment

http://stackoverflow.com/comment/45150553
type: Comment
comment on: http://stackoverflow.com/a/28408223
has text: please add code, i didn't understand for 100% what you mean and where to change
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45236144
comment on: http://stackoverflow.com/a/28432026
has text: Already i used that above said link. but it gives <g> not <defs>. Any ideas???. Me too have Adobe Illustrator. How can i get that point?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/62870635
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/34501500
score: 0
has text: Can you give me some references about how you are using injector? You are calling it on a dom element, where can I find some references about this use? Thanks

http://stackoverflow.com/q/28317375
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28317602
tagged with: javascript
has comment: http://stackoverflow.com/comment/44984434
tagged with: html-table
answer count: 2
accepted answer: http://stackoverflow.com/a/28317602
downvote count: 0
has title: Dynamic HTML row - add id on TR
score: 1
favorite count: 0
possible better answer: http://stackoverflow.com/a/28318346
has body: How to add an ID (value 1, 2, 3, etc.) on each new I have now so that my script creates a new row, but would need an ID to each FIDDLE CODE: function deleteRow(tableID) { try { var table = document.getElementById(tableID); var rowCount = table.rows.length; for(var i=0; i&lt;rowCount; i++) { var row = table.rows[i]; var chkbox = row.cells[0].childNodes[0]; if(null != chkbox &amp;&amp; true == chkbox.checked) { if(rowCount &lt;= 1) { alert("Cant delete all rows"); break; } table.deleteRow(i); rowCount--; i--; } } }catch(e) { alert(e); } }
has comment: http://stackoverflow.com/comment/44983994
has answer: http://stackoverflow.com/a/28318346
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion

http://stackoverflow.com/comment/44932225
has text: @georg Thank you! `var randomInsult = ["Your", randomBodyPart, " is more ", randomAdjective, " than a ", randomWord, "’s", randomAnimalBodyPart, "."].join(" ");`
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28289027

http://stackoverflow.com/q/28285909
accepted answer: http://stackoverflow.com/a/28309845
possible better answer: http://stackoverflow.com/a/29391788
has comment: http://stackoverflow.com/comment/44928547
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29391788
tagged with: php
upvote count: 6
has comment: http://stackoverflow.com/comment/44967014
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44969454
score: 6
has comment: http://stackoverflow.com/comment/44964663
type: Question
has answer: http://stackoverflow.com/a/28309845
tagged with: javascript
has comment: http://stackoverflow.com/comment/44969851
answer count: 2
has comment: http://stackoverflow.com/comment/44927350
has body: UPDATE: This is the entire code, which I pretty much copied and pasted. Take Snapshot I'm using this link http://mycodingtricks.com/javascript/webcam-api/ This one looks a lot better but may be the same thing http://www.html5rocks.com/en/tutorials/getusermedia/intro/ What I'm concerned about is the data_uri, also the url upload So the webcam works, shows my face, whatever, but I push this Take Snapshot and nothing happens. I see the little grey box at the bottom left saying javascript:void(take_snapshot()) I'm wondering if I'm supposed to put a parameter... There can be several problems, I am using domain mapping and the folder may be pointed incorrectly or it could be a file permission problem, I did chown with www-data This is the upload.php as suggested or rather given by the first link <?php // be aware of file / directory permissions on your server move_uploaded_file($_FILES['webcam']['tmp_name'], '/tabdater/uploads/webcam'.md5(time()).rand(383,1000).'.jpg'); ?> I'd appreciate any help.
has title: I'm trying to use a simple webcam capture upload, upload isn't working?
has comment: http://stackoverflow.com/comment/44935030
downvote count: 0
tagged with: upload
has comment: http://stackoverflow.com/comment/44928259
favorite count: 0
has comment: http://stackoverflow.com/comment/44967057

http://stackoverflow.com/q/28356075
tagged with: javascript
tagged with: angularjs
upvote count: 1
tagged with: sockets
favorite count: 0
tagged with: peerjs
downvote count: 0
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45057526
accepted answer: http://stackoverflow.com/a/28356187
has body: I have the following code snippet var peer = {}; var foo = function ($scope, socket) { // socket is a factory to wrap socket.io in angular socket.on('setUID', function (data) { peer = new Peer(data); }); }; var bar = function ($scope, socket) { peer.on('connect', function () { alert("blah"); }); // this line doesn't work } // foo and bar are both controllers in angular, which are attached to separate areas in the application Essentially, what I am trying to do is create a new PeerJS peer using a server-generated ID which is transmitted using socket.io as soon as the client connects. As such, I know that the peer object will be created before the on listener is triggered. However, I don't think javascript knows that. How can I set it up so that I can use the future functions of the peer in my controllers? EDIT: Here is what I have at the moment app.factory('peer', function ($rootScope, socket) { var peer = {}; socket.on('setUID', function (data) { peer = new Peer(data, {host: 'localhost', port: 9000, path: "/peer/"}); console.log("Peer created"); peer.on('open', function (id) { // these work fine console.log('My peer ID is: ' + id); }); peer.on('connection', function (conn) { conn.on('open', function () { conn.on('data', function (data) { console.log("Received: " + data); }); }); }); }); return { getPeer: function () { return peer; } }; }); var bar = function ($scope, socket, peer) { var p = peer.getPeer(); p.on("connection", console.log("hello")); // works once, then says p.on is not a function }
score: 1
type: Question
has answer: http://stackoverflow.com/a/28356187
has title: Using functions of an object you know will be created in Javascript and Angular (featuring Peerjs and Socket.io)
answer count: 1

http://stackoverflow.com/comment/45171210
has text: As in you have an *array* of elements, not the element itself. You need to loop through and check each one.
score: 0
comment on: http://stackoverflow.com/q/28418992
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28314888
accepted answer of: http://stackoverflow.com/q/28314854
downvote count: 0
score: 3
has comment: http://stackoverflow.com/comment/44979494
has comment: http://stackoverflow.com/comment/44979470
has body: There are couple ways how you can solve it Use .call() to set this in your function: function fnSelectableDiv(){ $('.selectableDiv').removeClass('selected-div'); $(this).addClass('selected-div'); } $('.selectableDiv').click(function () { fnSelectableDiv.call(this); // set context for fnSelectableDiv. }); Pass the value of this as an argument to this function: function fnSelectableDiv(el){ $('.selectableDiv').removeClass('selected-div'); $(el).addClass('selected-div'); } $('.selectableDiv').click(function () { fnSelectableDiv(this); // pass this as argument });
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44979528
upvote count: 3
answers question: http://stackoverflow.com/q/28314854
has comment: http://stackoverflow.com/comment/44979453
type: Answer

http://stackoverflow.com/comment/45083505
type: Comment
type: QuestionComment
has text: I'm guessing that `[undefined x 10]` is just a representation in your console that says that you have an empty 10-sized array. In Firefox, it just says `Array [ <10 empty slots> ]`.
score: 3
comment on: http://stackoverflow.com/q/28371449

http://stackoverflow.com/a/28443217
has body: There are two approaches that should work for you. First, if you use a binding initializer to insert a converter, then you can define a variable in your binding context object that will, through the converter, do the resource lookup on demand. Second, if you use a rendering function rather than a declarative template, then you can do whatever you need in the code and use whatever other objects you need. The details of initializers/converters and template functions I've written up in Chapter 6 of my free ebook, Programming Windows Store Apps with HTML, CSS, and JavaScript, 2nd Edition.
type: Answer
answers question: http://stackoverflow.com/q/28415190
score: 0

http://stackoverflow.com/q/28401027
has answer: http://stackoverflow.com/a/28401077
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28401077
has comment: http://stackoverflow.com/comment/45137565
type: Question
type: AnsweredQuestion
has title: How JavaScript works facing with string numbers
score: 0
has body: I was wondering how JavaScript interpret the string numbers (i.e. "2"). for instance: var car = { color: "red", model: "370"}; var anotherAge = ++(car.model) + 2; or var b=+"1" + 2; // returns 3 How JavaScript really works when it use ++("370")? I am looking for the way JavaScript behaves. What happens beyond?
answer count: 1

http://stackoverflow.com/q/28395931
has answer: http://stackoverflow.com/a/28396056
has body: I am making a website, I want to change the content of the page on clicking certain sections. I have CSS, HTML, JS is seperate files. I am a noob. Using jquery I am getting an alert when I give the tag("*")to select all elements, but for the life of me I am not able to select a specific div. all divs are unique but I really don't why the query cannot select the particular divs. $('*').click(function() { alert("The paragraph was clicked."); }); ----> working but this is not $('#topbar').click(function(){ alert("The paragraph was clicked."); }); here is the entire code: dear C Dip Ranjan Chatterjee About Education Professional Exp. Portfolio Feel free to drop me a mail or message, if you need to get in touch with me. Also note i have CSS html and JS all in seperate files. In the JS file i am putting the jquery.
has comment: http://stackoverflow.com/comment/45127985
tagged with: javascript
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/28396025
tagged with: jquery
has comment: http://stackoverflow.com/comment/45128014
linked to: http://stackoverflow.com/q/14028959
has title: specfic element cannot be selected with jquery
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28396025
has comment: http://stackoverflow.com/comment/45127959
type: Question
possible better answer: http://stackoverflow.com/a/28396056

http://stackoverflow.com/q/28382221
has answer: http://stackoverflow.com/a/28382350
tagged with: codeigniter
has comment: http://stackoverflow.com/comment/45103200
type: Question
tagged with: javascript
tagged with: jquery
has title: Codeigniter: Change languages on the fly (AJAX)
score: 0
answer count: 1
type: UnansweredQuestion
has body: I am trying to work out how to change the languages on the fly using the Codeigniter Language System. So I made this ajax call which works but obviosly the values won't change until I reload the page unlease I somehow print out the values or set the variables in the function which is being called by AJAX ? What is the best way of doing this. &lt;script&gt; $(function(){ $('.lang-choices a').on('click' , function() { var language = $(this).attr("data-lang"); $.ajax({ type: "POST", url: js_site_url('langswitch/switchLanguage'), data: "requestedLanguage=" + language, cache: false, success: function(html){ }, error:function(exception){alert('Exeption:'+exception);} }); return false; }); }); &lt;/script&gt; switchLanguage Function public function switchLanguage() { $language = $this-&gt;input-&gt;post('requestedLanguage'); $this-&gt;session-&gt;set_userdata('site_lang', $language); }
tagged with: php

http://stackoverflow.com/comment/45171361
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28418782
has text: No. Like I wrote - I'm just wondering :-) I would stick with what is working for me.
type: Comment

http://stackoverflow.com/a/28392079
upvote count: 1
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/28392059
score: 1
has body: json["Key with spaces"] is another way to get a JSON key and it should work with spaces

http://stackoverflow.com/a/28295328
answers question: http://stackoverflow.com/q/28294401
upvote count: 1
type: Answer
has body: Hei guy, try this: $('#select').hover(function (){ // when mouse hover showSelect(); }, function (){ // when mouse out hideSelect(); });
downvote count: 0
score: 1

http://stackoverflow.com/comment/45194468
score: 0
type: Comment
type: QuestionComment
has text: I corrected the fiddle and updated the OP's question. Having said that, the code should exist in the question also.
comment on: http://stackoverflow.com/q/28432078

http://stackoverflow.com/comment/45316983
type: Comment
has text: Sorry for late response, was tied up in other stuff. And for ignoring first question at all :/ But great stuff, the object was "guessed" correctly and both your solutions (1 on this page, other via the "multiple objects demo") worked perfectly!! Great help and thanks!
type: AnswerComment
comment on: http://stackoverflow.com/a/28431143
score: 0

http://stackoverflow.com/comment/45109802
type: QuestionComment
comment on: http://stackoverflow.com/q/28386052
score: 0
type: Comment
has text: Show how you set `$scope.trip.location`?

http://stackoverflow.com/q/28434416
has comment: http://stackoverflow.com/comment/45199404
has title: AJAX form communication, displaying resulting messages - how to?
downvote count: 1
type: Question
tagged with: javascript
score: -1
upvote count: 0
answer count: 1
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28434648
has body: I'm new to the ajax scene and slowly getting the hang of it, sort of. I've built a fairly functional form, with exception to a few details which I'm getting ironed out. One of which is the reason to this question. I have a form which does successfully update via ajax to a mysql database by the process of html -> ajax -> php -> mysql. However currently there is absolutely no communication messages or indicators being returned from the php to the html, to indicate success or error. Being quite new to using ajax, some help is appreciated. Technologies in use: jQuery, JavaScript, html, php HTML form (a section of it, not the full form as that would be unnecessary): <form id="<?=$applicationKey?>" name="<?=$applicationKey?>" action="./post.<?=$appNo.'.'.$applicationKey?>.php" method="POST" enctype="multipart/form-data"> <input type="hidden" name="token" value="<?=$sessionToken?>"> <input type="hidden" name="uID" value="<?=$uID?>"> <input type="hidden" name="uaID" value="<?=$uaID?>"> <input type="hidden" name="appID" value="<?=$appID?>"> Name of the Applicant's Organisation: <input type="text" id="input_1_1" name="input_1_1" placeholder="Name of the Applicant's Organisation" maxlength="64" value="<?=$input_1_1?>" required> Contact Person: <input type="text" id="input_1_2" name="input_1_2" placeholder="Contact Person" maxlength="64" value="<?=$input_1_2?>" required> Telephone (Landline): <input type="text" id="input_1_3" name="input_1_3" placeholder="Telephone (Landline)" maxlength="22" value="<?=$input_1_3?>" required> Telephone (Mobile): <input type="text" id="input_1_4" name="input_1_4" placeholder="Telephone (Mobile)" maxlength="22" value="<?=$input_1_4?>" required> Email: <input type="text" id="input_1_5" name="input_1_5" placeholder="Email" maxlength="64" value="<?=$input_1_5?>" required> Fax: <input type="text" id="input_1_6" name="input_1_6" placeholder="Fax" maxlength="22" value="<?=$input_1_6?>" required> Address: <?=$input_1_7?> The included js file looks like t…
has comment: http://stackoverflow.com/comment/45199260
tagged with: php
accepted answer: http://stackoverflow.com/a/28434648
has comment: http://stackoverflow.com/comment/45199180
type: AnsweredQuestion

http://stackoverflow.com/comment/45151389
has text: Thanks NullPointer! It works perfectly.
type: Comment
comment on: http://stackoverflow.com/a/28408599
type: AnswerComment
score: 0

http://stackoverflow.com/q/28355558
score: -1
downvote count: 1
has comment: http://stackoverflow.com/comment/45054668
has title: Javascript if else issue
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28355742
has body: I have a div that I want to change color based on the int value in the div, but for some reason it doesn't change the color based on the if else statement I wrote. Instead no color appears. Why is that? 66 JAVASCRIPT var testDiv = document.getElementById("test"); if (testDiv<50) { testDiv.style.backgroundColor = '#900000'; } else if (testDiv > 49 && testDiv < 75) { testDiv.style.backgroundColor = '#FF9933'; } else if (testDiv > 74) { testDiv.style.backgroundColor = '#00CC00'; }
has comment: http://stackoverflow.com/comment/45054632
answer count: 3
type: AnsweredQuestion
upvote count: 0
possible better answer: http://stackoverflow.com/a/28355584
favorite count: 0
has answer: http://stackoverflow.com/a/28355584
type: Question
has answer: http://stackoverflow.com/a/28355666
has answer: http://stackoverflow.com/a/28355742

http://stackoverflow.com/a/28366181
type: Answer
answers question: http://stackoverflow.com/q/28365839
has comment: http://stackoverflow.com/comment/45097686
accepted answer of: http://stackoverflow.com/q/28365839
score: 80
has body: This much is possible with CSS and is pretty simple when using multiple backgrounds and changing their positions using animations. .border { height: 100px; width: 200px; background: linear-gradient(90deg, blue 50%, transparent 50%), linear-gradient(90deg, blue 50%, transparent 50%), linear-gradient(0deg, blue 50%, transparent 50%), linear-gradient(0deg, blue 50%, transparent 50%); background-repeat: repeat-x, repeat-x, repeat-y, repeat-y; background-size: 16px 4px, 16px 4px, 4px 16px, 4px 16px; background-position: 0px 0px, 212px 116px, 0px 116px, 216px 0px; padding: 10px; transition: background-position 2s; } .border:hover{ background-position: 212px 0px, 0px 116px, 0px 0px, 216px 116px; } Some text Here is a sample with continuous movement of the borders right from the page load. .border { height: 100px; width: 200px; background: linear-gradient(90deg, blue 50%, transparent 50%), linear-gradient(90deg, blue 50%, transparent 50%), linear-gradient(0deg, blue 50%, transparent 50%), linear-gradient(0deg, blue 50%, transparent 50%); background-repeat: repeat-x, repeat-x, repeat-y, repeat-y; background-size: 15px 4px, 15px 4px, 4px 15px, 4px 15px; background-position: 0px 0px, 200px 100px, 0px 100px, 200px 0px; padding: 10px; animation: border-dance 4s infinite linear; } @keyframes border-dance { 0% { background-position: 0px 0px, 300px 116px, 0px 150px, 216px 0px; } 100% { background-position: 300px 0px, 0px 116px, 0px 0px, 216px 150px; } } Some text Credits to web-tiki for helping to fix the slight distortion that was originally present at the end of each loop of the animation.
upvote count: 80
has comment: http://stackoverflow.com/comment/45076668
has comment: http://stackoverflow.com/comment/104359302
has comment: http://stackoverflow.com/comment/45075169
has comment: http://stackoverflow.com/comment/45073762
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45075174
has comment: http://stackoverflow.com/comment/77233034
has comment: http://stackoverflow.com/comment/77225367

prototype
tags question: http://stackoverflow.com/q/28345835
tags question: http://stackoverflow.com/q/28365709
tags question: http://stackoverflow.com/q/28357662
tags question: http://stackoverflow.com/q/28413935
tags question: http://stackoverflow.com/q/28388957
tags question: http://stackoverflow.com/q/28366219
tags question: http://stackoverflow.com/q/28372267
tags question: http://stackoverflow.com/q/28316599
tags question: http://stackoverflow.com/q/28305480
tags question: http://stackoverflow.com/q/28421089
tags question: http://stackoverflow.com/q/28363558
tag name: prototype
tags question: http://stackoverflow.com/q/28383370
tags question: http://stackoverflow.com/q/28378226
tags question: http://stackoverflow.com/q/28392475
tags question: http://stackoverflow.com/q/28386384
tags question: http://stackoverflow.com/q/28287894
tags question: http://stackoverflow.com/q/28401255
type: Tag
tags question: http://stackoverflow.com/q/28400995
tags question: http://stackoverflow.com/q/28417716
tags question: http://stackoverflow.com/q/28338412
tags question: http://stackoverflow.com/q/28389849
tags question: http://stackoverflow.com/q/28380846
tags question: http://stackoverflow.com/q/28356415

http://stackoverflow.com/a/28314627
has comment: http://stackoverflow.com/comment/44978983
upvote count: 0
has body: Please go to the Debugger tab in Developer tools. Hit Ctrl+O and type your file name. Alternately, you can click the Folder icon and search for your file.
has comment: http://stackoverflow.com/comment/44979504
downvote count: 3
has comment: http://stackoverflow.com/comment/44979142
has comment: http://stackoverflow.com/comment/44979322
has comment: http://stackoverflow.com/comment/44979299
answers question: http://stackoverflow.com/q/28314586
score: -3
type: Answer

http://stackoverflow.com/comment/44948780
has text: You are not adding a marker at all + you are using undocumented methods + you didn't put any effort in finding how to do what you want.
comment on: http://stackoverflow.com/q/28298449
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45161431
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28408657
has text: Uncaught TypeError: myUniqueTime is not a function getRandomUrl (anonymous function)
score: 0

http://stackoverflow.com/a/28337190
type: AcceptedAnswer
has body: As TGH mentions, you should cache any repeated queries. In your code, there are three main queries we care about: the individual press release ($(this)), the first paragraph, and the rest of the paragraphs. $(document).ready(function(){ $(".press_release").each(function(){ var $this = $(this), $paragraphs = $this.children("p"), $firstParagraph = $paragraphs.first(); // Remove the first paragraph from our set $paragraphs = $paragraphs.not($firstParagraph); // We're only counting paragraphs after the first if($paragraphs.length &gt; 0){ $('&lt;div&gt;&lt;a href="#readmore" class="readmore"&gt;Read More&amp;hellip;&lt;/a&gt;&lt;/div&gt;').appendTo($this); $firstParagraph.addClass('first-p'); $paragraphs.hide(); // Delay the lookup of .readmore now; gain a slight benefit here at the // expense of a tiny cost each time something inside $this is clicked. // Binding directly to the .readmore element as you've done in your // original code likely won't have any noticeable impact either way. $this.on('click', '.readmore', function (){ $paragraphs.slideToggle(500); return false; }); } }); });
type: Answer
accepted answer of: http://stackoverflow.com/q/28336810
answers question: http://stackoverflow.com/q/28336810
score: 0
has comment: http://stackoverflow.com/comment/45021444

http://stackoverflow.com/comment/44952051
has text: To elaborate on what @epascarello said, javascript is not able to reach the MemoryStream because that exists on the server's memory. Why do you not want to use JSON or XML? That's gonna be about the only way to do it. Even if you could output the memory stream, the way C# represents that object in memory is different than how JS does, so JS wouldn't know how to deserialize it
score: 0
comment on: http://stackoverflow.com/q/28300171
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45201481
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28417766
has text: When you're using javascript stuff like this, everything has to be asynchronous. So instead of waiting for the async to be complete before returning, you should return a promise for completion. Then, in the calling function, instead of assuming that the function is done when it is called (it isn't, since async), take the returned promise and chain a .then(function()) on to it. Put the stuff that relies on the earlier work being completed in the then() block, and if there's more async, return a promise out of that then block and chain another then().
score: 0

http://stackoverflow.com/q/28400602
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45153237
has comment: http://stackoverflow.com/comment/45154207
tagged with: bower
has body: I'm new to angular and ng-grid, I am calling a simple static json file but the grid is not showing at all, the message I'm getting is: Cannot set property 'grid' of undefined Can anyone help? My code looks like this angular.module('healthyLivingApp') .controller('SubscribersCtrl', function ($scope,$http) { $http.get('http://localhost:9000/subscribers.json').success(function(data){ $scope.subscribers = data; }); $scope.gridOptions = { data:'subscribers' } }); app.js .module('healthyLivingApp', [ 'ngAnimate', 'ngResource', 'ngRoute', 'ngSanitize', 'ngTouch', 'ngGrid', 'ui.bootstrap' ]) HTML Subscribers I'm using bower, Angular "1.3.12", ng-grid " "2.0.14"", jQuery " 2.1.3"
type: Question
answer count: 2
linked to: http://stackoverflow.com/q/24082380
tagged with: javascript
tagged with: ng-grid
has answer: http://stackoverflow.com/a/28402235
has answer: http://stackoverflow.com/a/28402194
score: 0
has comment: http://stackoverflow.com/comment/45153276
has title: Cannot set property 'grid' of undefined
has comment: http://stackoverflow.com/comment/45138563
tagged with: angularjs

http://stackoverflow.com/comment/45073534
type: AnswerComment
has text: @jbutler483 totally agree, is a proof of concept
type: Comment
comment on: http://stackoverflow.com/a/28366239
score: 0

http://stackoverflow.com/q/28371732
has body: I'm building an Angular App and also using angular translate as it needs to be in dual languages. I've seem to have created my JSON properly (ran it through a checker), but when I try to access items within the JSON object beyond the first level, it returns undefined. For instance, my JSON within the angular translations is this: $translateProvider.translations('en', { "SEARCH": { "SEARCH" : "Recherce", "ABILITY" : "Abilities", "MANAGEMENT" : "Management Competencies", "PERSONAL" : "Personal Suitability" }, "ABILITIES": { "TITLE" : "Test Title here", "ADVISORY": { "TITLE" : "Advisory Skills", "QUESTIONS": [ { "TYPE" : "A", "LEVEL" : "45", "DESCRIPTION" : "Can you tell me how awesome you are" }, { "TYPE" : "B", "LEVEL" : "100", "DESCRIPTION" : "Tell me about your wicked project" } ] } }, "HEADLINE": "Oh No!", "SUB_HEADLINE": "Looks like you are not amazing" }); And to begin accessing the data in the JSON object, I do list = $translateProvider.translations('en'); Now, when outputting items in the console to see if they work I do this: console.log(list); var getTitle = list.HEADLINE; var getSearch = list.SEARCH.ABILITY; console.log(getSearch); console.log(getTitle); This is where it gets odd. The 'list' returns the JSON array I specified Getting the HEADLINE returns Oh No! But getting list.SEARCH.ABILITY returns an undefined What gives!? I haven't event tried to access the stuff I really want in the really nested array "ABILITIES" Keep in mind that Angular Translate uses the format {{ 'ABILITIES.ADVISORY.TITLE' | translate }} to output the JSON onto the HTML page
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45084562
type: Question
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28371864
favorite count: 0
has comment: http://stackoverflow.com/comment/127328131
upvote count: 3
has comment: http://stackoverflow.com/comment/45084241
has title: Accessing nested JSON objects
downvote count: 0
tagged with: angularjs
type: UnansweredQuestion
score: 3

http://stackoverflow.com/comment/44989754
comment on: http://stackoverflow.com/q/28319813
score: 0
has text: @Mohit, but how could we know when user completes the selection and after that to make ajax call?
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28351299
has comment: http://stackoverflow.com/comment/45050855
has comment: http://stackoverflow.com/comment/45162666
has comment: http://stackoverflow.com/comment/45050539
answers question: http://stackoverflow.com/q/28351074
has comment: http://stackoverflow.com/comment/45165143
has comment: http://stackoverflow.com/comment/45048955
has comment: http://stackoverflow.com/comment/45160325
has comment: http://stackoverflow.com/comment/45051430
downvote count: 0
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/45049660
has comment: http://stackoverflow.com/comment/45075875
has comment: http://stackoverflow.com/comment/45051500
has comment: http://stackoverflow.com/comment/45328561
has comment: http://stackoverflow.com/comment/45051023
score: 1
has body: Your Javascript is in a separate file? In that case, tags in the form &lt;%=something%&gt; in your Javascript are not going to be replaced by the actual values you want. That only works if your Javascript is inline, part of the page. This is because the &lt;% %&gt; tags are interpreted by the ASP.NET compiler on the web server before it sends the web page to your browser. The tags are replaced by the actual evaluated values, as you know. The external Javascript file is never processed by the web server: it is pulled in by the browser when it interprets the processed page.
has comment: http://stackoverflow.com/comment/45164568
has comment: http://stackoverflow.com/comment/45337653

http://stackoverflow.com/comment/45140511
comment on: http://stackoverflow.com/a/28384135
has text: The entire repository.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28345296
has body: I have a form &lt;form action="GET" id="form"&gt; .... &lt;input type="text" name="a" value="aaa"&gt; &lt;input type="text" name="b" value="bbb"&gt; &lt;input type="text" name="c" value="ccc"&gt; &lt;button ... value="go" id="submit"&gt; .... is it possible that I can prevent the input name="b" not to be join in the .submit() ? the whole input &lt;input type="text" name="b" value="bbb"&gt; not to be submitted? $('#submit').click(function(){ $('#form').submit(); });
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45036891
score: 0
has answer: http://stackoverflow.com/a/28345381
has answer: http://stackoverflow.com/a/28345372
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28345381
has comment: http://stackoverflow.com/comment/45034909
accepted answer: http://stackoverflow.com/a/28345372
tagged with: forms
type: Question
answer count: 2
has title: JQuery: How to not join specific field in .submit
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/28350862
answers question: http://stackoverflow.com/q/28349155
score: 0
type: AcceptedAnswer
has body: then you will need to have a static property or store it in a Session variable because if your are doing postbacks on the page load the public string variable would be overwritten and set to string.Empty on every page load.. I would personally initialize a HttpContext.Current.Session["Target"] = string.Empty in the Global.asax page in the OnSessionStart() method and then assign it and from there you can access it application wide.. does that make sense..? :)
type: Answer
accepted answer of: http://stackoverflow.com/q/28349155

http://stackoverflow.com/comment/45093660
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28376724
has text: An `each` and a `push` to a new empty array is almost always a `map` - both in native JS and with lodash.
score: 1

http://stackoverflow.com/a/28425077
has comment: http://stackoverflow.com/comment/45182774
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/45183712
has comment: http://stackoverflow.com/comment/45182802
has comment: http://stackoverflow.com/comment/45182989
has comment: http://stackoverflow.com/comment/45184380
has body: Correct your code like below out.write("alert('Hello+" + name + "')");
has comment: http://stackoverflow.com/comment/45182729
downvote count: 0
has comment: http://stackoverflow.com/comment/45182617
type: Answer
answers question: http://stackoverflow.com/q/28425036

http://stackoverflow.com/q/28333694
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28334115
has body: Using the following code: Select an option Option 1 Option 2 I am taking the value of this option element and append it as a query string to be an authorization code to a data attribute containing a service (which will be different URLs depending on whether on staging or production) in an element: URL1 Stylized service data here to be refreshed with new authorization code append I need to use jQuery to append a new query string and value to this url so that it looks like URL2 New stylized service data refreshed because of new auth code If an auth_code already exists when user selects new option value, it needs to then replace it with a new value: URL3 New stylized service data refreshed because of new auth code Changing this auth_code value will then expose new data from the service.
upvote count: 1
tagged with: query-string
favorite count: 0
has title: Appending and replacing the query string value of a data-* attribute URL
downvote count: 0
possible better answer: http://stackoverflow.com/a/28334115
type: AnsweredQuestion
score: 1
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/28333721
accepted answer: http://stackoverflow.com/a/28333721
type: Question

http://stackoverflow.com/comment/45155324
has text: http.get is working asynchronously. You are logging results before they are received.
comment on: http://stackoverflow.com/q/28410884
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/q/28321804
tagged with: javascript
has body: I have the following JavaScript object: { date : 'some date', name : 'some name' } I have 10 of these objects, half will have one value for name - tableA. And the other half will have a different value for name - tableB. I want to break these objects down into different tables depending on the value of name, I won't know the name value of my object. So for the 5 objects in the tableA table: tableA --------------- date : 'some date' date : 'some date' date : 'some date' date : 'some date' date : 'some date' And tableB tableB --------------- date : 'some date' date : 'some date' date : 'some date' date : 'some date' date : 'some date' I'll use jQuery to render all this. I'm assuming I'll need something like jQuery.each(objects, function(index, object) { //build my table } I'm just not sure of the logic needed to accomplish what I want. Not the actual code to build my HTML, but the logic required to break my object into different 'groups'. I hope that makes sense. Any advice or suggestions would be greatly appreciated.
accepted answer: http://stackoverflow.com/a/28322979
score: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/28322010
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28322979
has answer: http://stackoverflow.com/a/28322232
possible better answer: http://stackoverflow.com/a/28322010
has title: Sort JS objects by value
has answer: http://stackoverflow.com/a/28322140
type: Question

http://stackoverflow.com/comment/45046133
type: Comment
type: QuestionComment
has text: @user95227, I suggest then you edit the question and put the input data structure, desired output structure (you already have that, but pls use 0-based index), and code that doesn't work. Also, remove unrelated tags, like AngularJs
comment on: http://stackoverflow.com/q/28349611
score: 0

http://stackoverflow.com/a/28388816
answers question: http://stackoverflow.com/q/28388780
type: Answer
downvote count: 0
has body: $("#currentYear").text(thisYear);
score: 3
has comment: http://stackoverflow.com/comment/45115172
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28388780
upvote count: 3

http://stackoverflow.com/comment/45091474
has text: What version of Node.js are you running? This reminds me of a bug that got fixed.
comment on: http://stackoverflow.com/q/28375557
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44970415
type: Comment
has text: Works fine now. removed it.
comment on: http://stackoverflow.com/a/28308474
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45124246
comment on: http://stackoverflow.com/a/28393255
has text: Thanks, very nice work-around for the [nested anchor tages](http://stackoverflow.com/questions/13052598/creating-anchor-tag-inside-anchor-tag)-problem. --- However, regarding the unifying: even though the link of `Word 1` and `Word 3` are unified in code, this is not reflected **visually to the end-user** yet (which could be done by collectively changing from no-underline to underline on hover). --- Or to be more precise: you have all the same reflected that by changing the colors, but instead it could be good for lay-out coherency, to have the same color for all hyperlinks in a document.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44930865
score: 0
comment on: http://stackoverflow.com/q/28288529
type: Comment
type: QuestionComment
has text: Need your code to modify it !

http://stackoverflow.com/comment/45018322
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28335912
score: 0
has text: What does your code look like?

http://stackoverflow.com/comment/45124884
type: QuestionComment
has text: Do you absolutely need to load css async?
score: 0
comment on: http://stackoverflow.com/q/28394097
type: Comment

http://stackoverflow.com/comment/45050152
type: AnswerComment
comment on: http://stackoverflow.com/a/28353153
type: Comment
score: 1
has text: Thank you for explaining and not just dumping code. That helps people to learn rather than just providing completed code without explanation to blindly meet some goal.

http://stackoverflow.com/comment/45222708
type: QuestionComment
comment on: http://stackoverflow.com/q/28408173
has text: @KYOUMAH: I have send u the mail
score: 0
type: Comment

http://stackoverflow.com/q/28402853
has comment: http://stackoverflow.com/comment/45141058
possible better answer: http://stackoverflow.com/a/28402993
has comment: http://stackoverflow.com/comment/45140855
has answer: http://stackoverflow.com/a/28402993
has answer: http://stackoverflow.com/a/28403008
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45140952
has comment: http://stackoverflow.com/comment/45140927
has body: I am new in Angular.js, I am watching pluralsight Angular tutorial, I did what the teacher told on that videos: {{helloMessage}} The h1 should be Hello World! but it is {{helloMessage}} I am using Latest version of Firefox on windows8 with latest version of Angular
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28403100
has title: an Easy Angular code not working
has answer: http://stackoverflow.com/a/28403013
type: Question
has comment: http://stackoverflow.com/comment/45140972
has comment: http://stackoverflow.com/comment/45140851
tagged with: javascript
has comment: http://stackoverflow.com/comment/45141128
has comment: http://stackoverflow.com/comment/45140845
accepted answer: http://stackoverflow.com/a/28403100
score: 0

http://stackoverflow.com/a/28416703
upvote count: 4
has body: I don't know if my solution is the most pretty, but I put in my index.html a definition of a CONFIG that I reference from other components. I generate my index.html with server side code so I can set the values when the program starts. That is, I use index.cshtml but it just as easily be index.php or other technology. Here is what my index.html looks like: .... &lt;script type="text/javascript"&gt; var usingMockDataGlobal = true; &lt;/script&gt; .... &lt;script type="text/javascript"&gt; (function () { 'use strict'; var configData = { codeCampType: 'angu', loggedInUsername: 'peter', mockData: usingMockDataGlobal }; angular.module('baseApp').constant('CONFIG', configData); })(); &lt;/script&gt;
score: 3
answers question: http://stackoverflow.com/q/28416054
downvote count: 1
type: Answer

http://stackoverflow.com/comment/45094711
comment on: http://stackoverflow.com/q/28377096
has text: What's the problem with `b = function(){ return a(); }` then? You do get a reference copy indirectly (changes to `a()` will be reflected in `b()`.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45125227
has text: SO how to do the GET? as I am not posting. What would be the contentType?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28394332

http://stackoverflow.com/comment/45003993
score: 0
type: AnswerComment
type: Comment
has text: This also works. It looks a little cleaner in the html honestly, is there any significant performance difference between this and answer and the one RoyTheBoy provided?
comment on: http://stackoverflow.com/a/28327457

http://stackoverflow.com/comment/45010065
type: QuestionComment
comment on: http://stackoverflow.com/q/28311155
score: 0
type: Comment
has text: I agree. .product should work. But it doesn't. That's why I think this may be an Apple bug. I get the same result matching via the attribute matcher [class~=product]. As before it works in the full Safari browser but not within a WKUserScript. The only matcher I've been able to get to work in the WKUserScript has been the full class declaration with all three classes.

http://stackoverflow.com/comment/45061604
type: QuestionComment
type: Comment
has text: I replace `span` with `a` it doesn't work anymore
score: 0
comment on: http://stackoverflow.com/q/28344075

http://stackoverflow.com/comment/44982509
type: Comment
type: QuestionComment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/70195/discussion-between-mrso-and-milind-anantwar).
comment on: http://stackoverflow.com/q/28316334
score: 0

http://stackoverflow.com/a/28413485
type: Answer
has body: Not sure I'm 100% understanding your end result, but are you wanting the side by side div's backgrounds to change when clicked? If so, is this what you want? http://jsfiddle.net/u1uostrc/ I just added id's to both of the divs that show the actual images, and set onclicks for them, along with counters for each. var img1Counter = 0; var img2Counter = 1; img1.onclick = function() { if (img1Counter == 0) { document.getElementById("img1").style.backgroundImage = "url('http://upload.wikimedia.org/wikipedia/commons/thumb/8/88/Number_1_in_green_rounded_square.svg/2000px-Number_1_in_green_rounded_square.svg.png')"; img1Counter++; } else if(img1Counter == 1) { document.getElementById("img1").style.backgroundImage = "url(http://tomreynolds.com/wp/wp-content/uploads/2014/01/2-graphic.png)"; img1Counter++; } else if(img1Counter == 2) { document.getElementById("img1").style.backgroundImage = "url(http://upload.wikimedia.org/wikipedia/commons/6/69/VET_3_circle.png)"; img1Counter = 0; } } img2.onclick = function() { if (img2Counter == 0) { document.getElementById("img2").style.backgroundImage = "url('http://upload.wikimedia.org/wikipedia/commons/thumb/8/88/Number_1_in_green_rounded_square.svg/2000px-Number_1_in_green_rounded_square.svg.png')"; img2Counter++; } else if(img2Counter == 1) { document.getElementById("img2").style.backgroundImage = "url(http://tomreynolds.com/wp/wp-content/uploads/2014/01/2-graphic.png)"; img2Counter++; } else if(img2Counter == 2) { document.getElementById("img2").style.backgroundImage = "url(http://upload.wikimedia.org/wikipedia/commons/6/69/VET_3_circle.png)"; img2Counter = 0; } } Hope this helps...
accepted answer of: http://stackoverflow.com/q/28410727
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28410727

http://stackoverflow.com/a/56819024
score: 0
type: Answer
has body: In the first case you have one operation Array(3) Its creates an array with three empty slots. Not an array with the three undefined values but exactly - empty. At the second case Array.apply(null, Array(3) ) we can spread it to the three operations: first: Array(3) - you get an array with 3 empty slots; second: Array(3) spreads by Function.prototype.apply() function to 3 parameters that it passes to Array() function. At this stage 3 empty slots in given array transformes by apply() to 3 undefined values (it looks like if apply() sees an empty slot it automaticaly turns it to undefined in any sparsed array). third: we get an Array(undefined, undefined, undefined). And that will do to us an array with 3 undefined (not empty) values. Because now you have 3 undefined but not empty slots, you can use them with map() function. Note that not only Function.prototype.apply() have such behavior of decomposing arrays by such way. You can also do this in ECMAScript 6 by "..." - spread operator. Array(...new Array(3)); This will also returns an array with 3 undefined and respectively can be mapped slots. Here i giving more detailed explanation. https://stackoverflow.com/a/56814230/11715665
answers question: http://stackoverflow.com/q/28416547

http://stackoverflow.com/a/34670529
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28408720
has body: without jquery works var draggable = document.getElementById('draggable'), test = document.getElementById('test'); document.addEventListener("dragend", function(event) { // reset the transparency console.log('dragend'); }, false); draggable.addEventListener('dragstart', function(event) { test.style.color = 'red'; draggable.style.backgroundColor = 'gray'; }, false); http://jsfiddle.net/nwkv75ot/4/

http://stackoverflow.com/comment/45183947
score: 0
type: Comment
type: QuestionComment
has text: How about the largest Date, not the smallest?
comment on: http://stackoverflow.com/q/28425884

http://stackoverflow.com/comment/45124498
type: Comment
has text: @GreenBird although my older answer http://stackoverflow.com/a/27034623/6309 is about POST.
comment on: http://stackoverflow.com/a/28391773
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44959832
has text: @Chad I can do it but the problem mentioned above is not due to plugin.js and script.js being as seperate files. my problem is to load css in instead of placing it in which causes render blocking and make sure that both plugin.js and script.js execute after plugin.css is loaded
type: QuestionComment
comment on: http://stackoverflow.com/q/28304220
score: 0
type: Comment

http://stackoverflow.com/comment/45014440
type: AnswerComment
score: 0
has text: I guess I should also include that we're using a staging and production service URL so the URLs will vary depending on where you are. So I don't know if I can hardcode the URL into the variable of the function.
type: Comment
comment on: http://stackoverflow.com/a/28333721

http://stackoverflow.com/comment/44964661
has text: Why have you converted JavaScript variables to PHP variables? That will not work.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28306831

http://stackoverflow.com/comment/45020590
type: Comment
type: QuestionComment
has text: I placed it as ` if (qans.length < 5) { alert('Missing selection'); return; } alert(qans+'.html'); // for testing purposes only if (q5 == '0'){ alert('something'); return; } ` and a couple other places but I don't get it right. It still returns a YYYN.html etc. I have no idea where exactly it should go.
comment on: http://stackoverflow.com/q/28337134
score: 0

http://stackoverflow.com/comment/45137671
type: Comment
has text: Thanks for the help, I will surely try this one.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28379908

http://stackoverflow.com/a/28432108
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28429069
type: Answer
answers question: http://stackoverflow.com/q/28429069
has body: set pointer-events="none" in the css to stop interaction. Or use the z-axis
upvote count: 2
score: 2

http://stackoverflow.com/q/28399855
has answer: http://stackoverflow.com/a/28399919
has title: Console says cannot find a variable
tagged with: d3.js
has body: I declared a variable circles but somehow it's not being accessed here (near the bottom of the file) circles.filter(function(d, i){ return d.species == species }) My console says it can't find variable: circles. I'm a total novice to d3.js &amp; javascript so any help is much appreciated! http://jsfiddle.net/flyingburrito/gacbucyo/9/
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28399891
type: Question
answer count: 2
tagged with: javascript
score: 0
possible better answer: http://stackoverflow.com/a/28399919
has answer: http://stackoverflow.com/a/28399891

http://stackoverflow.com/a/28372320
downvote count: 0
has comment: http://stackoverflow.com/comment/45085426
score: 5
type: AcceptedAnswer
has body: You should be able to do this without involving the window object. Here's a full example: Hello World Click me Example on jsbin
answers question: http://stackoverflow.com/q/28356217
upvote count: 5
has comment: http://stackoverflow.com/comment/45100096
type: Answer
accepted answer of: http://stackoverflow.com/q/28356217
has comment: http://stackoverflow.com/comment/45098109

http://stackoverflow.com/q/28284754
type: AnsweredQuestion
has body: I had drawn some circles on a html canvas my codes looks like this: Html: WebTunings Fill: Circle Javascript: var canvas, context, dragging = false, dragStartLocation, snapshot; function getCanvasCoordinates(event) { var x = event.clientX - canvas.getBoundingClientRect().left, y = event.clientY - canvas.getBoundingClientRect().top; return {x: x, y: y}; } function takeSnapshot() { snapshot = context.getImageData(0, 0, canvas.width, canvas.height); } function restoreSnapshot() { context.putImageData(snapshot, 0, 0); } function drawCircle(position) { var radius = Math.sqrt(Math.pow((dragStartLocation.x - position.x), 2) + Math.pow((dragStartLocation.y - position.y), 2)); context.beginPath(); context.arc(dragStartLocation.x, dragStartLocation.y, radius, 0, 2 * Math.PI, false); context.fillStyle = getRndColor(); } function draw(position) { var fillBox = document.getElementById("fillBox"), shape = document.querySelector('input[type="radio"][name="shape"]:checked').value; if (shape === "circle") { drawCircle(position); } if (fillBox.checked) { context.fill(); } else { context.stroke(); } } function dragStart(event) { dragging = true; dragStartLocation = getCanvasCoordinates(event); takeSnapshot(); } function drag(event) { var position; if (dragging === true) { restoreSnapshot(); position = getCanvasCoordinates(event); draw(position, "polygon"); } } function dragStop(event) { dragging = false; restoreSnapshot(); var position = getCanvasCoordinates(event); draw(position, "polygon"); } function getRndColor() { var r = 255*Math.random()|0, g = 255*Math.random()|0, b = 255*Math.random()|0; return 'rgb(' + r + ',' + g + ',' + b + ')'; } function eraseCanvas(){ context.clearRect(0, 0, canvas.width, canvas.height); } function init() { canvas = document.getElementById("canvas"); context = canvas.getContext('2d'); context.strokeStyle = 'green'; context.lineWidth = 4; context.lineCap = 'round'; clearCanvas = document.getElementById("clearCanvas"); canvas.addEventListener('mousedown',…
accepted answer: http://stackoverflow.com/a/28285879
has title: Dragging Shapes using mouse after creating them with html5 canvas
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44924012
score: 5
tagged with: canvas
upvote count: 6
tagged with: javascript
has answer: http://stackoverflow.com/a/28285879
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/44924592

http://stackoverflow.com/comment/45155148
has text: @Teemu What do you mean "not directly via window"? `var global = 'bar'; (function localScope(){ console.log("i'm global: " + global) })();` - here i has defined global variable `ns` (as in code above) and has got access to it in local scope.
comment on: http://stackoverflow.com/a/28410595
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44957446
type: AnswerComment
comment on: http://stackoverflow.com/a/28291220
type: Comment
has text: Aren't there another way?
score: 0

http://stackoverflow.com/comment/74281689
comment on: http://stackoverflow.com/a/32948800
type: AnswerComment
score: 0
has text: If you need to have different instanced data, just use scope: {} and create an isolated scope, then use the scope object to store data. Otherwise, do what the OP does and pass in an extra param and store it as a map at the controller level.
type: Comment

http://stackoverflow.com/a/28380653
upvote count: 5
score: 5
downvote count: 0
answers question: http://stackoverflow.com/q/28380561
type: Answer
has body: Should work just fine. Here is a working example: index.js var module = require('./module.js'); module.myvar = 'Hello world'; module.test(); module.js module.exports = { test: function() { console.log('var is', this.myvar); } }; Keep in mind if you use this in a closure that the scope isn't any longer the module itself. So that could be your problem. Can you show me the part of the module code where you use this?

http://stackoverflow.com/comment/44968335
score: 0
type: AnswerComment
has text: To answer that I will need to understand the internal logic of the app which I don't, but as for this error, this is what's going on; This is the beggining of the function declaration(service.js): getSports: function(agent) { . You are calling it without giving a value like so(app.js) : AuthFactory.getCustomer(). So when this is evaluted(service.js): $http.get(CONSTANT_VARS.BACKEND_URL + '/lines/sports/' + agent) It tries to get http://localhost:1337/lines/sports/undefined because agent is undefined. It should equal something that makes sense to the app and rest server. Its probably some id.
comment on: http://stackoverflow.com/a/28307763
type: Comment

http://stackoverflow.com/comment/45202316
type: QuestionComment
has text: Peter Wagener I've updated the original question
score: 0
comment on: http://stackoverflow.com/q/28421915
type: Comment

http://stackoverflow.com/comment/45052614
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28354503
type: AnswerComment
has text: How do you not know what they are? can you give an example on jsfiddle or something?

http://stackoverflow.com/q/28398985
answer count: 1
has title: Rotating a drawn circle ind Javascript HTML5 Canvas
tagged with: javascript
has answer: http://stackoverflow.com/a/28421243
score: 0
has comment: http://stackoverflow.com/comment/45185355
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has body: i have a Canvas: function drawWindRose(){ var canvas = document.getElementById('windrose'); var bild = canvas.getContext('2d'); var frame = canvas.getContext('2d'); frame.fillStyle = "rgb(200,0,0)"; frame.fillRect (0, 0, 200, 200); bild.save(); bild.translate(100,100); bild.rotate((360-Compass)*Math.PI/180); bild.fillStyle = "rgb(0,0,0)"; bild.font = '8pt Arial'; bild.fillText('N', 102, 30); bild.fillText('E', 170, 110); bild.fillText('S', 92, 170); bild.fillText('W', 30, 96); bild.closePath() bild.strokeStyle= "rgb(0,0,0)"; // schwarz bild.beginPath(); bild.lineWidth = 2; bild.arc(100,100,95,0,Math.PI*2,true); bild.moveTo(105,100); bild.lineTo(195,100); bild.moveTo(100,105); bild.lineTo(100,195); bild.moveTo(95,100); bild.lineTo(5,100); bild.moveTo(100,95); bild.lineTo(100,5); bild.moveTo(105,100); bild.arc(100,100,5,0,Math.PI*2,true); bild.closePath() bild.stroke(); bild.beginPath(); bild.lineWidth = 5; if(Azimuth&gt;=0&amp;&amp;Distance&gt;=1) { bild.arc(100,100,85,0,Math.PI*2,true); bild.arc(100,100,85,0,(Azimuth-90)*(Math.PI/180),true); bild.lineTo(100,100); } if(Distance&lt;=1) { bild.arc(100,100,2,0,Math.PI*2,true); } bild.strokeStyle= "#00FF00";//green bild.stroke(); bild.translate(-100,-100); bild.restore(); }; &lt;canvas style="padding-left: 0; padding-right: 0; margin-left: auto; margin-right: auto; display: block;"id="windrose" width="200" height="200"&gt; Ihr Browser kann kein Canvas! &lt;/canvas&gt; Like u can see, i want to rotate the canvas. Its a kind of Compass for a FXOS-App. I know how to rotate an image, but i dont get it to work with this drawing. The "Compass" Variable is the Deviceorientation un Degrees. So if you point the device to east, the Compass must be rotated 90degrees to the left... Maybe some of you has got an idea. regards goerdy
tagged with: firefox-os
type: Question
tagged with: rotation
tagged with: canvas

http://stackoverflow.com/comment/45062055
comment on: http://stackoverflow.com/q/28359521
has text: multiple pages? Show cat is a single pages which sends data=yes/no
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28325325
type: Question
has title: Strange animation behavior
tagged with: javascript
tagged with: canvas
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44998480
score: 2
has body: So I wanted to code this animation which has an equilateral triangle with points A, B, and C. The objective is for A to move towards B, B to move towards C, and C to move towards A. It's supposed to kinda spiral inward until it closes up. I wrote this quick canvas program to do that, thinking it would take only a few minutes, but for some reason, it doesn't maintain its shape as an equilateral triangle. jsfiddle here: http://jsfiddle.net/k3d8fbfg/ function Point(x, y) { this.ycoord=y; this.xcoord=x; } function init(){ window.requestAnimationFrame(draw); } function getMagnitude(vx, vy) { return Math.sqrt(Math.pow(vx,2), Math.pow(vy,2)); } var isPaused=false; function pause() { isPaused=(!isPaused); } var triangleSize=500; var point1=new Point(100, 100); var point2=new Point(point1.xcoord+triangleSize, point1.ycoord); var point3=new Point(point1.xcoord+(triangleSize/2), point1.ycoord+(triangleSize*.866025404)); var count=0; function draw() { var canvas = document.getElementById("canvas"); var ctx=canvas.getContext('2d'); triangleSize-=1; count++; ctx.fillStyle="white"; // if(count%3==0) ctx.fillRect(0,0,canvas.width, canvas.height); ctx.beginPath(); ctx.moveTo(point1.xcoord, point1.ycoord); ctx.lineTo(point2.xcoord, point2.ycoord); ctx.lineTo(point3.xcoord, point3.ycoord); ctx.closePath(); ctx.stroke(); ctx.fillStyle="black"; ctx.fill(); if(!isPaused) { var point1p=new Point(0,0),point2p=new Point(0,0),point3p=new Point(0,0); var diffVector1=new Point(point2.xcoord-point1.xcoord,point2.ycoord-point1.ycoord); var r=getMagnitude(diffVector1.xcoord, diffVector1.ycoord); diffVector1.xcoord/=r; diffVector1.ycoord/=r; console.log(getMagnitude(diffVector1.xcoord, diffVector1.ycoord)+" "+r); var diffVector2=new Point(point3.xcoord-point2.xcoord,point3.ycoord-point2.ycoord); r=getMagnitude(diffVector2.xcoord, diffVector2.ycoord); diffVector2.xcoord/=r; diffVector2.ycoord/=r; console.log(getMagnitude(diffVector2.xcoord, diffVector2.ycoord)+" "+r); var diffVector3=new Point(poin…
answer count: 0
upvote count: 2

http://stackoverflow.com/comment/45039648
score: 1
type: QuestionComment
has text: There's no JSON here at all.
type: Comment
comment on: http://stackoverflow.com/q/28347669

http://stackoverflow.com/comment/45069280
comment on: http://stackoverflow.com/q/28362067
has text: I am not and which code would you like to see? HTML?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28299795
accepted answer: http://stackoverflow.com/a/36688247
favorite count: 0
has comment: http://stackoverflow.com/comment/44951256
tagged with: dart
tagged with: sockets
tagged with: node.js
type: AnsweredQuestion
upvote count: 2
score: 1
has title: Socket in node.js vs socket in Dart
has body: I've the below code working perfectly with Dart, interested to have similar one with NODE, using PURE NODE modules, as I'm interested to check the performance of my app in Dart if it was written in JavaScript in client and NODE in server. I do not want to use any third party package like socket.js or whatever. import 'dart:io'; void main() { HttpServer.bind(InternetAddress.ANY_IP_V4, 8080).then((HttpServer server) { print("HttpServer listening..."); server.listen((HttpRequest request) { if (WebSocketTransformer.isUpgradeRequest(request)){ WebSocketTransformer.upgrade(request).then(handleWebSocket); } else { print("Regular ${request.method} request for: ${request.uri.path}"); serveRequest(request); } }); }); } any thought how to write same code in NODE, using PURE NODE modules without any third party module/package?
downvote count: 1
has answer: http://stackoverflow.com/a/36688247
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/44951288
answer count: 1

http://stackoverflow.com/comment/45200799
has text: @Cerbrus Sorry i mean have the div set to display, use JS to hide the div.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28435262

http://stackoverflow.com/a/28283993
has body: You just need to mix examples you mentioned: Select filter and Input filter For example like this (Odd columns have 'select' filter and even columns have 'input' filter): Name Position Office Age Start date Salary Name Position Office Age Start date Salary Tiger Nixon System Architect Edinburgh 61 2011/04/25 $320,800 Garrett Winters Accountant Tokyo 63 2011/07/25 $170,750 Ashton Cox Junior Technical Author San Francisco 66 2009/01/12 $86,000 Cedric Kelly Senior Javascript Developer Edinburgh 22 2012/03/29 $433,060 Airi Satou Accountant Tokyo 33 2008/11/28 $162,700 Brielle Williamson Integration Specialist New York 61 2012/12/02 $372,000 Herrod Chandler Sales Assistant San Francisco 59 2012/08/06 $137,500 Rhona Davidson Integration Specialist Tokyo 55 2010/10/14 $327,900 Colleen Hurst Javascript Developer San Francisco 39 2009/09/15 $205,500 Sonya Frost Software Engineer Edinburgh 23 2008/12/13 $103,600 Jena Gaines Office Manager London 30 2008/12/19 $90,560 Quinn Flynn Support Lead Edinburgh 22 2013/03/03 $342,000 Charde Marshall Regional Director San Francisco 36 2008/10/16 $470,600 Haley Kennedy Senior Marketing Designer London 43 2012/12/18 $313,500 Tatyana Fitzpatrick Regional Director London 19 2010/03/17 $385,750 Michael Silva Marketing Designer London 66 2012/11/27 $198,500 Paul Byrd Chief Financial Officer (CFO) New York 64 2010/06/09 $725,000 Gloria Little Systems Administrator New York 59 2009/04/10 $237,500 Bradley Greer Software Engineer London 41 2012/10/13 $132,000 Dai Rios Personnel Lead Edinburgh 35 2012/09/26 $217,500 Jenette Caldwell Development Lead New York 30 2011/09/03 $345,000 Yuri Berry Chief Marketing Officer (CMO) New York 40 2009/06/25 $675,000 Caesar Vance Pre-Sales Support New York 21 2011/12/12 $106,450 Doris Wilder Sales Assistant Sidney 23 2010/09/20 $85,600 Angelica Ramos Chief Executive Officer (CEO) London 47 2009/10/09 $1,200,000 Gavin Joyce Developer Edinburgh 42 2010/12/22 $92,575 Jennifer Chang Regional Director Singapore 28 20…
has comment: http://stackoverflow.com/comment/44958735
type: Answer
accepted answer of: http://stackoverflow.com/q/28280528
score: 1
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44940971
answers question: http://stackoverflow.com/q/28280528
type: AcceptedAnswer

http://stackoverflow.com/q/28337512
tagged with: firefox
tagged with: jquery
has title: Why isn't this function loading on page load? Happens only in Firefox. Works in Chrome and Opera
has comment: http://stackoverflow.com/comment/45020798
duplicate of: http://stackoverflow.com/q/10069204
has comment: http://stackoverflow.com/comment/46376456
answer count: 0
has comment: http://stackoverflow.com/comment/45021312
linked to: http://stackoverflow.com/q/11996257
type: UnansweredQuestion
type: Question
has body: Here's the code: When I try to load the function myList() on page load Console shows "mylist entered" in Chrome, Opera but doesn't seem to work in Firefox. However the function myList() works(even in Firefox) from inside the keyup function which I have commented in the below code: List List
linked to: http://stackoverflow.com/q/10069204
tagged with: javascript
has comment: http://stackoverflow.com/comment/45021288
score: 0

http://stackoverflow.com/q/28377994
has title: Sidr with angularjs button ng-click not working
has body: I'm using Sidr mobile menu with Angularjs. I'm putting a search bar inside the mobile nav and the button works fine. The problem is when I'm combining the it with Angularjs, somehow the ng-click didn't return any response. I tried putting the button outside the mobile menu and it works fine. HTML: JS var app = angular.module('MyApp', ['ngRoute', 'slick', 'angularjs-dropdown-multiselect', 'infinite-scroll']); app.controller('mainController', function ($scope){ $scope.testClick = function() { console.log('click'); } }) I'm still new with AngularJS so maybe there's something wrong with how I call the function or how I structure the code. Any help is appreciated. Thank you very much
type: Question
tagged with: sidr
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28378044
tagged with: angularjs
type: UnansweredQuestion
tagged with: angularjs-ng-click

http://stackoverflow.com/comment/45131759
type: Comment
comment on: http://stackoverflow.com/a/28390216
score: 0
type: AnswerComment
has text: I updated the answer to give more of a demo... added a jsbin as well

http://stackoverflow.com/comment/45037908
has text: im a sad bear, whenever i use var gold = values.gold; or whaver value from the array it doesnt work, getting undefined... But the lazy alert(values.gold) works fine wtf?
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28346567

http://stackoverflow.com/q/28413209
has answer: http://stackoverflow.com/a/54482898
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45160133
tagged with: node.js
downvote count: 0
score: 1
type: Question
has body: I have been messing around with express js for a while now and I have come across something called body parser. According to my research body parser allows us to POST content form our HTTP request. My question that, is it absolutely necessary to use body parser when using express.js? If it is not necessary then what are the advantages of using it and if body parser is not used then what needs to be done to make sure that the content is POSTED? Thank you in advance.
tagged with: javascript
linked to: http://stackoverflow.com/q/4295782
tagged with: express
answer count: 2
has title: Body-parser in Express JS
has answer: http://stackoverflow.com/a/54464476
upvote count: 1
favorite count: 0
tagged with: body-parser

http://stackoverflow.com/q/28422035
tagged with: javascript
tagged with: jquery
has body: I'm trying to make the header of my bootstrap modal stay fixed at the top when a user scrolls down. (Same idea as a pinterest modal when scrolling down) I've included a jsfiddle here. My latest attempt with javascript is this: var $stick = $('#stickyHeader'); $('#myModal').scroll(function(){ var scrollTop = $(this).scrollTop(); if(scrollTop &gt;= $stick.offset().top){ $stick.css({'position':'fixed'}); } else{ $stick.css({'position':'relative'}); } }); I've also tried the affix class in bootstrap without any luck. Is this possible with my current logic or is there something I'm missing? Thanks, -Paul
score: 0
tagged with: sticky
tagged with: twitter-bootstrap
type: UnansweredQuestion
has title: sticky header for bootstrap modal?
has answer: http://stackoverflow.com/a/28422518
type: Question
tagged with: modal-dialog
answer count: 1

http://stackoverflow.com/comment/45142826
type: Comment
score: 2
comment on: http://stackoverflow.com/a/28404081
type: AnswerComment
has text: I think you have a typo: `"url+("` should be `"url("`.

http://stackoverflow.com/a/28294101
accepted answer of: http://stackoverflow.com/q/28293817
answers question: http://stackoverflow.com/q/28293817
has comment: http://stackoverflow.com/comment/44943578
has body: why don't try with some counter, each time the user click on the button we sum 1+ to the counter, and when the counter reach 3, we foo something. here is the jsFiddle HTML &lt;input type="button" id="button1" value="Shop" /&gt; JS var countClick = 0 $('#button1').click(function() { countClick++ if(countClick === 3){ console.log('counter reach ' + countClick) var myButton= document.getElementById('button1'); myButton.style.display ='none'; setTimeout (function(){ myButton.style.display ='inline'; //here we hide the button for 5seconds countClick = 0 // here we make the counter go back to 0 again },5000); //do stuff here like add to cart or something. }else{ console.log('counter still on ' + countClick); } });
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44942120
has comment: http://stackoverflow.com/comment/44940924
type: Answer

http://stackoverflow.com/a/28342324
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28341049
answers question: http://stackoverflow.com/q/28341049
type: Answer
upvote count: 1
score: 1
has body: The simple answer is that you need to give your function definition a signature class MyService { public myMethod: () =&gt; void; //don't use Function constructor() { this.myMethod = this.myMethod; } _myMethod = () =&gt; { } } However a better approach is to define an interface: interface IMyService extends IService { myMethod: () =&gt; void; } class MyService implements IMyService { constructor() { } myMethod = () =&gt; { } }

http://stackoverflow.com/comment/44954540
type: QuestionComment
has text: Check if it's a string -> use a regular expression to find the elements and remove them
comment on: http://stackoverflow.com/q/28301617
score: 0
type: Comment

http://stackoverflow.com/comment/45003714
comment on: http://stackoverflow.com/q/28327784
score: 0
type: QuestionComment
type: Comment
has text: Sorry - simple overview by me... the code should have said `$partNumber[$x]`. Sorry for wasting your guys' time! :(

http://stackoverflow.com/comment/45151128
has text: *"I need a java script code to..."* Okay. When you run into trouble writing that, come back with a specific question about the problem you're having. SO is not a code-writing service, but we're very happy to help **you** write the code.
comment on: http://stackoverflow.com/q/28408532
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44976058
type: QuestionComment
comment on: http://stackoverflow.com/q/28310831
type: Comment
has text: @Muhammad Raza welcome to StackOverflow. Since you've got 2 answers that solve your problem, you should accept the one that fits you best. See more [here](http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work).
score: 0

http://stackoverflow.com/comment/45064884
comment on: http://stackoverflow.com/q/28361171
score: 0
type: Comment
type: QuestionComment
has text: You actually mean the CSS or you mean from a style attribute on the element? Showing your markup would help.

http://stackoverflow.com/q/28315566
answer count: 1
has answer: http://stackoverflow.com/a/28315690
tagged with: javascript
score: 0
tagged with: angularjs
tagged with: plunker
tagged with: iframe
type: Question
type: AnsweredQuestion
has body: The demo can be viewed at: http://plnkr.co/edit/tLiAWIQ3bCAo4z4VFYTc?p=preview script.js var app=angular.module('app',[]) app.controller('MyController', function($scope) { console.log("TEST") $scope.on("$destroy", function() {console.log("DESTROY")}) }) index.html: Hello Plunker! Does anyone have ideas about why so many errors are throwed in plunkr? Is there a way to deal with this?
has title: Why does "hello world" angularJS code throws A LOT OF errors on Plunker?
accepted answer: http://stackoverflow.com/a/28315690

http://stackoverflow.com/a/28425622
answers question: http://stackoverflow.com/q/28419276
score: 0
has body: The React docs have a good example on how to handle this using isMounted(). isMounted() returns true if the component is rendered into the DOM, false otherwise. You can use this method to guard asynchronous calls to setState() or forceUpdate(). Example First, initialize your state variables in `getInitialState()': getInitialState: function() { return { username: '', lastGistUrl: '' } } In componentDidMount() make the ajax call ($.get in this case) then re-set the state variables: componentDidMount: function() { $.get(this.props.source, function(result) { var lastGist = result[0]; if (this.isMounted()) { this.setState({ username: lastGist.owner.login, lastGistUrl: lastGist.html_url }); } }.bind(this)); }
type: Answer

http://stackoverflow.com/comment/45147489
has text: I've not tried to do this, but I think you could have multiple React.render calls, one for each view hierarchy / mount node. But you could also just wrap them in a single component and mount that. "Controller-view" as I understand it just means a view that's managing application state, not necessarily that it's rendered in a certain way.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28362833
type: AnswerComment

http://stackoverflow.com/comment/45077306
has text: @davidkonrad the code you proved me doesn't work. what you mean by `salesGauge`?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28351868
score: 0

http://stackoverflow.com/q/28388957
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45127266
has answer: http://stackoverflow.com/a/28389153
has title: Can prototype properties that aren't writable be shadowed?
type: UnansweredQuestion
type: Question
has body: While playing around with some pet projects today, I came around a certain peculiarity that I can't quite explain. Here's a log from a node repl: &gt; foo = Object.create({}, { toString: { value: function() { return 'bob' } } }) {} &gt; bar = Object.create(foo) {} &gt; bar.toString() 'bob' &gt; bar.hasOwnProperty('toString') false &gt; bar.toString = function() { return 'nope' } [Function] &gt; bar.toString() 'bob' It was my expectation that bar.toString would shadow foo.toString, however this does not seem to happen. Setting the toString property to writable: true when creating foo makes it work as I'd expected. Can prototype properties that aren't writable be shadowed?
linked to: http://stackoverflow.com/q/19698533
has comment: http://stackoverflow.com/comment/45117537
tagged with: prototype
has comment: http://stackoverflow.com/comment/45116199
duplicate of: http://stackoverflow.com/q/19698533
answer count: 1

http://stackoverflow.com/a/28333084
type: Answer
has body: Add a click event listener to the register button. When it is clicked, do whatever you want to do (redirect with window.location = "....."), and return false to prevent default submission: $("#register").on("click", function() { alert("I am executed before the HTML5 check!"); return false; }); You can see an example here: http://jsfiddle.net/89z4Lu91/
has comment: http://stackoverflow.com/comment/45013725
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45013713
has comment: http://stackoverflow.com/comment/45013926
accepted answer of: http://stackoverflow.com/q/28332800
answers question: http://stackoverflow.com/q/28332800
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/45065097
score: 0
comment on: http://stackoverflow.com/a/28359937
type: AnswerComment
type: Comment
has text: am I right ? if I wrote like this ?put 1 minute as testing http://jsfiddle.net/Garfrey/3Lzytvqy/4/ , what should I change in "foo" .

http://stackoverflow.com/a/28357839
accepted answer of: http://stackoverflow.com/q/28356862
upvote count: 2
has comment: http://stackoverflow.com/comment/45058998
answers question: http://stackoverflow.com/q/28356862
type: Answer
score: 2
downvote count: 0
type: AcceptedAnswer
has body: If you want to manually manage the dom, react probably isn't for you. You can always do it better than the abstraction if you really want to. In react, it's usually best to aim for code that can clearly express its intent to react, and let it do its thing. You code is close, the only problem is your key attributes don't uniquely reflect the items in the array. Index based keys are 100% fine for when you have a stack. I gave a more detailed answer to a similar question. To actually solve this here, because any item can be removed at any time, you need to encode a unique identifier in the item itself. Instead of storing an array of strings ["a", "b", "c"] you should store an array of objects [{id: '1', text: "a"}, {id: '2', text: "b"}, {id: '3', text: "c"}]. You can then use the id as your key and it'll be more efficient. This is unrelated to the question, but this.props.index-- is modifying props, which is bad and unreliable. If you need to keep a counter for some reason, set it directly on this in componentWillMount. If you need to communicate something up the tree, you accept a callback as a prop, and call that. Also &lt;Item name={item} closeFn={closeFn.bind(null, i)} key={i} /&gt; doesn't describe any way to get data back out of the Item, other than when deletion is requested.

http://stackoverflow.com/a/28424784
has body: I was able to solve the problem by creating a sub document schema: var SubArraySchema = new Mongoose.Schema({ someKey : String }, {_id : false}); var MyObjectSchema = new Mongoose.Schema ({ name : String, subArray : [SubArraySchema] });
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28344272
answers question: http://stackoverflow.com/q/28344272

http://stackoverflow.com/a/28347435
type: Answer
upvote count: 3
has comment: http://stackoverflow.com/comment/45039861
has comment: http://stackoverflow.com/comment/45039998
answers question: http://stackoverflow.com/q/28347413
has comment: http://stackoverflow.com/comment/45039559
has body: Don't put space between select and it's id as it is the id of select not the children id of the select: $('#fieldsetID select#idOfSelect'); Or, $('#fieldsetID').find('select#idOfSelect');
accepted answer of: http://stackoverflow.com/q/28347413
score: 3
has comment: http://stackoverflow.com/comment/45039787
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45039339
has comment: http://stackoverflow.com/comment/45040036
has comment: http://stackoverflow.com/comment/45039275

http://stackoverflow.com/comment/45123936
has text: Just noticed that myself, however removing it did not seem to change anything, which makes me wonder if it even tries to run the script...
type: AnswerComment
comment on: http://stackoverflow.com/a/28393644
score: 0
type: Comment

http://stackoverflow.com/comment/45121887
type: AnswerComment
score: 0
type: Comment
has text: just want to make sure your click handler is working
comment on: http://stackoverflow.com/a/28392507

http://stackoverflow.com/comment/45051039
has text: @PSL There is a ng-click bound to the button that calls a function to reset the textarea.
comment on: http://stackoverflow.com/q/28353426
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28284317
has body: the variable $supplier is set to the last row in query in your main script - your popup is called AFTER that - so of course you always just get the last row's supplier. You can either reset your query (which row-counter points to the last entry - or you can modify your javascript function so it takes the supplier as value in the theader -> popup('popupDiv','$supplier')
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28284115
type: Answer
has comment: http://stackoverflow.com/comment/44924069
has comment: http://stackoverflow.com/comment/44923234
has comment: http://stackoverflow.com/comment/44923406
upvote count: 1
has comment: http://stackoverflow.com/comment/44923316
downvote count: 1
accepted answer of: http://stackoverflow.com/q/28284115

http://stackoverflow.com/comment/44940810
score: 0
type: Comment
has text: This works! But I'm guessing that "iso-8859-1" will not decode all the subtitles on opensubtitles correctly, right? Would there be a way to decode any files downloaded from opensubtitles correctly?
type: AnswerComment
comment on: http://stackoverflow.com/a/28294072

http://stackoverflow.com/q/28353179
score: 0
has comment: http://stackoverflow.com/comment/88186776
answer count: 1
has answer: http://stackoverflow.com/a/28353297
tagged with: ms-word
has body: I am looking for examples of accessing files residing on a OneDrive from a web page using JavaScript or JQuery or even Angular JS. I assume that the "path to the file", "the user ID" and "password" is needed to open (access) the user's account (Hotmail, Office 365, Live, Outlook) and open the specific file. The goal is for opening an Excel or Word file using a service that will access the file using OOXML SDK to extract information for one or more specific xml part files in the DOCX, XLSX, or XLSM file.
tagged with: angularjs
type: UnansweredQuestion
tagged with: excel
has title: Examples of accessing files on a OneDrive using JavaScript
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/44930073
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28283773
has text: I have solved it guys, it was a problem from database. My super user table was wrong. Thank you anyway.
score: 0

http://stackoverflow.com/q/28288908
tagged with: css
has title: Use JQuery each function to return element width
accepted answer: http://stackoverflow.com/a/28289004
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
tagged with: jquery
type: Question
has body: I currently have an ul with around 20 li. Each li is structured like this: Text I would like to go through each li.block, find its width, and set the anchor tag's width equal to this number. This is the function I'm using now, but it isn't working: $(document).ready(function() { var $currentWidth = $("li.block").width(); $( "li.block a" ).css( "width", $currentWidth); }); What is the proper way to use .each() and something similar to the code above to fix my problem?
tagged with: http://stackoverflow.com/tag/html
score: 1
has answer: http://stackoverflow.com/a/28288973
favorite count: 0
answer count: 2
has answer: http://stackoverflow.com/a/28289004
upvote count: 1
possible better answer: http://stackoverflow.com/a/28288973

http://stackoverflow.com/comment/44955008
type: QuestionComment
has text: as i mentioned it working perfectly in all other browsers. just exception in IE 9
comment on: http://stackoverflow.com/q/28301747
score: 0
type: Comment

http://stackoverflow.com/comment/45133808
comment on: http://stackoverflow.com/a/28397159
score: 0
type: AnswerComment
type: Comment
has text: well, I tried. I have a call to function in `beforeSend`, then after `if(loaded>=100) {...}` it clears the interval while the progress runs, and shows "(100%) > title" ... after progress has been completed, I don't want this. All I want is to show progress while it's in progress then to clear interval.

http://stackoverflow.com/a/28292755
type: Answer
answers question: http://stackoverflow.com/q/28287040
has body: First of all I would fix all missing semicolons in your code. Than check if scope of 'this' in your view models function is correct. Some info from browser console would be also helpful. Check if there isn't any errors which knockout would throw.
score: 0

http://stackoverflow.com/q/28388533
has answer: http://stackoverflow.com/a/28388622
score: 0
upvote count: 1
downvote count: 1
linked to: http://stackoverflow.com/q/22373630
favorite count: 0
has answer: http://stackoverflow.com/a/28388789
accepted answer: http://stackoverflow.com/a/28388789
possible better answer: http://stackoverflow.com/a/28388622
type: AnsweredQuestion
tagged with: performance
has comment: http://stackoverflow.com/comment/45114718
has title: Long running jQuery method - how to refresh dom?
has body: UPDATE I think I have to be a little more precise. I have this long running code that adds content to my DIVs. This is an example of the code: m = jQuery('#test').clone(); //do some work jQuery('#test2').append(m); The Problem is that this can really take a while because sometimes I am adding 100 items. And the content only appears on the page after all 100 items have been added. So the user had to wait like 30 seconds or so. What I would like to is to update the #test2 - DIV after adding 10 elements or so and then continue adding elements Is there a way to refresh the DOM or (better) refresh the test2 - DIV and then continue adding Elements ? OLD Description I have a long running jQuery method that clones DIVs and appends them to the page. It looks like this: m = jQuery('#test').clone(); //do some work jQuery('#test2').append(m); This code is called several times (sometimes up to 100 times) and it takes pretty long for the content to appear in the page. Is there a way to refresh the dom and print the content onto the page so that the user is not getting bored because nothing happens ?
type: Question
answer count: 2
duplicate of: http://stackoverflow.com/q/22373630
has comment: http://stackoverflow.com/comment/45114649
tagged with: javascript
has comment: http://stackoverflow.com/comment/45122962
tagged with: jquery

http://stackoverflow.com/a/28398619
has body: There's no short and simple solution I know of, which would let you to do that. The most convenient way would be to have the HTML ready before setting up javascript for DOM manipulation. Even thinking of project updates I would personally spent that little while to change a small part of js. However, if that's needed for some reason, then I would probably loop through the elements, to find the one I need, eg.: var found = false; $(".theButton").each(function(){ if(found){ // do something with $(this) ... return false; } if($(this).hasClass('active')){ found = true; } }); JSFiddle And yet another, oneliner solution: $(".theButton").eq(($.inArray($(".theButton.active")[0], $(".theButton").toArray()))+1); JSFiddle
upvote count: 1
answers question: http://stackoverflow.com/q/28396281
score: 1
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28396281

http://stackoverflow.com/a/28409283
answers question: http://stackoverflow.com/q/28409193
has comment: http://stackoverflow.com/comment/45152286
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/45152376
type: AcceptedAnswer
downvote count: 0
has body: If ly_productdetails, ProductDetails, en, en_GB are all class names, you should do: body.ly_productdetails.ProductDetails.en.en_GB. BTW, you can do this without jQuery: document.addEventListener("DOMContentLoaded", function () { if (document.querySelector("body.ly_productdetails.ProductDetails.en.en_GB")) { var element = document.getElementById("container"); element.innerHTML = " Products "; } } (Edit) Okay, jQuery version: $(document).ready(function() { if ($("body.ly_productdetails.ProductDetails.en.en_GB").length > 0) { var element = document.getElementById("container"); element.innerHTML = " Products "; } }
has comment: http://stackoverflow.com/comment/45152728
accepted answer of: http://stackoverflow.com/q/28409193
type: Answer

http://stackoverflow.com/a/28407246
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28406826
answers question: http://stackoverflow.com/q/28406826
upvote count: 2
has comment: http://stackoverflow.com/comment/45148633
type: AcceptedAnswer
has body: A better approach to this problem (and easier to maintain!) might be to output these elements as part of your HTML, and then toggle their visibility (either by unsetting a class, or using $.show/$.hide). See this example: http://jsfiddle.net/Lsb1t8na/ html: &lt;div class="modal-header"&gt; &lt;button type="button" class="close hidden" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt; &lt;/div&gt; &lt;div class="modal-body hidden"&gt; Yes... &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button type="button" class="btn btn-white hidden" data-dismiss="modal"&gt;Luk&lt;/button&gt; &lt;/div&gt; css: .hidden { display: none; } js: $(function () { $('.hidden').removeClass('hidden'); });
type: Answer
score: 2

http://stackoverflow.com/comment/45016264
has text: What elemental debugging steps have you taken? Have you look at what allNumbers is using a `console.log()` statement or in the debugger? Your first order of business is to track line by line through your code and figure out where it is going wrong. Always look at the console for errors. Insert debug statements to output variables you need to see (or learn how to step through your code in the debugger). Your answer would be obvious here with simple debugging/troublshooting techniques which all developers must learn.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28334868
score: 1

http://stackoverflow.com/a/28355246
accepted answer of: http://stackoverflow.com/q/28354994
has comment: http://stackoverflow.com/comment/45055083
answers question: http://stackoverflow.com/q/28354994
type: Answer
score: 0
has body: Often when you retrieve a value from a field using jquery's .val(), you'll get the string value (String type) instead of the numeric value you desire here. For instance, the field value may be 37.50, but you're getting "37.50" from .val() So when you do this: commissioncost = $('input[name=price]').val(); You'll get the String value. So instead, try this: commissioncost = Number($('input[name=price]').val()); This will convert/cast the value into a Number for you. Also, a word of caution: just be sure whatever value is in that field, it can be evaluated as a Number, otherwise comissioncost will equal "NaN" (not a number) and will give you the same grief you're experiencing now. The rudimentary method to check if the type conversion was successful is: commissioncost = Number($('input[name=price]').val()); if(isNaN(commissioncost)){ // oops, value wasn't a number! }else{ // hooray! value was a number (most of the time - but that's a longer discussion) }
type: AcceptedAnswer

slick.js
tag name: slick.js
type: Tag
tags question: http://stackoverflow.com/q/28300960

http://stackoverflow.com/q/28318655
possible better answer: http://stackoverflow.com/a/28318760
has answer: http://stackoverflow.com/a/28318760
has answer: http://stackoverflow.com/a/41483341
score: 0
answer count: 3
tagged with: scroll
has answer: http://stackoverflow.com/a/28318765
tagged with: polymer
tagged with: javascript
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28318765
tagged with: events
has body: I have written my custom element in Polymer. The element has a lot of child elements. And I would like to detect scroll event of the element so I can lazyload some content into it. Is it possible somehow ?
type: Question
has title: Detect onscroll event on custom element

http://stackoverflow.com/q/28426229
possible better answer: http://stackoverflow.com/a/28426505
has answer: http://stackoverflow.com/a/28426505
linked to: http://stackoverflow.com/q/1601455
type: AnsweredQuestion
upvote count: 2
tagged with: file
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28426352
score: 1
answer count: 2
has title: Jquery file size validation does not work
tagged with: validation
has body: I got this jquery file type validation on the internet. It works great. I later added some code into it to validate file's size as well. But it did not raise alert box when my file size is greater than 50KB. I just learn jquery so I am not sure what i added is correct or not. Please help. Here is JSFIDDLE Here is the code: &lt;script&gt; $(document).ready(function () { $('input[type=file]').change(function () { var val = $(this).val().toLowerCase(); var regex = new RegExp("(.*?)\.(jpg|jpeg|gif)$"); if(!(regex.test(val))) { $(this).val(''); alert('Unsupported file'); } if ($(this).files.size &gt; 50000 || $(this).files.fileSize &gt; 50000) { //reset file upload control $(this).val(''); //show an alert to the user alert('Allowed file size exceeded 50KB'); } }); }); &lt;/script&gt; This is what i have added into the existing code: if ($(this).files.size &gt; 50000 || $(this).files.fileSize &gt; 50000) { //reset file upload control $(this).val(''); //show an alert to the user alert('Allowed file size exceeded 50KB'); }
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28426352

http://stackoverflow.com/comment/45140129
score: 0
has text: Are you doing this from an app or a website?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28402370

http://stackoverflow.com/comment/44981684
type: QuestionComment
comment on: http://stackoverflow.com/q/28316289
has text: how to remove all the buttons?
score: 0
type: Comment

http://stackoverflow.com/comment/45058194
comment on: http://stackoverflow.com/q/28356768
has text: Your Markers are in a FusionTablesLayer. You need to remove that and query the table to create native Google Map Javascript API v3 Markers if you want to use the MarkerClusterer.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28333697
type: Question
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/8389974
has comment: http://stackoverflow.com/comment/45014226
tagged with: express
favorite count: 0
duplicate of: http://stackoverflow.com/q/20643470
tagged with: bash
linked to: http://stackoverflow.com/q/20643470
tagged with: shell
has body: I have a simple shell script: #!/bin/bash echo "hello john" And I also have a very basic server file: var express = require('express'); var app = express(); app.get('/', function (req, res) { /* Code to execute the shell script */ }); var server = app.listen(3000, function () { var host = server.address().address; var port = server.address().port; console.log('App listening at http://%s:%s', host, port); });
answer count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: node.js
has comment: http://stackoverflow.com/comment/45014223
score: 1
has comment: http://stackoverflow.com/comment/45014270
has title: How to execute a shell script with node?

http://stackoverflow.com/comment/45023965
has text: I want to grab and change document.write code. It is my scholl project. My project will grab and change some javascript codes. I will make it as a extension.
score: 0
comment on: http://stackoverflow.com/q/28338486
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45158119
type: Comment
has text: you were correct in regards to the execution time of the different parts of the code. A comment for future reference that got me confused, is that even when the `$rootScope.currentUser` was correctly set (either in the controller or the service), I was unable to access the $rootScope variable from Chrome Dev Console.
comment on: http://stackoverflow.com/a/28401661
score: 0
type: AnswerComment

http://stackoverflow.com/q/28283045
tagged with: http://stackoverflow.com/tag/svg
has title: Javascript: find position in svg
upvote count: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28284786
type: Question
accepted answer: http://stackoverflow.com/a/28284786
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has body: I have a svg file (whose layout I do not control). The file contains a lot layers (implemented as nested <g>) which include translations. I have a circle and I would like to know it's coordinates. Here is a simplified example: <g transform="translate(5, 2)"> <g class="big pos" transform="translate(20, 3)"> </g> </g> I need a way to find the center coordinates of c. So far I have tried this: center = document.getElementById('c'); matrix = center.getCTM(); var mx = matrix.e / Math.abs(matrix.d); var my = matrix.f / Math.abs(matrix.d); // Get cx, cy from center. // x = mx + cx, y = my + cy This approach has two problems. 1) Any rotations messes up the values. 2) I really have no clue what I'm doing. What is the proper way of getting the coordinates (relative to the root of the svg) of c? Preferably in plain JavaScript, not using D3 or any similar library.
score: 2

http://stackoverflow.com/comment/45104895
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28383249
type: QuestionComment
has text: Or even give it a try.

http://stackoverflow.com/comment/44920664
comment on: http://stackoverflow.com/a/28282999
has text: Please see comment above with Andrew C. It is pulled in with a Perl variable. Its not the same date all time. It puts it in a format of "Mon Dec 08 2014 00:00:00 GMT-0700 (MST)"
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45079562
type: AnswerComment
type: Comment
has text: Thank you, your code works but in my situation, i cant configure the ajax request. I can't add `requestingObjectId` because i don't have access to the code that makes the ajax request. That is the problem that makes this tricky. I can only check when ajax was initiated and can see which element initiated on click event but need to somehow pair the two.
comment on: http://stackoverflow.com/a/28369047
score: 0

http://stackoverflow.com/q/28434421
accepted answer: http://stackoverflow.com/a/28434632
answer count: 1
favorite count: 0
has body: After minifying my AngularJS app, I'm getting this error: n is not using explicit annotation and cannot be invoked in strict mode I think it comes from this decorator: (function () { function logDecoratorConfig($provide) { $provide.decorator('$log', logDecorator); } function logDecorator($delegate) { $delegate.debug = function (msg) { var time = new Date().toString(); console.log(time + " : " + msg); }; return $delegate; } angular.module('services') .config(['$provide', logDecoratorConfig]); }()); Maybe it is because the logDecorator function has to be annotated too? How should I do it?
tagged with: angularjs
has title: AngularJS: Error after minify
type: AnsweredQuestion
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/28434632
type: Question
tagged with: dependency-injection
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/45141474
has text: I did not changed any thing except having script tag added
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28403100
score: 0

http://stackoverflow.com/comment/45177006
comment on: http://stackoverflow.com/q/28420937
has text: So with the base href on my production server, I had to get rid of my base href and on my dev side, it gives me the error $location:nobase if I get rid of the base href. Oh and I had to do $locationProvider.html5mode({ enabled: true, requireBase: false}); on my server's app.js... my bad. Though I still haven't figure it out on my dev server.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45002829
has text: I think I neec to put $timeout somewherw but I dont really see where and how.
comment on: http://stackoverflow.com/q/28327327
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45038169
comment on: http://stackoverflow.com/q/28333919
type: Comment
has text: @MarkFitzpatrick - there was indeed a typo in my question, I've updated it. The `div` tag is named popup. So I was playing around with a little this morning, and the method actually IS firing off (put a simple alert("message") in there), so I think this is just a problem with me using the JQueryUI dialog box, but I don't see what that is. I'll update the OP.
score: 0
type: QuestionComment

multidimensional-array
tags question: http://stackoverflow.com/q/28374694
tags question: http://stackoverflow.com/q/28290657
tags question: http://stackoverflow.com/q/28321029
type: Tag
tags question: http://stackoverflow.com/q/28302995
tags question: http://stackoverflow.com/q/28339620
tag name: multidimensional-array

http://stackoverflow.com/comment/44924057
has text: You get the scope of the element that fired the event. Basically somewhere some code did `$scope.$emit('$stateChangeStart', data)` or `$scope.$broadcast('$stateChangeStart', data)`
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28284480
score: 1

http://stackoverflow.com/comment/45150634
has text: @SINGHKD There are two answers below for you. I have posted an answer that caters for a window resize.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28405541

msdropdown
tags question: http://stackoverflow.com/q/28289796
tag name: msdropdown
type: Tag

http://stackoverflow.com/comment/45104671
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28383236
has text: Doesn't the return in the success part fire.Sorry if this is a noob question.New to Ajax and Jquery.

http://stackoverflow.com/comment/45004153
has text: Use string concatenation.`$('#starrating'+imageid).hide();`
score: 0
comment on: http://stackoverflow.com/q/28328247
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28391408
accepted answer of: http://stackoverflow.com/q/28391314
upvote count: 2
has comment: http://stackoverflow.com/comment/45120536
answers question: http://stackoverflow.com/q/28391314
type: AcceptedAnswer
downvote count: 0
has body: Here is a simplified version of your code: I don't know the expected behaviour, therefore this is as much as I can help. I am sure if you trace below code, you can integrate it easily with your code. Make sure you include jquery cookie js. $('div#set_cookie').click(function(){ var date = new Date(); date.setTime(date.getTime() + (5 * 1000)); // 5 seconds $.cookie('test', 1, { expires: date }); $('div#log').html('cookie has been set! expires : '+date+''); }); $('div#check_cookie').click(function(){ var cookieValue = $.cookie("test"); if (cookieValue){ $('div#log').html('valid cookie'); }else{ $('div#log').html('expired cookie'); } }); jsfiddle
type: Answer
score: 2

http://stackoverflow.com/q/28387312
has comment: http://stackoverflow.com/comment/45112419
has comment: http://stackoverflow.com/comment/45112692
downvote count: 0
type: Question
has comment: http://stackoverflow.com/comment/45112482
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45112260
tagged with: javascript
has body: I am new to AngularJS and trying to fetch JSON data from a text file: Here is my HTML: &lt;div ng-controller="customersController as custCont"&gt; &lt;ul&gt; &lt;li ng-repeat="x in names"&gt; {{ x.Name + ', ' + x.Country }} &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; Whereas my controller is as given below: app.controller( "customersController", function( $scope, $window) { $http({ url: 'test.txt', dataType: 'json', method: 'POST', data: '', headers: { "Content-Type": "application/json" } }).success(function(response){ $scope.names = response; }).error(function(error){ $scope.names = 'error'; }); This doesn't show anything. Now if I replace the above http request with test.txt data assigned to $scope.names then it starts working: I mean, something like this: $scope.names = [ { "Name" : "Alfreds Futterkiste", "City" : "Berlin", "Country" : "Germany" }, { "Name" : "Berglunds snabbköp", "City" : "Luleå", "Country" : "Sweden" }, { "Name" : "Centro comercial Moctezuma", "City" : "México D.F.", "Country" : "Mexico" }, { "Name" : "Ernst Handel", "City" : "Graz", "Country" : "Austria" }, { "Name" : "FISSA Fabrica Inter. Salchichas S.A.", "City" : "Madrid", "Country" : "Spain" }, { "Name" : "Galería del gastrónomo", "City" : "Barcelona", "Country" : "Spain" }, { "Name" : "Island Trading", "City" : "Cowes", "Country" : "UK" }, { "Name" : "Königlich Essen", "City" : "Brandenburg", "Country" : "Germany" }, { "Name" : "Laughing Bacchus Wine Cellars", "City" : "Vancouver", "Country" : "Canada" }, { "Name" : "Magazzini Alimentari Riuniti", "City" : "Bergamo", "Country" : "Italy" }, { "Name" : "North/South", "City" : "London", "Country" : "UK" }, { "Name" : "Paris spécialités", "City" : "Paris", "Country" : "France" }, { "Name" : "Rattlesnake Canyon Grocery", "City" : "Albuquerque", "Country" : "USA" }, { "Name" : "Simons bistro", "City" : "København", "Country" : "Denmark" }, { "Name" : "The Big Cheese", "City" : "Portland", "Country" : "USA" }, { "Name" : "Vaffeljernet", "City" : "Århus…
has comment: http://stackoverflow.com/comment/45112591
accepted answer: http://stackoverflow.com/a/28387519
has title: Getting Json data from text file in AngularJS
upvote count: 2
answer count: 2
has comment: http://stackoverflow.com/comment/45112370
has answer: http://stackoverflow.com/a/51801533
has answer: http://stackoverflow.com/a/28387519
favorite count: 0
possible better answer: http://stackoverflow.com/a/51801533
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45112404
tagged with: xmlhttprequest
tagged with: text
score: 2
type: AnsweredQuestion

http://stackoverflow.com/comment/45110119
score: 0
type: Comment
type: QuestionComment
has text: What actually you want ? you want to get the file name from local storage and load that file as inner html to your result div or something else
comment on: http://stackoverflow.com/q/28386076

http://stackoverflow.com/comment/45010654
has text: I actually just realized I was working in the wrong file lol. Wtf. I am sorry, this thread is no longer needed cuz I now just do ng-if=distribution.name on my directive tag, so that it shows the directive only after there is a name value, so I dont need to do $watch at all, which turns out to be a better UX as well. Thanks for your help though!!
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28331561

http://stackoverflow.com/a/28292167
has comment: http://stackoverflow.com/comment/44937895
has comment: http://stackoverflow.com/comment/44938271
has comment: http://stackoverflow.com/comment/44938184
has comment: http://stackoverflow.com/comment/44938642
answers question: http://stackoverflow.com/q/28292143
has comment: http://stackoverflow.com/comment/44958385
has comment: http://stackoverflow.com/comment/44938525
has comment: http://stackoverflow.com/comment/44937502
has comment: http://stackoverflow.com/comment/44938337
has comment: http://stackoverflow.com/comment/44938459
score: 0
has body: Refer this How to add anchor tags dynamically to a div in Javascript? var mydiv = document.getElementById("myDiv"); var aTag = document.createElement('a'); aTag.setAttribute('href',"www.example.com"); aTag.setAttribute('target',"_blank"); aTag.setAttribute('id',"link"); aTag.innerHTML = "link text"; mydiv.appendChild(aTag); UPDATE: Using Write() document.write("website:Click hereto visit our website.");
type: Answer

http://stackoverflow.com/comment/116899234
type: Comment
comment on: http://stackoverflow.com/a/45465286
has text: It is not working for dynamically created svg elements: `element = document.createElementNS("http://www.w3.org/2000/svg", 'path');element.getBBox() // does not work`
type: AnswerComment
score: 0

http://stackoverflow.com/a/28394200
score: 1
accepted answer of: http://stackoverflow.com/q/28393959
answers question: http://stackoverflow.com/q/28393959
has body: You can use this single line of code after calling your countTo script: $( "i" ).contents().unwrap(); This selects all the &lt;i&gt; tags. The .contents() gets the text inside &lt;i&gt;, and the .unwrap() deletes the content's parent which is the &lt;i&gt; tag.
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0

http://stackoverflow.com/comment/45103313
type: Comment
has text: Ecmascript5 definition of the conditional operator: http://www.ecma-international.org/ecma-262/5.1/#sec-11.12 `LogicalORExpression ? AssignmentExpression : AssignmentExpression` then the `AssignmentExpression` is defined here http://www.ecma-international.org/ecma-262/5.1/#sec-11.13
comment on: http://stackoverflow.com/a/28367863
type: AnswerComment
score: 0

http://stackoverflow.com/q/28308827
accepted answer: http://stackoverflow.com/a/28309410
tagged with: css
has title: Reloading stylesheet without flashing of unstyled content using javascript/jQuery
upvote count: 1
type: Question
type: AnsweredQuestion
has body: Problem background I'm developing a web page where users can dynamically change and style a custom horizontal menu. So there's a bunch of style settings (height, padding, etc...) and a preview at the top of the page. When they change these settings, I reload the html for the menu and the css so it has the new values in place. The problem As you can see below, i'm loading the html, and once completed, i'm applying the html and reloading the css. This all works. However, there is a split second in most cases where the html flashes without any styling. I believe this is happening while the css is being regenerated. I need to prevent this. How can I regenerate the stylesheet while preventing the small gap in time when there is no styling? $.get("http://www.url1.com", function(html) { // add the new html $(".preview-section").html(html); // reload stylesheet var timestamp = Math.round(+new Date()/1000); $("head").append($("&lt;link/&gt;", { rel: "stylesheet", href: "http://www.url2.com?cache="+timestamp, type: "text/css" })); });
score: 1
has comment: http://stackoverflow.com/comment/44969130
tagged with: dom
has answer: http://stackoverflow.com/a/28309410
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/28310751
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/2571164
favorite count: 0
has comment: http://stackoverflow.com/comment/44968918
possible better answer: http://stackoverflow.com/a/28310751
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28347800
type: Question
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28372486
has body: Hokay, here's the deal. I'm trying to show very basic functionality of combining BigQuery and Maps API. So, obviously I need OAuth 2.0. Using Google API Client Library for JavaScript (aka "gapi"), I'm using the following code. var project_id = '***'; var client_id = '***'; var config = { 'client_id': client_id, 'scope': 'https://www.googleapis.com/auth/bigquery', 'immediate': true }; function auth() { gapi.client.setApiKey('***'); gapi.auth.authorize(config, function() { gapi.client.load("bigquery", "v2"); }); } This works fine and all, until I try to use a different Gmail account then the one I opened the BigQuery project with. I get a "permission denied" error. The page is hosted online, the credentials have been set so that Redirect URIs is empty, and the JavaScript origins is set to the 2 websites I want people to have access from. What am I missing? I just want everyone with a gmail account to be able to use my script, from those 2 websites I've given access to :(
answer count: 1
has title: OAuth 2.0 using Google Client for JavaScript, getting permission denied
tagged with: oauth
accepted answer: http://stackoverflow.com/a/28372486
type: AnsweredQuestion
tagged with: google-bigquery

http://stackoverflow.com/comment/45129073
has text: possible duplicate of [Remove an element from the DOM from reference to element only](http://stackoverflow.com/questions/7561277/remove-an-element-from-the-dom-from-reference-to-element-only)
comment on: http://stackoverflow.com/q/28396521
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/comment/45004462
type: QuestionComment
comment on: http://stackoverflow.com/q/28328404
type: Comment
score: 0
has text: This should do: `if(val != 'cor' || val!= 0) {` notice vla!=0

oracle-ucm
tag name: oracle-ucm
type: Tag
tags question: http://stackoverflow.com/q/28363525

http://stackoverflow.com/comment/45046135
has text: Is this javascript loaded before the HTML?
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28351091

http://stackoverflow.com/comment/45015145
has text: Have you looked at it through the F12 developer tools? Not sure if it's a typo, but your script is looking for an HTML tag called popup to close. Maybe you meant $("#popup") if it's an ID or $(".popup") if popup is a class name. Since this is in an updatepanel, try putting a literal control within it that has EnableViewState set to false. Then, when you need to, instead of using the RegisterStartupScript, pump the JavaScript into the literal control's Text property. There are issues that can occur when you have scripts outside an updatepanel attempting to run something within an updatepanel.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28333919
score: 1

http://stackoverflow.com/comment/45189188
comment on: http://stackoverflow.com/a/28381148
type: AnswerComment
has text: If I place them in the constructor then each instance will have cloned methods instead of reusing the shared prototype methods. I was aiming to do it without using that extra memory. Can't wait to use weak maps!
score: 0
type: Comment

http://stackoverflow.com/a/28387175
score: 0
has comment: http://stackoverflow.com/comment/45112985
accepted answer of: http://stackoverflow.com/q/28386927
answers question: http://stackoverflow.com/q/28386927
has comment: http://stackoverflow.com/comment/45113965
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45112416
has comment: http://stackoverflow.com/comment/45130308
has body: Don't touch the table until you've got both result sets, that's just going to make sorting more difficult. Define some global results array and populate it with the AJAX data using concat. var results = []; //on success of each AJAX call results = results.concat(json.results); To ensure both sets of data have been loaded before sorting just include the second AJAX call in the complete function of the first or use recursion if you may have additional AJAX requests in the future. After you have all the data you can sort by price: results.sort(function(a,b){ return a.price-b.price; }); Finally, step through the sorted array and append as you did before. EDIT: Instead of making a bunch of files which are all identical, define a recursive function to load an array of API urls like this: function loadURLs(urls,callback){ //are there more urls to AJAX? if(urls.length==0){ //no: call the callback function callback(); }else{ //yes: make the AJAX call... $.ajax({ type: 'GET', crossDomain: true, dataType: 'json', url: urls[0], success: function (json) { //put data into the results array results = results.concat(json.results); //load the remaining urls loadURLs(urls.slice(1),callback); } } } } This function accepts an array of URL links. It will go through one by one and load the json data into the global results array. After it has gone through all the links it will call the callback function. Inside the callback function you can sort your array once and then append to your table. Your final js would look something like this: //define loadURLs function here //global results array var results = []; //define all your links links here var myURLs = ['API LINK 1','API LINK 2']; loadURLs(myURLs,function(){ //all json data has been loaded, sort results.sort(function(a,b){ return a.price-b.price; }); //iterate over the sorted array and append for(var i=0;i&lt;results.length;i++){ //append to table } });
type: Answer
has comment: http://stackoverflow.com/comment/45127262
has comment: http://stackoverflow.com/comment/45112610

http://stackoverflow.com/comment/45114401
has text: @kishore hit `F12` to open developer tools in your browser and then check Net/Network tab (depends what dev tools you are using)
comment on: http://stackoverflow.com/a/28388037
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45255219
has text: I didn't have time today, but I will try to take a look at it tomorrow :)
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28442212

http://stackoverflow.com/a/28315470
type: Answer
answers question: http://stackoverflow.com/q/28315307
has body: you can change "true" to "false".It's work. httpRequest.open("GET", "http://api.openweathermap.org/data/2.5/weather?q=" + city, false); if you use "true" ,it's Asynchronous request,you should use "callback function".
score: 0

http://stackoverflow.com/comment/45135030
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28399629
has text: `ajaxForm` is not a jQuery function and afaik there are different plugins for jQuery adding a `ajaxForm` function, so you should tell which plugin you use.
score: 0

http://stackoverflow.com/q/28374918
favorite count: 0
has comment: http://stackoverflow.com/comment/45091822
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45092278
has comment: http://stackoverflow.com/comment/45092077
answer count: 0
tagged with: chart.js
score: 1
tagged with: wordpress
upvote count: 1
has comment: http://stackoverflow.com/comment/45092345
type: Question
has comment: http://stackoverflow.com/comment/45092005
tagged with: charts
tagged with: javascript
tagged with: jquery
has title: ChartJS Issues / Wordpress
downvote count: 0
has body: I've got an issue with ChartJS. I've wanting to add charts to different areas of my site, and I've been able to get it to work with one chart but now I'm trying to add a separate chart (that isn't even on the same page as the first) and it won't load at all. It's the oddest thing. Here's my script for the charts: var wins = $("#wins").text(); var losses = $("#losses").text(); var draws = $("#draws").text(); var winsstrike = $("#wins-strike").text(); var winsgrapple = $("#wins-grapple").text(); var winssubmit = $("#wins-submit").text(); var winsother = $("#wins-other").text(); var recorddata = [{ value: 1*wins, color: "#eb3f3d", label: "Wins" }, { value: 1*losses, color: "#ec582a", label: "Losses" }, { value: 1*draws, color: "#f8a430", label: "Draws" } ] var recordoptions = { animation: true, segmentShowStroke : true, segmentStrokeColor : "#191919", percentageInnerCutout : 70 }; var winsdata = [{ value: 1*winsstrike, color: "#eb3f3d", label: "Strike" }, { value: 1*winsgrapple, color: "#E82521", label: "Grappling" }, { value: 1*winssubmit, color: "#CB1815", label: "Submission" }, { value: 1*winsother, color: "#A61411", label: "Other" } ] var winsoptions = { animation: true, segmentShowStroke : true, segmentStrokeColor : "#191919", percentageInnerCutout : 90 }; var c = $('#recordChart'); var ct = c.get(0).getContext('2d'); var ctx = document.getElementById("recordChart").getContext("2d"); myNewChart = new Chart(ct).Doughnut(recorddata, recordoptions); var c1 = $('#winsbyChart'); var ct1 = c1.get(0).getContext('2d'); var ctx1 = document.getElementById("winsbyChart").getContext("2d"); myNewChart1 = new Chart(ct1).Doughnut(winsdata, winsoptions); I have no clue why they won't work; the first chart, posting the #recordChart works flawlessly, but the second doesn't. I know the code is fine because I built a fiddle for it. I just can't figure out why the hell it won't work on the second chart (#winsbyChart). Is there a conflict between the charts I'm not seeing? This is just…
has comment: http://stackoverflow.com/comment/45092303

http://stackoverflow.com/comment/44977874
score: 0
type: Comment
type: QuestionComment
has text: Ok np, thanks man. I'll keep playing with it.
comment on: http://stackoverflow.com/q/28313235

http://stackoverflow.com/comment/45088260
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28372658
has text: Not sure if I'm stating my idea clear enough, but I find the idea of sending some html to the client and the instructions on how to modify it (the javascript) a non sense, when you could just send him the html properly formed in the first place.

http://stackoverflow.com/a/28299152
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/44951264
has body: Try this mate.Replace your x-axis properties with the below xAxis: { categories: cats, labels: { style: { display:'block', fontWeight: 'bold', }, x:350, }, min:0, }, Fiddle
answers question: http://stackoverflow.com/q/28298551
has comment: http://stackoverflow.com/comment/44954659
has comment: http://stackoverflow.com/comment/44956887

http://stackoverflow.com/a/28410791
upvote count: 1
has comment: http://stackoverflow.com/comment/45230370
has comment: http://stackoverflow.com/comment/45196136
answers question: http://stackoverflow.com/q/28406806
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45155107
has body: For these tasks, I would try a cordova plugin to have native sdk's integrated. Here is one for google maps: https://github.com/wf9a5m75/phonegap-googlemaps-plugin You can also search for other plugins at: http://plugreg.com/
has comment: http://stackoverflow.com/comment/48357535
score: 1

http://stackoverflow.com/q/28418678
type: Question
has comment: http://stackoverflow.com/comment/45202698
answer count: 2
tagged with: javascript
upvote count: 1
has answer: http://stackoverflow.com/a/28418891
favorite count: 0
has answer: http://stackoverflow.com/a/28418896
tagged with: backbone.js
type: UnansweredQuestion
has body: I have a backbone collection that is pulling in a bunch of template names for people to use and I would like to sort them alphabetically so their easier to find. I am very unsure of how to do this though. I have my backbone collection this.templates = new Backbone.Collection(); and then I'm sorting through the templates to figure out where to add what. var Names = this.model.collection.models.map(function(model){ return (model.attributes.Name) ? model.attributes.Name : 'Template'; }); Names.forEach(function(name) { _this.templates.add(api.collections[(_this.templateType)].where({Name : name, ShowInToolBox : true})); //adding a bunch of conditionals to add cretin forms to modules that are outside the scope } Is it possible to alphabetize these? I've tried adding .sortBy("Name") to the backbone collection, but it just stopped my code from running.
downvote count: 0
score: 1
has title: Sorting a backbone collection alphabetically

apache
tag name: apache
type: Tag
tags question: http://stackoverflow.com/q/28420937

http://stackoverflow.com/a/28296410
has comment: http://stackoverflow.com/comment/44953248
has comment: http://stackoverflow.com/comment/44951039
has comment: http://stackoverflow.com/comment/44953010
has body: You should use localStorage.setItem('bgColor', x); Instead of localStorage.bgColor = x; And localStorage.getItem('bgColor'); To retrieve value of you stored. Firefox will not crash anymore because it's the right way to use localStorage.
has comment: http://stackoverflow.com/comment/44953657
upvote count: 2
has comment: http://stackoverflow.com/comment/44952458
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28296007
has comment: http://stackoverflow.com/comment/44951735
type: Answer
has comment: http://stackoverflow.com/comment/44946020
has comment: http://stackoverflow.com/comment/44946383
answers question: http://stackoverflow.com/q/28296007
has comment: http://stackoverflow.com/comment/44946243
score: 2
has comment: http://stackoverflow.com/comment/44945570

http://stackoverflow.com/comment/45132734
score: 0
type: AnswerComment
type: Comment
has text: please remove $scope.loadData() from ChangeKW, and move $scope.loadData function to AppController
comment on: http://stackoverflow.com/a/28398017

http://stackoverflow.com/comment/45187313
comment on: http://stackoverflow.com/q/28427434
score: 0
type: QuestionComment
has text: Even I'm getting the coordinates in safari/mac no issues!
type: Comment

http://stackoverflow.com/q/28402223
answer count: 2
has comment: http://stackoverflow.com/comment/45139699
tagged with: javascript
has title: Using ng-repeat with objects
score: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28402260
possible better answer: http://stackoverflow.com/a/28402264
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28402264
has comment: http://stackoverflow.com/comment/45139661
has comment: http://stackoverflow.com/comment/45139750
type: Question
has body: I'm having trouble diagnosing an issue when using ng-repeat within my controller. I am trying a proof-of-concept to display an array of objects' keys and values within a tag. This is my first go with Angular. I have a controller that returns an array of simple objects. I am trying to generate tags using values from these objects. activitiesController app.controller("activityController", ["$scope", function ($scope) { $scope.activities = [ { name: "hi" }, { name: "hello" } ] }]); index.html {{ key }} {{ val }} Am I missing something? I get no errors but no data is ever displayed on my page. SOLUTION It's best to use this format instead (but the problem lied in nesting a div inside a p). {{ activity.name }}
accepted answer: http://stackoverflow.com/a/28402260

http://stackoverflow.com/q/28392331
favorite count: 0
has answer: http://stackoverflow.com/a/28392533
has title: Update previous state object in HTML5 History
type: UnansweredQuestion
tagged with: html5-history
downvote count: 0
score: 1
type: Question
tagged with: javascript
has body: In HTML5 History we have the replaceState() method to update the state object of the current history entry. Do we have something like previousState() to update the state object of the previous history entry?
upvote count: 1
answer count: 1

http://stackoverflow.com/q/28391026
possible better answer: http://stackoverflow.com/a/28391066
has answer: http://stackoverflow.com/a/28391066
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/28391049
tagged with: javascript
has title: Geting undefined when passing in a parameter to a Module pattern function
has answer: http://stackoverflow.com/a/28391049
has body: $("#foo").on("click", function() { amountItems.speek('heey') }) var amountItems = (function(el) { // var el = el; return { speek: function() { alert(el) } } }()) This is my first attempt to using a module pattern. basically when foo get's clicked i want the speek method inside the amountItems function to be called and I want to pass the string 'heey' to the method so it should alert 'heey' when foo is clicked. originally i wanted to pass something like $("#foo").text() but either way I get 'undefined'. can you show me how to work with a jQuery object when it's passed into this type of function?
type: Question
tagged with: object
type: AnsweredQuestion

http://stackoverflow.com/a/28405055
has body: I have extended the solution available here and here is what you can do: [Note that this solution uses jQuery and not Angular.] var min_x = 0; var max_x = 200; var min_y = 0; var max_y = 200; var filled_areas = new Array(); $('.word').each(function() { var rand_x=0; var rand_y=0; var area; do { rand_x = Math.round(min_x + ((max_x - min_x)*(Math.random() % 1))); rand_y = Math.round(min_y + ((max_y - min_y)*(Math.random() % 1))); area = {x: rand_x, y: rand_y, width: $(this).width(), height: $(this).height()}; } while(check_overlap(area)); filled_areas.push(area); $(this).css({left:rand_x, top: rand_y}); }); function check_overlap(area) { for (var i = 0; i < filled_areas.length; i++) { check_area = filled_areas[i]; var bottom1 = area.y + area.height; var bottom2 = check_area.y + check_area.height; var top1 = area.y; var top2 = check_area.y; var left1 = area.x; var left2 = check_area.x; var right1 = area.x + area.width; var right2 = check_area.x + check_area.width; if (bottom1 < top2 || top1 > bottom2 || right1 < left2 || left1 > right2) { continue; } return true; } return false; } .word { position: absolute; } hello tag cloud hello
upvote count: 1
answers question: http://stackoverflow.com/q/28404614
type: Answer
has comment: http://stackoverflow.com/comment/45163978
downvote count: 0
score: 1

http://stackoverflow.com/q/28331606
type: AnsweredQuestion
has body: I am trying to determine if cache (as obtained via applicationCache and HTML5 cache-manifest) is available located on a different domain (local file system vs WWW). The cache-checking resource (a gateway mechanism, if you will) is located on the local filesystem and is loaded via a webview. This is a requirement that I cannot work around. Until recently, this gateway local file would check to see if the device is online and redirect to the remote resource using window.location and if the device was not online, it would display a graphic (also locally packaged) that essentially said "You must connect to the internet to use this feature." However, I just recently implemented offline support on that remote resource. It works. If we have the gateway file just redirect to the remote resource whilst offline, it'll load the remote resource from cache. There's a possibility that a user may try to use the device whilst offline when they have not yet accessed it via online, so logic needs to be placed in the gateway code to test if the cache exists or not. I am running into cross domain issues, which I expected, but I am not sure how to go about fixing it. Here is the code I have tried: if (window.navigator.onLine === false) { // See if we're able to reach the content (if it's cached, we'll get HTML, else it'll fail) cacheCheck = $.ajax(contentLoc, {async:false}); // the request failed so we have no cache at all. let's just show the offline graphic. if (cacheCheck.status === 0) { // no cache available :( $("#launchpage").addClass("offline"); } else { // we have a cache :) redirect(); } } else { redirect(); } When I was writing it, I was under the naive hope that the $.ajax() would fetch the cached version (if it existed) and I could just test the returned object to see if the status code returned wasn't an error status code. However, this does not work as object is returning "Error: NETWORK_ERR: XMLHttpRequest Exception 101" Is there any other method that I can use to determi…
has answer: http://stackoverflow.com/a/28446176
answer count: 1
tagged with: javascript
score: 0
tagged with: cross-domain
tagged with: offline-caching
tagged with: application-cache
has title: Detecting applicationCache viability of remote resource
accepted answer: http://stackoverflow.com/a/28446176
type: Question

http://stackoverflow.com/comment/44975987
comment on: http://stackoverflow.com/q/28312571
has text: @Fred-ii-, but setting button type to submit shows the same issue of page redirection before clicking actual submit button. OR did i misunderstood your suggestion..!!
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28398072
downvote count: 0
has comment: http://stackoverflow.com/comment/45132284
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45196014
has comment: http://stackoverflow.com/comment/45145121
type: Answer
has comment: http://stackoverflow.com/comment/45196822
accepted answer of: http://stackoverflow.com/q/28397974
has comment: http://stackoverflow.com/comment/45196703
has body: You could use a mutation observer watching document.body's subtree, and assume that the page has finished being modified (say) 20ms after the last notification you get. In JavaScript, that would look something like this: (function() { var observer; // The click handler that appends content after a random delay document.querySelector('input').addEventListener("click", function() { if (!observer) { hookupObserver(); } setTimeout(function() { var p = document.createElement('p'); p.innerHTML = "New content added at " + Date.now(); document.querySelector('div').appendChild(p); }, 500 + Math.round(Math.random() * 500)); }, false); // Watching for subtree mods to `document.body`: function hookupObserver() { var timer = 0; observer = new MutationObserver(function() { clearTimeout(timer); timer = setTimeout(done, 40); }); observer.observe(document.body, {childList: true, subtree: true}); } function done() { timer = 0; alert("Modification complete"); } })(); This is the page
score: 1
answers question: http://stackoverflow.com/q/28397974
has comment: http://stackoverflow.com/comment/45196336
has comment: http://stackoverflow.com/comment/45132571

http://stackoverflow.com/comment/44918735
has text: possible duplicate of [Meteor Page Refreshing with Button Click](http://stackoverflow.com/questions/28005070/meteor-page-refreshing-with-button-click)
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28281949

http://stackoverflow.com/comment/45016605
type: Comment
type: QuestionComment
has text: Why are you trying to do this? Argument callee is black magic and won't work in strict mode.
comment on: http://stackoverflow.com/q/28335109
score: 0

hotlinking
type: Tag
tags question: http://stackoverflow.com/q/28388801
tag name: hotlinking

http://stackoverflow.com/q/28397861
has comment: http://stackoverflow.com/comment/45131626
has answer: http://stackoverflow.com/a/72577668
has answer: http://stackoverflow.com/a/28397970
has body: is there any way to influence what console.log gives out custom objects? I tried to overwrite the customObject.prototype.toString method, that did not work though. Any ideas?
score: 34
type: Question
possible better answer: http://stackoverflow.com/a/62053603
has answer: http://stackoverflow.com/a/62053603
answer count: 3
accepted answer: http://stackoverflow.com/a/28397970
linked to: http://stackoverflow.com/q/2960936
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45131624
has title: adjust console.log behaviour of custom object
tagged with: node.js
upvote count: 34
type: AnsweredQuestion

http://stackoverflow.com/a/28410688
upvote count: 3
has comment: http://stackoverflow.com/comment/45155962
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28410421
answers question: http://stackoverflow.com/q/28410421
has comment: http://stackoverflow.com/comment/45154829
downvote count: 0
has comment: http://stackoverflow.com/comment/45154803
has body: You need to do the redirect in the success callback of your AJAX function - $.ajax({ url:"http://localhost/homes/bookService.php", type:"POST", dataType:"json", data:{type:"booking",Name:uName, Email:mailId, Mob_Num:mobNum }, //type: should be same in server code, otherwise code will not run ContentType:"application/json", success: function(response){ window.location.href = 'wherever.html'; // redirect on success }, error: function(err){ //alert(JSON.stringify(err)); } }); In addition you should quit using alert() for troubleshooting.
score: 3
has comment: http://stackoverflow.com/comment/45156066

http://stackoverflow.com/a/28419221
upvote count: 2
has body: Did you read the comments in the code you linked to? /** * ### HOW TO CREATE A VALID ID TO USE: ### * Go to www.twitter.com and sign in as normal, go to your settings page. * Go to "Widgets" on the left hand side. * Create a new widget for what you need eg "user time line" or "search" etc. * Feel free to check "exclude replies" if you don't want replies in results. * Now go back to settings page, and then go back to widgets page and * you should see the widget you just created. Click edit. * Look at the URL in your web browser, you will see a long number like this: * 345735908357048478 * Use this as your ID below instead! */ Those aren't the IDs of hashtags - they're widget IDs which you have previously configured to search for hashtags.
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/28411369
type: Answer

http://stackoverflow.com/q/28401100
tagged with: loops
type: Question
tagged with: child-nodes
downvote count: 0
has answer: http://stackoverflow.com/a/28402091
has title: javascript xml loop childNodes
tagged with: javascript
has body: i want to loop through an XML javascript childNodes dynamically using a for loop, i don't understand why this doesn't work? please take a look at my code - thanks! XML structure: child1 child2 child1 child1 child2 child3 Javascript: Outputs: len=3 0= childNodes= 0 - child1 childNodes= 1 - child2 childNodes= 2 - child1 childNodes= 3 - child1 childNodes= 4 - child2 childNodes= 5 - child3 1= childNodes= 0 - child1 childNodes= 1 - child2 childNodes= 2 - child1 childNodes= 3 - child1 childNodes= 4 - child2 childNodes= 5 - child3 2= childNodes= 0 - child1 childNodes= 1 - child2 childNodes= 2 - child1 childNodes= 3 - child1 childNodes= 4 - child2 childNodes= 5 - child3 Should Output: len=3 0= childNodes= 0 - child1 childNodes= 1 - child2 1= childNodes= 0 - child1 3= childNodes= 0 - child1 childNodes= 1 - child2 childNodes= 2 - child3
answer count: 1
score: 1
tagged with: http://stackoverflow.com/tag/xml
favorite count: 0
type: UnansweredQuestion
upvote count: 1

karma-runner
tags question: http://stackoverflow.com/q/28432959
tags question: http://stackoverflow.com/q/28280449
tags question: http://stackoverflow.com/q/28353076
tags question: http://stackoverflow.com/q/28370537
tag name: karma-runner
tags question: http://stackoverflow.com/q/28396735
type: Tag
tags question: http://stackoverflow.com/q/28297235
tags question: http://stackoverflow.com/q/28416536
tags question: http://stackoverflow.com/q/28284703

http://stackoverflow.com/a/28413766
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28412536
answers question: http://stackoverflow.com/q/28412536
type: Answer
score: 1
upvote count: 1
has body: It seems that my issue was that the drawing of the lines starts from where the node is located and not the offset of the canvas, it is working fine now: thank you!
downvote count: 0

http://stackoverflow.com/a/28435144
has comment: http://stackoverflow.com/comment/45201088
type: Answer
answers question: http://stackoverflow.com/q/28434841
has body: the last value in PHP or JavaScript? in PHP the fields are normally passed as an array, so you can get the last value using end($array) Even better if you name your filed like this &lt;input type='text'name='E[8]' value= '123' /&gt; &lt;input type='text'name='E[9]' value= '456' /&gt; &lt;input type='text'name='E[10]' value= '789' /&gt; in JS you need to get the fields into an array and get the last.... you need something like this var myFields = document.forms["myform"].getElementsByTagName('input'), var lastValue = myFields[(myFields.length-1)].value;
score: 0

http://stackoverflow.com/q/28289027
has body: I am new to JavaScript and was trying this exercise: Make two versions of your random insult generator: one that uses the + operator to create the string, and one that creates an array and joins it with " ". The first generator I did this way but how to do the second? var randomBodyParts = ["Face", "Nose", "Hair"]; var randomAdjectives = ["Smelly", "Boring", "Stupid"]; var randomWords = ["Fly", "Marmot", "Stick", "Monkey", "Rat"]; var randomAnimalBodyParts = ["Tail", "Feelers", "Wings", "Trunk"]; var randomBodyPart = randomBodyParts[Math.floor(Math.random() * 3)]; var randomAdjective = randomAdjectives[Math.floor(Math.random() * 3)]; var randomWord = randomWords[Math.floor(Math.random() * randomWords.length)]; var randomAnimalBodyPart = randomAnimalBodyParts[Math.floor(Math.random() * randomAnimalBodyParts.length)]; var randomInsult = "Your " + randomBodyPart + " is more " + randomAdjective + " than a " + randomWord + "’s" + " " + randomAnimalBodyPart + "."; randomInsult; "Your Face is more Boring than a Rat’s Tail."
has comment: http://stackoverflow.com/comment/44932225
has comment: http://stackoverflow.com/comment/44931887
type: Question
has comment: http://stackoverflow.com/comment/44932423
tagged with: arrays
tagged with: javascript
tagged with: string
favorite count: 0
score: 0
has comment: http://stackoverflow.com/comment/44932042
has title: How to turn arrays into a string using the join method in javascript?
answer count: 0
type: UnansweredQuestion
upvote count: 1
downvote count: 1

http://stackoverflow.com/a/28402513
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28402475
has body: It is because of the leading and trailing spaces created by the empty text nodes, you can trim the text to remove them var len=$(targetid).text().trim().length; Demo: Fiddle

http://stackoverflow.com/comment/45029573
comment on: http://stackoverflow.com/a/28341119
type: AnswerComment
has text: And via CSS? `#map-canvas img { max-width: 100% !important; }` ? Also can you share a live URL to your site?
score: 0
type: Comment

http://stackoverflow.com/comment/55378365
has text: @AlexandreBourlier I finally gave up and reverted all changes, that project is still using `bootstrap-growl` v1.0.6. Now I'm using `Toastr` in newer projects.
score: 1
comment on: http://stackoverflow.com/q/28295632
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44962247
comment on: http://stackoverflow.com/a/28282936
has text: Hey, yeah indeed it just seem to work with .attr. I was not able to get it working with .class.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45111299
has text: Thanks, that makes it so clear. I don't know why I couldn't see that. I don't call core methods like that and just went way off in the wrong direction. Cool, Thanks..
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28386780

http://stackoverflow.com/comment/88737695
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28389347
has text: Could you explain how this question relates to YouTube? Is it about a YouTube video embedded in your website?

http://stackoverflow.com/a/34902935
answers question: http://stackoverflow.com/q/28396969
score: 0
has body: I would try using a surrounding div like Also why are you setting the controller both in the body and in the route provider? I would stick to the route provider and remove it from the body.
type: Answer

http://stackoverflow.com/a/28429177
upvote count: 1
has comment: http://stackoverflow.com/comment/45190090
type: Answer
answers question: http://stackoverflow.com/q/28428010
has body: I really don't know if this might help u .Its a slight work around.First add a class say class="certType" to all the check boxes under the Certificate Type section.Based on this class you may filter out the results.Hope this might give you some light on how to solve it mate.. :) if($(this).attr("class") == "certType"){ $('.post:visible').filter(':not(.' + this.id + ')').hide(); } Fiddle here
downvote count: 0
has comment: http://stackoverflow.com/comment/45189747
score: 1
has comment: http://stackoverflow.com/comment/45189509

http://stackoverflow.com/comment/44980917
type: Comment
comment on: http://stackoverflow.com/a/28315666
has text: @chopperdrawlion4 - I added the actual ECMAScript specification for `Object.is()`
type: AnswerComment
score: 0

http://stackoverflow.com/a/28342356
type: Answer
downvote count: 0
score: 1
has body: Check the change event of the select element. (also add a class to identify the elements involved so you can hide them again once you change the option) $(function() { $('select').on('change', function() { var option = $(this).find(':selected'), relatedClass = option.attr('class'); $(this).closest('form') .find('.select-target') .addClass('hidden') .filter('.' + relatedClass) .removeClass('hidden'); }); }); .hidden { display: none; } Choose Show link 1 2 Link
answers question: http://stackoverflow.com/q/28342162
accepted answer of: http://stackoverflow.com/q/28342162
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/45102861
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28381992
score: 0
has text: Your original answer wouldn't have worked. It was actually wrong moment date creation which you corrected after copying from answer below...

http://stackoverflow.com/comment/45080108
has text: do you really want a private variable for a popup or you just want a unique variable for each popup?
comment on: http://stackoverflow.com/q/28369580
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/a/28342588
has body: It might help you!! Its use for prints filtered number of users. {{(data|filter:query).length}}
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28342329
score: 1
upvote count: 1

http://stackoverflow.com/a/28359121
has body: The JSFiddle you posted has bugs, every time the method clearTable was called it crashed. To remove all the elements inside space you can use space.innerHTML = '' function clearTable() { space.innerHTML = ''; }
answers question: http://stackoverflow.com/q/28358121
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45062552
has comment: http://stackoverflow.com/comment/45062169
type: Answer
accepted answer of: http://stackoverflow.com/q/28358121

http://stackoverflow.com/a/28311723
type: Answer
accepted answer of: http://stackoverflow.com/q/28311631
has comment: http://stackoverflow.com/comment/80521671
has body: You can get the coordinates of where you clicked inside of the element like this: Just subtract the offset position of the element from the coordinate of where the page was clicked. Updated Example document.getElementById('progressBar').addEventListener('click', function (e) { var x = e.pageX - this.offsetLeft, // or e.offsetX (less support, though) y = e.pageY - this.offsetTop, // or e.offsetY clickedValue = x * this.max / this.offsetWidth; console.log(x, y); }); If you want to determine whether the click event occurred within the value range, you would have to compare the clicked value (in relation to the element's width), with the the value attribute set on the progress element: Example Here document.getElementById('progressBar').addEventListener('click', function (e) { var x = e.pageX - this.offsetLeft, // or e.offsetX (less support, though) y = e.pageY - this.offsetTop, // or e.offsetY clickedValue = x * this.max / this.offsetWidth, isClicked = clickedValue <= this.value; if (isClicked) { alert('You clicked within the value range at: ' + clickedValue); } }); Click within the grey range
answers question: http://stackoverflow.com/q/28311631
has comment: http://stackoverflow.com/comment/44974268
has comment: http://stackoverflow.com/comment/44974191
score: 18
upvote count: 18
has comment: http://stackoverflow.com/comment/44976160
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44974498
downvote count: 0

http://stackoverflow.com/comment/45001068
comment on: http://stackoverflow.com/q/28324015
type: QuestionComment
type: Comment
has text: Ok, I made it working, will post the answer
score: 0

http://stackoverflow.com/comment/45094780
has text: Nope, you are not. `zot` is a constructor function, it never is a prototype. `zot.prototype` becomes the prototype for every instance you create *with* `zot`.
type: AnswerComment
comment on: http://stackoverflow.com/a/28377310
score: 0
type: Comment

http://stackoverflow.com/q/28320971
has comment: http://stackoverflow.com/comment/44990154
tagged with: javascript
tagged with: replace
has body: I have a textarea with some text (suppose it says THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG). When I press a button, the content of the textarea changes to replace the word "BROWN" with another word (eg "RED") THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG. The code does not appear to work. I have tried seeing if the function was caling properly and whether variables were strings. EDIT: The function now reads: function myFunction() { var textElem = document.getElementById("text3").value; newText = textElem.replace("BROWN", "RED"); newText = textElem.replace("FOX", "RABBIT"); newText = textElem.replace("JUMPED", "LEAPED"); newText = textElem.replace("LAZY", "SLEEPING"); alert(newText); /*I added this to see what the value of newText is*/ textElem = newText; } Through the alert, I noticed that newText does not change from the original. Is there something wrong with the textElem.replace ?
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
tagged with: string
favorite count: 0
has comment: http://stackoverflow.com/comment/44990151
has title: Use of string.replace() in javascript to change content of a textarea
has answer: http://stackoverflow.com/a/28321418
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28321281
answer count: 4
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/28321356
type: Question
has answer: http://stackoverflow.com/a/28321382

http://stackoverflow.com/comment/45117008
has text: The @.getJSONP actually doesnt work at all. I think perhaps it doesnt exist in Ember (or is this a JQuery thing? I have no idea). It was my attempt to solve the problem. So the actual call is $.getJSON. I've tried this: "/users" and it was looked for "file:///C:/users" and I even created a JSON file called users.json and then tried: "/users.json" and this also failed. :(
comment on: http://stackoverflow.com/q/28386853
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/28321930
has title: Looping through properties of object in an array in AngularJS
tagged with: javascript
has answer: http://stackoverflow.com/a/28322026
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28322096
possible better answer: http://stackoverflow.com/a/28322026
has answer: http://stackoverflow.com/a/28322146
tagged with: angularjs
has body: I would like to loop and print the properties of the array of objects (only one time) Html &lt;div ng-app ng-controller="MyCtrl"&gt; &lt;ul&gt; &lt;li ng-repeat="(key, value) in items"&gt;{{key}}&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; Script function MyCtrl($scope) { $scope.items = [{'name':10, 'phone':11},{'name':10, 'phone':11}]; } The desired effect would be: name phone It works only if I have one object and not an array of objects Here is a link to fiddle http://jsfiddle.net/3vzd732s/2/ Thanks in advance.
accepted answer: http://stackoverflow.com/a/28322096
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/45046282
type: QuestionComment
type: Comment
has text: @VsevolodGoloviznin can you post an example as the answer?
comment on: http://stackoverflow.com/q/28351168
score: 0

http://stackoverflow.com/q/28352722
has comment: http://stackoverflow.com/comment/45049631
has comment: http://stackoverflow.com/comment/45050444
has comment: http://stackoverflow.com/comment/45050828
tagged with: css
has answer: http://stackoverflow.com/a/28353132
downvote count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45050001
score: 3
has answer: http://stackoverflow.com/a/28352899
has comment: http://stackoverflow.com/comment/45049852
has comment: http://stackoverflow.com/comment/45049622
has comment: http://stackoverflow.com/comment/45049698
has body: I have the following code which does not work in the desktop size but does work when I resize my app. $('#accordion').on('shown.bs.collapse', function (e) { e.preventDefault(); var id = $(e.target).prev().find("[id]")[0].id; console.log(id); //navigateToElement(id); $('body').animate({ scrollTop: $("#" + id).offset().top }, 1000); }); Here is what's happing, the only difference in the app is that I'm hiding the left navigation and top dropdown in the header
has comment: http://stackoverflow.com/comment/45163661
type: Question
has title: jQuery animate and scrollTop not working unless app is mobile size
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45113212
favorite count: 0
has comment: http://stackoverflow.com/comment/45168565
upvote count: 3
has comment: http://stackoverflow.com/comment/45049595
answer count: 3
has comment: http://stackoverflow.com/comment/45168990
has answer: http://stackoverflow.com/a/28353555

http://stackoverflow.com/a/67319608
downvote count: 0
answers question: http://stackoverflow.com/q/28357965
has comment: http://stackoverflow.com/comment/133858882
has comment: http://stackoverflow.com/comment/133844780
score: 4
has body: test.pre("save",function(next){ if(this.isNew){ this.constructor.find({}).then((result) =&gt; { console.log(result) this.id = result.length + 1; next(); }); } })
type: Answer
upvote count: 4

http://stackoverflow.com/comment/45046879
type: AnswerComment
score: 0
type: Comment
has text: I don't think browsers are being inconsistent here. If you don't give a time in an iso 8601 date string then 00:00:00 is assumed. If you don't give a timezone component in a iso 8601 date string, then UTC is assumed. Js just stores the date as number of miliseconds since Jan 1st 1970 00:00:00 UTC. The difference in console outputs is to do with the different OS timezones used when logging the dates back out again. That is when local timezone is used.
comment on: http://stackoverflow.com/a/28346742

http://stackoverflow.com/comment/45097059
type: AnswerComment
score: 0
type: Comment
has text: Yes, and I still think there's a hidden character in the URL for placeholder. Update the URL with what I posted, make sure jQuery is loaded before placeholder, and move down to jQuery 1.10.1 (due to IE8 support). I'm not getting any errors using your code after these fixes.
comment on: http://stackoverflow.com/a/28378563

http://stackoverflow.com/comment/44982414
type: Comment
type: QuestionComment
has text: I work with C# and javascript a lot, the way you are trying to mix the 2 won't work
comment on: http://stackoverflow.com/q/28316604
score: 0

http://stackoverflow.com/comment/45176413
has text: @u84six the error types don't have to be error types, they can be generic predicate functions. See https://github.com/petkaantonov/bluebird/blob/master/API.md#catchfunction-errorclassfunction-predicate-function-handler---promise
score: 0
comment on: http://stackoverflow.com/a/28377436
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28343669
type: Question
has answer: http://stackoverflow.com/a/28343851
has answer: http://stackoverflow.com/a/28346575
has body: I have a dropdown on my page which I am populating from client side javascript code. The SelectedIndexChanged does not fire. But when I populate my dropdown from code behide (.cs file) the even is fired. Any idea how to handle SelectedIndexChanged when dropdown is being populated from code behind. I could see that dropdown is getting populated as per my needs. Only SelectedIndexChanged even is not getting fired. Also note that the drop down is inside UpdatePanel. Will that be a reason? Here is my html, javascript and code behind event: &lt;asp:DropDownList ID="ddS" runat="server" OnSelectedIndexChanged="ddS_SelectedIndexChanged" AutoPostBack="True" Style="position: absolute; width: 50%;"&gt; Javascript: $('#ddS').append('&lt;option value="' + $(this).val() + '"&gt;' + $(this).text() + '&lt;/option&gt;'); CS protected void ddS_SelectedIndexChanged(object sender, EventArgs e) { } Any help would be appreciated. Thanks in advance. Edit My main reason behind doing this is: I have used jquery ui js for a popup, it has a multi-select drop down list. Since the button in a popup cannot have a server side event I have used ajax call to a web-method in .cs file. This method will update my tables from the database with the options selected in the multi-select drop down. Once it is done I want to close the popup and populate a drop down based on the options selected in multi-select. I cannot populate my dropdown from code behind because the web-method is a static method and hence any method called from that method has to be a static method. If I write a static method then I cannot access UI controls(my drop down) from a static method. So I was hoping I can populate it from JS and then trigger my indexchange event for further computation.
score: 0
answer count: 2
tagged with: selectedindexchanged
tagged with: c#
accepted answer: http://stackoverflow.com/a/28346575
tagged with: javascript
has comment: http://stackoverflow.com/comment/45031712
has title: Dropdown's SelectedIndexChanged event is not fired when its populated from client side
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45031855
tagged with: jquery
tagged with: asp.net
possible better answer: http://stackoverflow.com/a/28343851

http://stackoverflow.com/comment/45013206
comment on: http://stackoverflow.com/a/28311780
type: Comment
score: 2
has text: There's a pretty detailed section on waveshaping in [Dodge & Jerse](http://amzn.com/0028646827). It was 20 pages in the original 1985 edition; not sure how much changed in the 2nd edition.
type: AnswerComment

http://stackoverflow.com/comment/45135109
score: 0
type: AnswerComment
has text: I added 'user.save();' after what you suggested and that worked. However, it stores an 'id' which is the same id as the letter record. I'm guessing that is the intended effect?
type: Comment
comment on: http://stackoverflow.com/a/28399425

http://stackoverflow.com/comment/45163627
has text: Do you want event listeners on the `a` nodes you're inserting?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28415110
score: 1

http://stackoverflow.com/comment/45085574
type: Comment
has text: I'm trying to **avoid** waiting for document ready and element id's. I want to use $(this) for the checkbox and a variable for the div with, containing the inputs
comment on: http://stackoverflow.com/a/28372536
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45038801
type: QuestionComment
has text: has your random key part small letters,digits and special chars and the part you want keep big letters and _ ?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28347014

http://stackoverflow.com/comment/114493928
score: 1
comment on: http://stackoverflow.com/a/62053603
type: AnswerComment
has text: Could you please explain this syntax to me. I am new to JS
type: Comment

http://stackoverflow.com/a/28451967
has body: It seems that the problem is the network. Is there a proxy from geoserver and your application? Have you tried using geoserver interface to display your WFS file instead your application?
type: Answer
accepted answer of: http://stackoverflow.com/q/28429431
answers question: http://stackoverflow.com/q/28429431
score: 0
type: AcceptedAnswer

http://stackoverflow.com/a/28342597
answers question: http://stackoverflow.com/q/28342516
score: 0
has body: Try this one, $( "div:contains('John')" ) According to Jquery Documentation it will select the div by it's content Hope this helps.
type: Answer

http://stackoverflow.com/comment/45176940
comment on: http://stackoverflow.com/q/28388530
score: 0
type: Comment
type: QuestionComment
has text: markle976 seems to be saying the `debugger;` line isn't actually called from inside `bar`. So look at the stack trace when it pauses in debugger: Is the `bar` function mentioned in the stacktrace? If I'm right, then the stacktrace should say it's paused at line 5, at line 7, at line 9.

http://stackoverflow.com/q/28399621
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/28703685
tagged with: filereader
type: AnsweredQuestion
upvote count: 3
type: Question
score: 3
tagged with: internet-explorer-9
has title: Polyfill for FileReader API
has body: Please help me out on using fileReader polyfill for IE9. Im unable to get it out on how to use it. Please correct me if im doing anything wrong here. Im trying to use the FileReader API Shim for IE9. But on change event of the input type = file, Im still getting files attribute not defined on event error message Posting the code below for your reference`
tagged with: flash
has answer: http://stackoverflow.com/a/28703685
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/44983755
type: Comment
comment on: http://stackoverflow.com/a/28317309
has text: That's a good point. @Grendizer Consider adding classes like "size-1", "size-2", etc instead of setting width and height attributes. Also you could use the .css() method of jquery: image.css({"width": value, "height": value})
score: 0
type: AnswerComment

http://stackoverflow.com/q/28292368
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/44938494
has title: how to convert .net service response to string in javascript?
answer count: 1
downvote count: 1
favorite count: 0
tagged with: http://stackoverflow.com/tag/xml
type: UnansweredQuestion
has body: i get this response form web service in my java script. &lt; string xmlns="http://tempuri.org/"> $,100559,11:05,22.298953,70.795753,# &lt; string> how to get this string to simply string as mention below. I want string like this : $,100559,11:05,22.298953,70.795753,#
has answer: http://stackoverflow.com/a/28292861
has comment: http://stackoverflow.com/comment/44938267
upvote count: 0
type: Question
linked to: http://stackoverflow.com/q/17604071

http://stackoverflow.com/comment/44930891
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28287906
score: 0
has text: The message went away when I removed the controller definition from my directive : controller: function ($scope) { } that section in particular, but regardless, still I am having problems with ngSwitch, for some reason it also tries to initialize the controller of the ngsitch and fails to do so and throws an exception.

http://stackoverflow.com/a/28413047
has body: It is not another request however it will show up in your assets.
answers question: http://stackoverflow.com/q/28412980
type: Answer
has comment: http://stackoverflow.com/comment/45159525
has comment: http://stackoverflow.com/comment/45479940
has comment: http://stackoverflow.com/comment/45646605
score: 0

http://stackoverflow.com/comment/44979616
type: QuestionComment
has text: Here is Fiddle Link http://jsfiddle.net/kcL8e3d0/
comment on: http://stackoverflow.com/q/28314942
score: 0
type: Comment

http://stackoverflow.com/comment/45161765
score: 0
comment on: http://stackoverflow.com/q/28413987
has text: ah, right. what about the stack trace?
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28371234
type: Answer
has body: 1) Create .htaccess 2) Write this: Options +FollowSymlinks RewriteEngine on rewriterule ^takethequiz(.*)$ http://otherdomain.com/Reports.aspx$1 [r=301,nc] 3) Modify "otherdomanin" with your domain :)
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28371094
score: 0
answers question: http://stackoverflow.com/q/28371094

http://stackoverflow.com/comment/45032206
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28343746
has text: your fiddle is not opening

http://stackoverflow.com/comment/45034272
has text: @AnthonyCarbon yes, simply do a check for the current window scroll position before activating the animation
comment on: http://stackoverflow.com/a/28344842
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28431353
has answer: http://stackoverflow.com/a/28431703
type: Question
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45193479
answer count: 2
accepted answer: http://stackoverflow.com/a/28431703
has answer: http://stackoverflow.com/a/28431624
tagged with: css
score: 0
possible better answer: http://stackoverflow.com/a/28431624
has title: Jquery image slider previous button
has body: HTML code i am creating jquery image slider and this html and css code for that image slider. Next prev JS code This is jquery code for image slider in which next button working properly but i tried to create prev button code but didn't get success.
has comment: http://stackoverflow.com/comment/45194083
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/44925862
type: QuestionComment
has text: Wait, is that unityscript?
comment on: http://stackoverflow.com/q/28285900
score: 1
type: Comment

http://stackoverflow.com/comment/45162666
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28351299
type: Comment
has text: If I change my $get statements to go after 'ContentPlaceHolderBody_divScrollable', the NULL test doesn't fail, but both xPos and yPos come back as zeroes.

http://stackoverflow.com/q/28344410
has comment: http://stackoverflow.com/comment/45033116
type: UnansweredQuestion
upvote count: 1
downvote count: 1
has body: I want to show some informations on site from database. But I know there is no way to connect to database with native javascript. And I read something about this is not a good method. So I really curious about how developers show informations on sites from database? For example member name? It's in somewhere in the database. Site is coded with javascript. How can javascript reach member name info?
type: Question
has answer: http://stackoverflow.com/a/28344532
tagged with: database
score: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28344763
has title: how to reach database with javascript
has answer: http://stackoverflow.com/a/28344576
has answer: http://stackoverflow.com/a/28344614
has comment: http://stackoverflow.com/comment/45033214
answer count: 4
has comment: http://stackoverflow.com/comment/45033191

http://stackoverflow.com/q/28433709
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I have some code that is supposed to scroll one page height every time scroll is triggered in some way. I want this to scroll only one heigh, and "pause" the trigger until the scrolling is done. However, my script does not stop, instead it will scroll all the way down instantly. Scrolling upwards seems to work better... Here is my script: var lastScroll = 0; var scrollPos = 0; var blockScroll = 0; $(window).scroll(function() { var scroll = $(this).scrollTop(); if(blockScroll == 0) { blockScroll = 1; if(scroll &gt; lastScroll){ // Down scrollPos++; console.log(scrollPos+"-"+blockScroll); $("html, body").animate({scrollTop:$(window).height()*scrollPos}, 'slow', function() { blockScroll = 0; }); } else { // Up scrollPos--; console.log(scrollPos); $("html, body").animate({scrollTop:$(window).height()*scrollPos}, 'slow', function() { blockScroll = 0; }); } } lastScroll = scroll; }); blockScroll is meant to be set when a scroll event appears, and to be unset when the scrolling animation stops. As a lock. I am not shure this works the way I want it though... Can someone see something obviously wrong with this? Am I having trouble with the fact that jQuery is async?
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45198261
upvote count: 2
score: 2
type: AnsweredQuestion
tagged with: scroll
has comment: http://stackoverflow.com/comment/45205611
has answer: http://stackoverflow.com/a/28435974
accepted answer: http://stackoverflow.com/a/28435974
type: Question
has title: Scrolling jQuery

http://stackoverflow.com/a/28365324
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45074609
has body: You should actually be passing the marker instance as the second parameter to the open call. See here https://developers.google.com/maps/documentation/javascript/examples/infowindow-simple
has comment: http://stackoverflow.com/comment/45071827
answers question: http://stackoverflow.com/q/28365040

http://stackoverflow.com/comment/44968211
comment on: http://stackoverflow.com/a/28308386
type: AnswerComment
score: 0
type: Comment
has text: Ok assume anyways you could achieve this for desktop version what would be the case for mobile haha ha ha ha

http://stackoverflow.com/q/28305386
score: 1
tagged with: java
has comment: http://stackoverflow.com/comment/44962167
has comment: http://stackoverflow.com/comment/44980575
tagged with: richtext
type: Question
downvote count: 0
tagged with: rich-text-editor
tagged with: javascript
has body: I am inserting image in using this var readFileIntoDataUrl = function (fileInfo) { var loader = $.Deferred(), fReader = new FileReader(); fReader.onload = function (e) { loader.resolve(e.target.result); }; fReader.onerror = loader.reject; fReader.onprogress = loader.notify; fReader.readAsDataURL(fileInfo); return loader.promise(); }; $.when(readFileIntoDataUrl(fileInfo)).done(function (dataUrl) { execCommand('insertimage', dataUrl); }).fail(function (e) { options.fileUploadError("file-reader", e); }); Let say i added a text Hello World and added a image. Now when i take $("#editor").html() it shows something like below Here is a sample source of a image+text Hello World! img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QBoRXhpZgAATU0AKgAAAAgA BAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAAExAAIAAAARAAAATgAAAAAAAABgAAAA AQAAAGAAAAABUGFpbnQuTkVUIHYzLjUuOAAA/9sAQwAHBQUGBQQHBgUGCAcHCAoRCwoJCQoVDxAMERgV [... more base64 data here....] Now here i have both text+image So both on server side and client side i want to resize &amp; compress image So that no one can insert image > 5MP and also keep a rich text with resize image in my db
upvote count: 1
has title: How to compress and resize image from a Rich Text
answer count: 1
has answer: http://stackoverflow.com/a/28306290
tagged with: jquery
has comment: http://stackoverflow.com/comment/44980618
has comment: http://stackoverflow.com/comment/44961923
favorite count: 0
has comment: http://stackoverflow.com/comment/44977710
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44962627
has comment: http://stackoverflow.com/comment/44961976
has comment: http://stackoverflow.com/comment/44979767
has comment: http://stackoverflow.com/comment/44961872

http://stackoverflow.com/a/28398774
has body: You could do this : var a=document.getElementsByClassName('menuRight'); for(var i=0;i&lt;a.length;i++) { //do stuff. to access the elements use a[i] }
has comment: http://stackoverflow.com/comment/45133325
has comment: http://stackoverflow.com/comment/45134983
answers question: http://stackoverflow.com/q/28398737
has comment: http://stackoverflow.com/comment/45133534
score: 0
type: Answer

http://stackoverflow.com/comment/45158888
type: Comment
has text: Well, there is a question which I am toggling with regarding e.g. [highlighting a current link in JS](http://stackoverflow.com/questions/20003458/highlight-current-link-javascript), but I have no experience with getting a different action a second click. I will suggest myself to take a beginner's *JS* course soon. :) I need more insight in this powerful language.
type: QuestionComment
comment on: http://stackoverflow.com/q/28412671
score: 0

http://stackoverflow.com/a/28349673
accepted answer of: http://stackoverflow.com/q/28349578
score: 0
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/28349578
upvote count: 1
downvote count: 1
has body: You need to wait for your page to be ready before your code can execute on markup in the page. For example, use window.onload handler as in the example below. There are nicer ways to do this such as jQuery methods, but this will serve as an example of what you need.

http://stackoverflow.com/a/28380089
score: 0
has comment: http://stackoverflow.com/comment/45099395
type: Answer
answers question: http://stackoverflow.com/q/28380009
has body: remove ); after first function var var1='BollywoodNEntertainment'; $(function(){ function test() { alert("reached"); $('#grid').facebook_wall({ id: var1, access_token:'193673707489176|55a9bc60f1b35074263ea95e45218fc3', limit: 1 }); } $("#test").click(function(){ $('#div1').remove(); $('#div2').remove(); $('#div3').remove(); test(); }); }); check this demo
has comment: http://stackoverflow.com/comment/45099445

http://stackoverflow.com/a/28355666
type: Answer
answers question: http://stackoverflow.com/q/28355558
score: 0
has body: You've passed the HTML object into the if statement instead of it's actual value. You can use innerHTML property in order to get the content within the HTML element. var test = document.getElementById("test"); // element by id var testContent = test.innerHTML; // the value of inner HTML content Once you have stored the value in testContent variable, you can do whatever you want with it ;-) // Check if value of inner HTML is less than 50 if(testContent &lt; 50) { alert("true, do whatever you want."); } else { alert("false"); } I hope you find this useful, Thanks.

http://stackoverflow.com/comment/45071096
comment on: http://stackoverflow.com/q/28364803
has text: It does things behind the scenes when you assign a value to it: http://stackoverflow.com/questions/7609130/set-the-value-of-a-input-field-with-javascript.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28356531
score: 0
has title: Code Synthax BBCode Inline Fix
has comment: http://stackoverflow.com/comment/45097097
tagged with: bbcode
tagged with: css
answer count: 0
type: UnansweredQuestion
has body: So I'm trying to make a custom BBCode for my forum that will properly color coding by it's language. It works great but it's appearing completely inline and doesn't line break at all like it should. Here is the coding: &lt;head&gt; &lt;link rel="stylesheet" type="text/css" href="http://z3.ifrm.com/63/1/0/p509771/prism.css" /&gt; &lt;body&gt; &lt;script type="text/javascript"&gt; function addLang(nClass, nName) { $('blockquote dt:contains(' + nClass + ')').parents('blockquote').find('code').addClass('language-' + nClass); $('blockquote dt:contains(' + nClass + ')').text('Code: ' + nName); } addLang('css', 'CSS'); addLang('javascript', 'JavaScript'); addLang('php', 'PHP'); addLang('sql', 'SQL'); addLang('c++', 'C++'); addLang('c#', 'C#'); addLang('python', 'Python'); addLang('java', 'Java'); &lt;/script&gt; &lt;script type="text/javascript" src="http://z3.ifrm.com/63/1/0/p509772/prism.js"&gt;&lt;/script&gt; Here is how it appears: https://i.sstatic.net/wwTsZ.png Here is an example of how I want it to appear: https://i.sstatic.net/Qvg0T.png
type: Question
has comment: http://stackoverflow.com/comment/45056480
has comment: http://stackoverflow.com/comment/45056619
tagged with: javascript

http://stackoverflow.com/q/28402944
has comment: http://stackoverflow.com/comment/45143217
has comment: http://stackoverflow.com/comment/45142986
has comment: http://stackoverflow.com/comment/45143309
type: UnansweredQuestion
tagged with: ember.js
has comment: http://stackoverflow.com/comment/45143139
has comment: http://stackoverflow.com/comment/45142251
answer count: 0
has comment: http://stackoverflow.com/comment/45142160
score: 0
has comment: http://stackoverflow.com/comment/45143424
has comment: http://stackoverflow.com/comment/45143370
has body: I'm running into a wall passing a variable as a param to a component in Ember. In one template, I'm looping through Ember Data model "user" like so: {{#each user in users}} {{person-entry user=user status=??}} {{/each}} I'm trying to pass the status element of the user. If I put {{user.status}} above the {{person-entry}} tag, it displays the correct result on the page. However, if I pass it as the value of status, it's undefined. Trying to access if from the user param also returns undefined. When I inspect the store in the Ember console, the data is there as well. How can I pass this value and have access to it in the component? What am I missing? Additional: If I put {{user.status}} in the template for {{person-entry}}, it also displays correctly. UPDATE: Additional code, as requested... User model import DS from 'ember-data'; var attr = DS.attr; export default DS.Model.extend({ del: attr(), status: attr(), source: attr(), ppoem_reader_number: attr(), first_name: attr(), last_name: attr(), title: attr(), job_duty: attr(), email: attr(), direct_phone: attr(), company: DS.belongsTo('company') }); Component "person-entry" import Ember from 'ember'; export default Ember.Component.extend({ editStatus: '', status: '', showEdit: false, statusOk: Ember.computed.equal('editStatus', 'OK'), statusDelete: Ember.computed.equal('editStatus', 'DELETE'), statusOpen: Ember.computed.equal('editStatus', ''), didInsertElement: function() { this.set('status', this.get('status')); } }
type: Question
has comment: http://stackoverflow.com/comment/45143157
tagged with: ember-data
has comment: http://stackoverflow.com/comment/45142850
tagged with: javascript
has comment: http://stackoverflow.com/comment/45142846
has comment: http://stackoverflow.com/comment/45143161
has comment: http://stackoverflow.com/comment/45143580
has comment: http://stackoverflow.com/comment/45143202
has comment: http://stackoverflow.com/comment/45142812
has title: Passing variables in Ember
has comment: http://stackoverflow.com/comment/45143505

http://stackoverflow.com/comment/45057177
comment on: http://stackoverflow.com/q/28356361
score: 0
has text: I see your update, not much of an update but to find a string you can use .indexOf("The String"); and to replace it you can use replace("The string", "replacement"); If you don't understand this then i suggest you display more an example of what you want so we have something to work with. We don't have time to make assumptions, we go by what you give. Give us nothing you get nothing.
type: QuestionComment
type: Comment

simplemodal
tags question: http://stackoverflow.com/q/28290127
type: Tag
tag name: simplemodal

http://stackoverflow.com/comment/44947920
type: QuestionComment
score: 3
comment on: http://stackoverflow.com/q/28297961
has text: `$('.link_input_text').val("Some text");` You need to use class selector
type: Comment

http://stackoverflow.com/a/28361474
score: 1
answers question: http://stackoverflow.com/q/28360766
has comment: http://stackoverflow.com/comment/45065283
has comment: http://stackoverflow.com/comment/45065265
has body: In order to achieve your goal you will need to animate either left position or margin-left. In both cases respectic div should be wrapped with one more container with overflow: hidden on it. var targetWidth = $('#myDiv').css("margin-left") == "200px" ? "0px" : "200px"; if (!$("#myDiv").is(":visible")) { $("#myDiv").show(); } $('#myDiv').animate({marginLeft: targetWidth}, duration, function () { if ($(this).css("margin-left") == "200px") { $(this).hide(); } else { $(this).show(); } }); Demo: http://jsfiddle.net/7hne1d0b/3/
downvote count: 0
has comment: http://stackoverflow.com/comment/45065907
has comment: http://stackoverflow.com/comment/45065511
type: Answer
upvote count: 1

http://stackoverflow.com/q/28424314
accepted answer: http://stackoverflow.com/a/28424337
upvote count: 1
tagged with: php
possible better answer: http://stackoverflow.com/a/28424675
has answer: http://stackoverflow.com/a/28424675
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28424337
type: Question
answer count: 2
has title: How can I protect my php, jquery, ajax requests from hackers?
downvote count: 0
tagged with: javascript
tagged with: jquery
score: 1
favorite count: 0
has body: I send a lot of data through jquery's ajax method, an example of a function is $.ajax({ url: retrive.php, type: 'POST', data: data, success: callback }); The problem is that anyone can look at the source and see that the location of the php file its sending the POST data to, therefore you could just point your browser there and get data from the URL. I do checks on the data to make sure its the right data type, but I dont want users to be able to go to the url at all. How can we protect against direct access of that url?

http://stackoverflow.com/a/28343161
upvote count: 5
accepted answer of: http://stackoverflow.com/q/28335606
type: Answer
has comment: http://stackoverflow.com/comment/45037543
score: 5
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28335606
has body: Nearly every example of WebRTC I've seen on the Internet involves creating a RTCPeerConnection with a single parameter of null. I guess for the examples, most of the time it is assumed that you're on the same computer. So you don't really need any iceServers. (And the examples don't want to provide you with a "free" stun-server/turn-server?) I've noticed that technically everything still works if the two requests are coming from the same router when you pass null. This won't be the case if the clients are not on the same network. Because without a stun server (passed through the iceServers config) the clients have no way of getting their server reflexive addresses. Edit: As pointed out in the comments by @syno: At the moment, one of the "security" issues with webRTC is that the STUN and TURN server configs are passed as clear text when creating the peer connection. Anybody can look at the JavaScript code and use your servers. This is why using a TURN server with a REST API (code.google.com/p/rfc5766-turn-server/wiki/turnserver) to have a temporary "timestamp" is necessary to limit the usage from unwanted users. Adding all this complexity in a simple demo is not wanted when the purpose is to learn or show the basic concept of webRTC

http://stackoverflow.com/comment/45105017
comment on: http://stackoverflow.com/q/28383505
type: Comment
has text: maybe you should consider to do it on client side with responsive design and CSS...
type: QuestionComment
score: 3

http://stackoverflow.com/comment/45124958
type: Comment
has text: That work great, thanks.. How does `$(this).data("copied")` work? this is new to me.
comment on: http://stackoverflow.com/a/28394206
type: AnswerComment
score: 0

http://stackoverflow.com/comment/57610480
comment on: http://stackoverflow.com/a/34890609
has text: Thanks. Just revised.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28422378
answers question: http://stackoverflow.com/q/28422338
has comment: http://stackoverflow.com/comment/45178056
has comment: http://stackoverflow.com/comment/45177899
has body: .bind() doesn't take a selector argument, only .on() does. If you're binding to dynamically-added elements, you need to use .on(). $(document).on('input', 'input:text', function ...); Corrected fiddle The other problem is that you're using $("input:text").each(). That will only process the elements that existed when the page was loaded. You don't need that loop, just bind your event handlers normally. You don't need the variables elem and oldValue outside handlers; within the handler, $(this) is the element that the event was triggered on, and you can get oldValue from .data(). $(document).on('focus', 'input:text', function () { var elem = $(this); elem.data('oldVal', elem.val()); elem.data('oldLen', elem.data('oldVal').length); }); $(document).on('input', 'input:text', function (event) { var elem = $(this); var oldValue = elem.data('oldVal') || ''; elem.data('oldVal', elem.val()); if (elem.val().length - oldValue.length &gt; 1) { alert('Most certainly pasted'); } elem.data('oldLen', elem.data('oldVal').length); foo(oldValue, elem.val()); });
has comment: http://stackoverflow.com/comment/45178020
downvote count: 0
has comment: http://stackoverflow.com/comment/45177792
has comment: http://stackoverflow.com/comment/45178022
has comment: http://stackoverflow.com/comment/45177773
type: Answer
has comment: http://stackoverflow.com/comment/45177964
score: 2
has comment: http://stackoverflow.com/comment/45177920
upvote count: 2

http://stackoverflow.com/comment/45113211
has text: I have added my whole code if you want to look again. I did what you suggested and no luck. Thank you for helping!
comment on: http://stackoverflow.com/a/28382818
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44940456
type: Comment
comment on: http://stackoverflow.com/q/28292437
type: QuestionComment
has text: I now realize WHY you can't make a modal disappear onmouseleave, as the focus of the page when a modal appears shifts entirely to the modal itself. I don't want t use popover's, as this modal only appears in very specific scenarios, I want the alert to be very obvious. Since the Modal contains both an exit button, usually a close button, and also disappears when you click outside it's boundaries, the question now becomes, how do I ACTIVATE a modal only onmouseover?
score: 0

http://stackoverflow.com/comment/45014297
comment on: http://stackoverflow.com/a/28333721
score: 0
type: AnswerComment
type: Comment
has text: The chance that there's an auth code query string to begin with is 50/50. This code assumes that the auth code value will already exist which it very well might not. Also, I added an ID to the elements to select them.

http://stackoverflow.com/comment/123736857
type: Comment
has text: Why two useEffect?
type: AnswerComment
comment on: http://stackoverflow.com/a/68936621
score: 0

http://stackoverflow.com/comment/44973116
has text: Can you explain the television screen setup more? Is it a PC, Apple TV, Wii, Xbox?
comment on: http://stackoverflow.com/a/28286907
type: AnswerComment
score: 0
type: Comment

size
type: Tag
tag name: size
tags question: http://stackoverflow.com/q/28342549
tags question: http://stackoverflow.com/q/28367192

http://stackoverflow.com/a/76511001
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28336356
has body: var selector = document.querySelectorAll(".ecard"); Using above we can call to all the elements with class = "ecard". "querySelectorAll" can select many elements at once. Replace "selector" with any term you like. Replace "ecard" with the ID or CLASS of respective set of elements. Note : We use "#" in front of a term if it is ID, and "." in front of a term if it is CLASS. for (let index = 0; index < ec.length; index++) { const ecc = selector[index]; ecc.style.backgroundColor = "#10141E" } Using above code we create a loop which end after changing the background color of all the elements. In here javascript only runs above if the respective number of elements set of elements should greater than 0 Replace "selector" terms on above code, with term you used to replace term : selector, in first code I mentioned Replace "ecc" with any term you like., and use that term to change style of multiple element Thanks !

http://stackoverflow.com/q/28348750
has title: Parse.com Http request body parameter differs using ' or "
score: 0
tagged with: parse-platform
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45078442
tagged with: quotes
tagged with: double-quotes
has body: I want to send body's key values as variables but as in the code it doesn't work. What's exactly the difference and how can I solve this by using variables. I believe the problem is caused by JS dictionary's base characteristics but couldn't find anything related. var withq = 'entry_xxx'; var withdoubleq = "entry_xxx"; Parse.Cloud.httpRequest({ method: 'POST', url: doc_url, headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, body: { 'entry_xxx' : object, // works }, }) Parse.Cloud.httpRequest({ method: 'POST', url: doc_url, headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, body: { "entry_xxx" : object, // doesn't work }, }) Parse.Cloud.httpRequest({ method: 'POST', url: doc_url, headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, body: { withq : object, // doesn't work }, }) Parse.Cloud.httpRequest({ method: 'POST', url: doc_url, headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, body: { withdoubleq : object // doesn't work }, })
has comment: http://stackoverflow.com/comment/45078115
tagged with: httprequest
has comment: http://stackoverflow.com/comment/45077325
type: Question
has comment: http://stackoverflow.com/comment/45042148
tagged with: javascript

http://stackoverflow.com/comment/45043406
comment on: http://stackoverflow.com/a/28347510
type: AnswerComment
has text: Hey, it is not working fully. It works on resize. but initial it stays with the mobile image. Plus i need to call it after / on each ajax request, because site is loaded by ajax.
score: 0
type: Comment

http://stackoverflow.com/q/28376059
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28376139
type: UnansweredQuestion
has title: Change Form action url Dynamically
tagged with: php
has body: So I need to change the default url to something much better I have made it to work on .htaccess but I can't do it into the form action...Can someone tell me how to change the form url the form goes to the url s=thesearch&for=for&genre=genre&lang=lang&quality=quality&rating=rating&orderby=orderby I want to make the form goes to s=thesearch/for/genre/lang/quality/rating/orderby the form code that goes into the first url: Advanced Search Search For: Title Actor Writer Director Company IMDb ID Genre: All Action Adventure Animation Comedy Crime Drama Family Fantasy Horror Music Musical Mystery Romance Sci-Fi Sport Thriller War Western Subtitle: All Arabic Czech Danish Dutch English French German Greek Indonesian Malay Spanish Swedish Turkish Quality: All CAM Non HD HD Full HD Rating: All 9+ 8+ 7+ 6+ 5+ 4+ 3+ 2+ 1+ Order By: Latest Oldest Rating Alphabetical Views Anyone who knows how to change the form url with something...
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/comment/45130878
has text: I don't really know exactly why I would want to reload the page either, or what the exact difference would be between reload or the method that you chose. All I know is that when I've tried your method in the past, the query result does not show up on the page anymore, but when I use `location.reload` then it does. The query is highly customized by the user, allowing the user to select the columns they want, and what data shows up in the query result. I need to keep the query result that user selects, but resort the data. I don't know how to use your method and pass the same results.
comment on: http://stackoverflow.com/a/28396914
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/44977291
type: Comment
type: QuestionComment
has text: Not sure. Validation is working and I cannot switch tabs under any circumstances.
comment on: http://stackoverflow.com/q/28313235
score: 0

http://stackoverflow.com/comment/45142480
has text: I have slapped together an example of Angular being loaded with a mocked up dependancy manager, it should work in an almost identical manner to jquery include, browserify, bower, etc. ) angular is being served up by a php script that rate limits the download to 100kbps, the html page contains 3 lines (one of which is hidden away inside ng-cloak. Take a look: http://boot.p0ssess3d.net/slowAngular/example1.php
comment on: http://stackoverflow.com/a/28403170
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28299688
has body: I'm not sure what the error in my code actually was, but after deleting the ng-repeat and then re-typing the whole thing it now just works as expected, so I'll put an answer here for clarity. As pointed out by pankajparkar and WayneEllery in the comments, the correct syntax for accessing $valid inside an ng-repeat is simply: Save
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28298482

http://stackoverflow.com/comment/44975582
has text: ok, so i fixed it, but the banner now is not 100% width...grr...one thing after another...;(
type: Comment
comment on: http://stackoverflow.com/a/28312452
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45111227
comment on: http://stackoverflow.com/a/28386695
type: AnswerComment
has text: Thanks. Can you provide a JSfiddle example? When I use this I am getting this error: Uncaught SyntaxError: Unexpected token )
score: 0
type: Comment

http://stackoverflow.com/comment/45049499
type: Comment
comment on: http://stackoverflow.com/a/28336240
has text: it seems that if I toggle from pan/zoom mode to brush mode and then back to pan/zoom and then again back to brush mode, I am not able to move nodes again. So moving nodes in brush mode works only the first time.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45062005
comment on: http://stackoverflow.com/a/28359431
type: Comment
has text: Please also add fiddle of your code, so we can debug more.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45161412
type: Comment
type: AnswerComment
has text: @robertgfthomas could you give example where have you used Deferred without .resolve ?
comment on: http://stackoverflow.com/a/28413877
score: 0

http://stackoverflow.com/a/28333494
downvote count: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28324809
accepted answer of: http://stackoverflow.com/q/28324809
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45036184
has body: Yes, this should work. The hitArea property supports the use of any display object. Without seeing more code, it's difficult to guess what you're doing wrong, so here is an example of it working correctly with Sprite instances (which is likely a more efficient approach than extracting frames into Bitmap instances): http://jsfiddle.net/6L5esy6v/

http://stackoverflow.com/comment/57161888
has text: Have you ever found a solution? I'm having the same issue T_T
type: QuestionComment
comment on: http://stackoverflow.com/q/28321015
score: 0
type: Comment

http://stackoverflow.com/a/28335026
downvote count: 0
has comment: http://stackoverflow.com/comment/45016525
score: 3
has comment: http://stackoverflow.com/comment/45016807
has comment: http://stackoverflow.com/comment/45032246
has comment: http://stackoverflow.com/comment/45016663
upvote count: 3
answers question: http://stackoverflow.com/q/28334756
has body: This type of problem can't be resolved by a regex that consume a whole block. What you describe does require complete and correct tokenization of the JavaScript language. Consider for example that you might have brackets contained inside quoted text... Unless you actually see more benefits I'm trying to do it all by yourself than to actually succeed in reasonable time (like you are playing around to understand how parsers works), then you should definitely have a look at some existing JS in JS parsers. See for example: http://marijnhaverbeke.nl/blog/acorn.html (note this is the first result that Google gave me, never tried that library).
has comment: http://stackoverflow.com/comment/45017332
type: Answer

http://stackoverflow.com/comment/47996084
has text: You are right. We cannot make the app crash from a plugin or javascript call as the cordova library by default handles the exception in the web view. So it might not be possible to generate the crash from Javascript without editing the web view implementation classes in the cordova library. So I am accepting this answer.
type: Comment
comment on: http://stackoverflow.com/a/29875804
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45040678
type: QuestionComment
has text: then write it to the output stream on the Connection or put it into the 'Entity' depending on what client is being used.
comment on: http://stackoverflow.com/q/28346255
score: 0
type: Comment

null
tags question: http://stackoverflow.com/q/28377733
tag name: null
tags question: http://stackoverflow.com/q/28387908
tags question: http://stackoverflow.com/q/28393742
type: Tag
tags question: http://stackoverflow.com/q/28305480

http://stackoverflow.com/comment/45102804
type: Comment
type: QuestionComment
has text: You have not provided any PHP code that saves records into your MySQL table. And now you're asking how to do it from scratch. These sort of questions doesn't belong on SO. This is not a tutorial site. Show us where you're exactly stuck with only the relevant code; don't just copy and paste your entire project's code here.
comment on: http://stackoverflow.com/q/28380313
score: 0

task
type: Tag
tag name: task
tags question: http://stackoverflow.com/q/28285783

http://stackoverflow.com/a/28412410
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45158463
has body: It will depend on what whether you want to enter a specific error state (for the general application, one specific to Repositories, etc). The general idea is to transition to the state you wish as follows: Contributionkeeper.RepositoriesController = Ember.Controller.extend({ actions: { delete: function(repo) { Ember.$.ajax({ url: '...', success: function(data) { }, error: function() { return this.transitionTo('yourErrorLocation'); }); } } }); See the documentation regarding Loading and Error substates for more details.
accepted answer of: http://stackoverflow.com/q/28411379
upvote count: 2
answers question: http://stackoverflow.com/q/28411379

http://stackoverflow.com/a/28320968
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/45066635
score: 2
answers question: http://stackoverflow.com/q/28320937
has body: mousedown fires when the mouse button is held, mouseup when it's released. With the use of variables, you can determine when a button is being held down and when it isn't.
downvote count: 0

http://stackoverflow.com/q/28321641
has title: Bootstrap navigation menu not working perfectly
type: UnansweredQuestion
has body: Let's say I am on a device with narrow screen. In this case the collapsed menu sometimes expands and some times does not. Here is the sequence of my footer Here is my code for menu SiteName Menu Menu Menu Menu I have added this code snippet too in the footer On further inspection I found out that after the collpased menu button is click the html inside expanded menu should change to from
has answer: http://stackoverflow.com/a/28321752
tagged with: javascript
tagged with: jquery
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
tagged with: twitter-bootstrap
score: 0
answer count: 1

http://stackoverflow.com/comment/45181743
score: 2
has text: Well, think about how a person would know when its a tie (hint: its when all spaces are filled and there is no winner). How could you run code **if** all spaces are filled **and** there is no winner?
comment on: http://stackoverflow.com/q/28424575
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45007948
score: 1
comment on: http://stackoverflow.com/q/28330367
type: Comment
type: QuestionComment
has text: `e.sort(function (a, b) { return a.bdate < b.bdate; })`

http://stackoverflow.com/q/28436851
has answer: http://stackoverflow.com/a/28437294
type: AnsweredQuestion
downvote count: 0
accepted answer: http://stackoverflow.com/a/28437294
tagged with: javascript
score: 1
tagged with: facebook-graph-api
favorite count: 0
type: Question
tagged with: facebook
has body: what happens when a Facebook page is queried for its feed with Facebook Graph API (JS SDK) and a URL parameter fields (like for the post object) is added? I would like to load from the feed only the posts id's, shares, likes and comments, because the page is pretty active and the text data in JSON for 2 days is about 2MB (25 items)... I would hope one could do like this: FB.api('/SomePage?fields=id,shares,likes'), but I suppose the only fields you can access are the direct children (for feed, that is data &amp; paging)? If this unfortunately is the case, is there any other way to retrieve all posts from date x to date y without downloading the entire feed?
upvote count: 1
answer count: 1
has title: Querying FB Graph API feed with fields parameter?

http://stackoverflow.com/comment/45132297
comment on: http://stackoverflow.com/a/28398025
type: Comment
type: AnswerComment
has text: This is exactly what I was trying to do! Thank you. So basically the indices serve as the `var` name in a sense? Or is it bad to view it in that way?
score: 0

jquery-file-upload
tags question: http://stackoverflow.com/q/28434358
type: Tag
tags question: http://stackoverflow.com/q/28330097
tag name: jquery-file-upload
tags question: http://stackoverflow.com/q/28296289

http://stackoverflow.com/a/28314960
upvote count: 4
has comment: http://stackoverflow.com/comment/44980906
has comment: http://stackoverflow.com/comment/44979566
answers question: http://stackoverflow.com/q/28314942
downvote count: 0
score: 4
has body: It is because of event bubbling, so you stop it by calling Event.stopPropagation() $("#image_click").click(function (e) { e.stopPropagation(); alert("for image"); });
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44981028
type: Answer
accepted answer of: http://stackoverflow.com/q/28314942

http://stackoverflow.com/comment/44970948
type: AnswerComment
score: 0
type: Comment
has text: Perhaps the pollution of the global scope? And the waste to save something before it is ever used?
comment on: http://stackoverflow.com/a/28309887

http://stackoverflow.com/a/28329666
has body: I think this is what you are looking for... Check the fiddle: http://jsfiddle.net/rx4cm4q7/4/ $(function () { $("#slider").slider({ value: 0, min: 20, max: 45, step: (1.25), slide: function (event, ui) { console.log(ui); var id = $(this).attr("id"); var x = (ui.value - 20)/1.25; console.log(x); $("#amount").html("$" + ui.value); $("#step").html("&lt;B&gt;" +x+"&lt;/b&gt;"); } }); });
type: Answer
answers question: http://stackoverflow.com/q/28329361
score: 0

http://stackoverflow.com/a/28343819
type: Answer
downvote count: 0
score: 1
type: AcceptedAnswer
has body: this can be achieved using the tablesorter jquery plugin. Below is the html code - note that i have omitted jsp specific stuff since this is not relevant to the answer. Remember to download this plugin and place it in an accessible location Faculty name Budget seats Total Seats Faculty name Faculty budget seats Faculty total seats Smith 20 15 Doe 30 10 Bach 10 10 Conway 40 50
accepted answer of: http://stackoverflow.com/q/28340190
upvote count: 1
answers question: http://stackoverflow.com/q/28340190

http://stackoverflow.com/q/28345824
has comment: http://stackoverflow.com/comment/45035949
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/45036955
score: 0
has answer: http://stackoverflow.com/a/28347510
has comment: http://stackoverflow.com/comment/45036152
accepted answer: http://stackoverflow.com/a/28347510
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28345912
has body: I ve given up finding a crossbrowser image solution which makes me happy. I now want to make it the "mobile first" way of the cost of bandwith for destkops. The plan: Ship mobile sized images to all clients. Then i am able to get the viewport size of the browser which works fine. My CSS is switching as the follows: &lt;= 1000 px mobile view >=1001 desktop view. But then: I thought i would save images in the same paths with different file extensions. Lets say i would save them as the follows /img/myimage-mobile.jpg /img/myimage-normal.jpg /img/myimage-highres.jpg initial load would look like &lt;img src="img/myimage-mobile.jpg" alt="#" /&gt; Now my question: How can i get all img tags and change the extension of the src attribute? When detecting a viewport width >=1001 i want to replace all "-mobile.jpg" with "-normal.jpg" and larger ~1400 with "myimage-highres.jpg". Thats what i got so far: var w = Math.max(document.documentElement.clientWidth, window.innerWidth || 0) var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0) getting the viewport size and then i found this which is getting the entire src attribute: var images = document.getElementsByTagName('img'); var srcList = []; for(var i = 0; i &lt; images.length; i++) { srcList.push(images[i].src); srcList.push(images[i].src); }
has answer: http://stackoverflow.com/a/28345912
has title: Modifying all images (src) without id on page after onload
type: Question

http://stackoverflow.com/comment/45183320
comment on: http://stackoverflow.com/a/28419686
has text: OK, I see; difficult to do this without trying - so if you know which column you're going to use this for, try `options.model.set("Category", this.dataItem());` (you could also make it generic by passing the actual field through a closure, or you could `options.field.split(".") ` and use the first part)
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28356774
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/45057141
type: Question
score: 0
has comment: http://stackoverflow.com/comment/45057897
tagged with: ruby-on-rails
has title: Binding to ajax:success Rails
has comment: http://stackoverflow.com/comment/45057568
has body: I have the following HTML form in my Rails app: #views/foods/index.html.erb &lt;%= form_tag foods_path, remote: true, method: :get do %&gt; &lt;p&gt; &lt;%= text_field_tag :search, params[:query] %&gt; &lt;%= submit_tag "Aminoize!", name: nil %&gt; &lt;/p&gt; &lt;% end %&gt; My controller is set up to respond to the AJAX request with JSON: #controllers/foods_controller.rb def index if params[:search] @foods = Food.search(params[:search]) render json: @foods end end I want to handle the response with my client side Javascript, thus I am attempting to bind to the ajax:success event like so: #foods/views/index.js.erb $('#search').on('ajax:success', function(data) { alert("This works!"); //eventually do something with data here }); And my server log indicates the server is responding with 200: Started GET "/foods?utf8=%E2%9C%93&amp;search=edamame" for 127.0.0.1 at 2015-02-05 16:38:37 -0800 Processing by FoodsController#index as JS Parameters: {"utf8"=&gt;"✓", "search"=&gt;"edamame"} Food Load (1.0ms) SELECT "foods".* FROM "foods" WHERE (name @@ '%edamame%') Completed 200 OK in 21ms (Views: 0.2ms | ActiveRecord: 5.7ms) However, my alert is never triggering. I figure I must be binding to the AJAX event incorrectly, but I am unsure why. Thanks for your help.
answer count: 0

http://stackoverflow.com/q/28319572
has answer: http://stackoverflow.com/a/28319742
downvote count: 1
type: Question
upvote count: 0
tagged with: arrays
tagged with: javascript
tagged with: jquery
score: -1
has body: I am getting this error: Error: Syntax error, unrecognized expression: #mas137-0-0-0-1|2|7|9|13 in the script below. I don't understand why "ID" can not be "137-0-0-0-1|2|7|9|13". I use "|" delimiter because there are other conflicts if I use "," or ":". $(document.body).on('click','.load_more_posts',function() { var ID = $(this).attr("id"); if(ID) { $("#mas"+ID).html('&lt;img src="/images/loading.gif" /&gt;'); $.ajax({ type: "POST",url: "/show_more.php",data: "vid="+ ID, cache: false, success: function(html){ $("#mas"+ID).remove(); $("div#posts").append(html); }}); } else { $(".masw").html('-'); } return false; });
has title: Jquery unrecognized expression error
linked to: http://stackoverflow.com/q/12306252
accepted answer: http://stackoverflow.com/a/28319742
answer count: 1
duplicate of: http://stackoverflow.com/q/12306252
favorite count: 0
has comment: http://stackoverflow.com/comment/44988022
type: AnsweredQuestion

http://stackoverflow.com/q/28326912
has comment: http://stackoverflow.com/comment/45001448
has answer: http://stackoverflow.com/a/28330064
type: AnsweredQuestion
has title: IE8 - "object doesn't support this property or method" on minified return statement
type: Question
tagged with: internet-explorer-8
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45005529
score: 0
has comment: http://stackoverflow.com/comment/45005580
accepted answer: http://stackoverflow.com/a/28330064
answer count: 1
has comment: http://stackoverflow.com/comment/45001384
has body: I have a function that simply gets the query params of a url from a string. (I use it to tweak the src attr on an iframe). Heres the function: getQueryParameters : function (str) { 'use strict'; var params; if (!/\?.+/.test(str)) { return {}; } params = (str || document.location.search).replace(/(.+\?)/, ''); params = params.split('&amp;'); params = params.map(function (param) { param = param.split('='); this[param[0]] = param[1]; return this; }.bind({}))[0]; return params; } Everything works fine both minified and unmified in all browsers except IE8. In IE8 I get this error: object doesn't support this property or method It points me to the minified code here: return/?.+/.test(a)?(b=(a||document.location.search).replace(/(.+?)/,""),b=b.split("&amp;"),b=b.map(function(a){return a=a.split("="),this[a[0]]=a[1],this}.bind({}))[0]):{}}}); Any idea as to why? A lot of the other SO questions with this error are, like this one, specific. I cant seem to figure it out and I will appreciate the help. Thanks

http://stackoverflow.com/comment/45050515
comment on: http://stackoverflow.com/a/28353360
type: Comment
type: AnswerComment
has text: You'll have to ask @ChristiamMercado about it. It's his code, I just added a `session_start()` :)
score: 0

http://stackoverflow.com/comment/44951076
comment on: http://stackoverflow.com/a/28299406
type: Comment
score: 0
has text: Yeah, instead of striping `a` it remove tags, I don't find the best regex to do so! :(
type: AnswerComment

http://stackoverflow.com/comment/45288135
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28437544
has text: The Cypress project has a discussion forum. It is meant for discussions related to the Cypress software but since the software has such a central role in certification the forum can often be a good place to ask for direction or more general questions. They also host bi-weekly tech talks with a question and answer periods which are suited guidance questions. https://groups.google.com/forum/#!forum/project-cypress-talk
type: AnswerComment

http://stackoverflow.com/q/28388446
has comment: http://stackoverflow.com/comment/45114628
type: Question
has comment: http://stackoverflow.com/comment/45114481
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45114727
has body: I am using two values for 1 input box, when user selects multiple boxes the values will be submitted to submit_checkbox.php. I want to save the 2nd value i.e value after "|" sign in the php form. How can I do it ? My code is as follows :- Select option A B C And in "submit_checkbox.php" the code is as follows :- <?php $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = 'root1'; $conn = mysql_connect($dbhost, $dbuser, $dbpass); mysql_select_db("my_db") or die(mysql_error()); list($value1,$value2)=explode('|',$_POST['qq1']); $values=implode(',', $value2); $sql = "INSERT INTO print_chk VALUES ('$values')"; $retval = mysql_query( $sql, $conn ); if(! $retval ) { die('Could not enter data: ' . mysql_error()); } else { echo "Success"; } ?> However, I am unable to put the 2nd value in the sql table "print_chk".
has comment: http://stackoverflow.com/comment/45114885
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/28388788
has comment: http://stackoverflow.com/comment/45114803
tagged with: php
has comment: http://stackoverflow.com/comment/45114618
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45114638
has comment: http://stackoverflow.com/comment/45114547
accepted answer: http://stackoverflow.com/a/28388788
has comment: http://stackoverflow.com/comment/45114432
has comment: http://stackoverflow.com/comment/45114774
score: 0
tagged with: mysql
has title: 2 values for a single input box and storing the 2nd value in php

http://stackoverflow.com/a/28303719
has comment: http://stackoverflow.com/comment/44994458
score: 1
answers question: http://stackoverflow.com/q/28302995
upvote count: 1
has body: As @DoctorMick said, it's better to "separate logic from view" I made a snippet on jsfiddle with your needs, hope this helps. {{tab}} {{cell}} var app = angular.module('App', []); app.controller('Ctrl', function ($scope) { var SideNavItems = [ ["Parent Section 1", "Parent Section 2"], ["Parent Section 3", "Parent Section 4"] ]; $scope.tabs = ['tab1', 'tab2', 'tab3']; $scope.updateSideNavItems = function updateSideNavItems(index) { $scope.currentIndex = index; if (index === 0) $scope.SideNavItems = SideNavItems[0]; else if (index === 1) $scope.SideNavItems = SideNavItems[1]; else $scope.SideNavItems = [].concat.apply([], SideNavItems); } // defaults $scope.currentIndex = 0; $scope.updateSideNavItems($scope.currentIndex); });
has comment: http://stackoverflow.com/comment/44988370
downvote count: 0
has comment: http://stackoverflow.com/comment/44964553
type: Answer

http://stackoverflow.com/comment/45066361
type: Comment
type: AnswerComment
has text: Ah, gotcha! Thanks for the fiddle too!
score: 0
comment on: http://stackoverflow.com/a/28361545

http://stackoverflow.com/a/28353307
answers question: http://stackoverflow.com/q/28352767
has comment: http://stackoverflow.com/comment/45051124
downvote count: 0
type: Answer
has body: If you observe your for loop for(i=0; i&lt;region.length;i++) { document.getElementById("results").innerHTML = region[i]["101"]["name"] + " // " + region[i]["103"]["name"]; } You are trying to accessing id "103" for i = 0; id "103" doesn't exist, so you get the TypeError. You could use object enumeration (iterate over object properties), like this: function foo(region) { var name = ''; for(var i = 0; i &lt; region.length; i++) { for(var o in region[i]) { if (region[i].hasOwnProperty(o)) { //check for o[id] == 101? name += region[i][o]['name']; } } } document.getElementById("results").innerHTML = name; } foo(region);
score: 1
upvote count: 1

http://stackoverflow.com/q/28280281
upvote count: 1
has body: I have seen an answer on how to filter to "not null" but I need to know how to achieve a match on "not blank" instead. I've tried $scope.sortedFieldsFilter = { SortMode: '!' } $scope.sortedFieldsFilter = { SortMode: "'!'" } $scope.sortedFieldsFilter = { SortMode: !'' } And every other combination I can think of.
score: 1
linked to: http://stackoverflow.com/q/24991197
type: Question
has title: AngularJS filter not blank
has comment: http://stackoverflow.com/comment/44914823
tagged with: javascript
tagged with: filter
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28280391
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/comment/45097194
comment on: http://stackoverflow.com/a/28378678
type: Comment
has text: its working fine ie8.. but i just confused to try in my page.
score: 0
type: AnswerComment

http://stackoverflow.com/a/28313056
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45135559
answers question: http://stackoverflow.com/q/28313041
upvote count: 2
has body: Your code does not properly close out the config object parameter of the $.ajax function. You need an extra } on the last line: $.ajax({ type: 'GET', url: fburl, dataType: 'json', success: function (data) { . . . }, complete: function () { alert('done'); } // your code only closed out this function }); // and not this object
score: 2

http://stackoverflow.com/a/30488009
answers question: http://stackoverflow.com/q/28390802
has body: You can use insertHTML editorInstance.composer.commands.exec("insertHTML", "HTMLToInsert"); Hope it helps.
score: 1
downvote count: 0
type: Answer
upvote count: 1

http://stackoverflow.com/comment/45114977
type: AnswerComment
type: Comment
has text: Are you sure you have any categories with the column `cat_id` set to the selected category id? Your code looks fine apart from the issues we identified above.
comment on: http://stackoverflow.com/a/28388526
score: 0

http://stackoverflow.com/comment/45070195
has text: The CSS doesn't seem to be the issue (nor the JS) as the HTML that's supposed to load doesn't actually load. It looks like it's loading an older version of the page where I had messed up by trying to nest two forms.
type: Comment
comment on: http://stackoverflow.com/a/28364129
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45149892
score: 0
has text: @BenoitEsnard Chrome 40 but it's not the problem here. ;)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28407388

http://stackoverflow.com/comment/45105440
has text: If that is your solution/answer to your question, please post it as an answer and [accept it](http://meta.stackoverflow.com/questions/5234/how-does-accepting-an-answer-work).
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28371976

http://stackoverflow.com/comment/45033709
has text: A few years back (2007) Steven Levithan created a cross browser `String.prototype.split` and it can be found https://gist.github.com/slevithan/2048056
comment on: http://stackoverflow.com/q/28342156
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28298587
score: 3
has body: The easiest way is to use a single bit value, starting with 1 and shift that bit 'left' until its value is greater than the value to check, comparing each bit step bitwise with the value. The bits that are set can be stored in an array. function GetBits(value) { var b = 1; var res = []; while (b &lt;= value) { if (b &amp; value) res.push(b); b &lt;&lt;= 1; } return res; } console.log(GetBits(129)); console.log(GetBits(77)); console.log(GetBits(255)); Since shifting the bit can be seen as a power of 2, you can push the current bit value directly into the result array. Example
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28298374
downvote count: 0
answers question: http://stackoverflow.com/q/28298374
type: Answer
upvote count: 3

http://stackoverflow.com/comment/45051716
has text: @Josh: Oh, it would have been clear enough to us if you just pasted the error message in your comment :-) Regardless, Felix already told you: `var map = new iso.Map(); map.create()`
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28353646
score: 0

http://stackoverflow.com/q/28392449
type: Question
has title: OO Javascript child object access to parent properties
tagged with: javascript
score: 0
answer count: 1
has body: I am building an app which has an array of objects within an object which it's self is in an array. I want to be able to access the parent object's properties from the child object. I know I can simply reference the parent by it's index like so : var parents = [new parent()]; var parent = function() { this.index = 0; var children = [new child(this.index)]; } var child = function(parentId) { this.parent = parents[parentId]; } But I want to know if there is a better/ more OO way of doing it?
has answer: http://stackoverflow.com/a/28392512
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45121752
has comment: http://stackoverflow.com/comment/45121762

http://stackoverflow.com/a/28387398
type: Answer
score: 5
upvote count: 5
has body: document.getElementsByClassName returns an array-like list (an HTMLCollection, to be exact) of all elements that match the class name. You probably care about the first element, so try using the following instead: var showMenu = document.getElementsByClassName( 'showMenu' )[0], If you care about all of the elements, you'll need to loop through the elements: var showMenu = document.getElementsByClassName( 'showMenu' ), // ... for ( var i = 0; i &lt; showMenu.length; ++i ) { showMenu[i].addEventListener( clickevt, function( ev ) { // Your code here }); }
answers question: http://stackoverflow.com/q/28387375
downvote count: 0

http://stackoverflow.com/comment/45175473
type: AnswerComment
type: Comment
has text: thx it works. Just, for those coming after, you forgot the char "+" after var2 and var3 in the OAjax.send(). And then it works all good. Thx
comment on: http://stackoverflow.com/a/28402815
score: 0

http://stackoverflow.com/comment/44984929
has text: @maheshkajale: then simply use `my_fun.call(this);` instead of `my_fun();` ... one neat way to clone/mask an event handler is using my_fun.apply(this, arguments); which invokes any function as though it were the bound handler...
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28317431
score: 0

http://stackoverflow.com/comment/44932159
has text: Yes I have jQuery Mobile included below the jQuery script.
comment on: http://stackoverflow.com/q/28288904
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45075986
comment on: http://stackoverflow.com/q/28367353
type: QuestionComment
has text: You probably should do your own validation -- unfortunately, there's inconsistencies in the way non-standard date formats are handled by browsers.
type: Comment
score: 1

http://stackoverflow.com/q/28288685
accepted answer: http://stackoverflow.com/a/28290086
has title: How to turn a decimaled number into a framerate designation in javascript
type: Question
tagged with: decimal
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28290086
has body: I am using the flowplayer video player and a flowplayer function is giving me a decimal for the point on the player timeline. i.e. Instead of giving me a traditional: 00:00:01:03 timestamp, it just gives me 1.03333 or the equivalent. The .033333 essentially serves as the frames although I believe it is, in that case based on a 10 fps framerate (which is fine for what I am doing.) I am not skilled at all in working with numbers/decimals in JS. How can I convert that 1.033333 into a timestamp like 00:00:01:03?
type: AnsweredQuestion

http://stackoverflow.com/comment/45050171
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28332604
type: Comment
has text: well, it was worth a shot, looks like the error message your are getting is from this [code](https://github.com/knockout/knockout/blob/master/src/components/defaultLoader.js) . I would try using the debug version of knockout and put a breakpoint here, then follow the stack trace and see if reveals anything more. If you don't have your heart set on knockout components you can also try using the built in [widget support](http://durandaljs.com/documentation/Creating-A-Widget.html) in durandal, it is very similar to ko components

http://stackoverflow.com/a/28287608
has comment: http://stackoverflow.com/comment/44929044
has comment: http://stackoverflow.com/comment/44929201
has body: I'd use a regex: // catch `bar:` at the beginning of the string, or // :bar: elsewhere var matches = string.match(/(?:^|:)bar:([^:]+):/); var newString = matches[1]; var string = 'foo:bar:1234:something:4321'; var matches = string.match(/(?:^|:)bar:([^:]+):/); var newString = matches[1]; console.log(newString); string = 'bar:1234:something:4321'; console.log(newString);
has comment: http://stackoverflow.com/comment/44929597
downvote count: 0
answers question: http://stackoverflow.com/q/28287532
type: Answer
has comment: http://stackoverflow.com/comment/44929113
has comment: http://stackoverflow.com/comment/44929701
score: 2
has comment: http://stackoverflow.com/comment/44929626
upvote count: 2

http://stackoverflow.com/a/28398347
type: Answer
upvote count: 3
has body: According to this article ES6 modules spec only deals with loading modules that are present in the file path. Downloading these files (via NPM or by other means) is outside of scope of ECMAScript 6 modules spec. Nothing is said in the spec about supporting npm package includes (traversing the directory structure down to the /, one directory at a time, looking for a package.json file and then searching within the node_modules directory where package.json file is found). So while the import syntax is similar to commonJS style, the whole magic of looking for modules in the node_modules directory is not included. So for your example to work, aurelia-framework must be a javascript file somewhere in your file system and it should contain an exports statement. import {LogManager} from 'aurelia-framework'; // ./aurelia-framework.js import {LogManager} from '../libs/aurelia-framework'; // ../libs/aurelia-framework.js
accepted answer of: http://stackoverflow.com/q/28387775
answers question: http://stackoverflow.com/q/28387775
score: 3
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/28404999
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 3
accepted answer of: http://stackoverflow.com/q/28292392
upvote count: 3
answers question: http://stackoverflow.com/q/28292392
has body: Take a look on this library: https://github.com/btmills/geopattern This is a JavaScript port of jasonlong/geo_pattern with a live preview page and is derived from the background generator originally used for GitHub Guides. Usage Include the minified script. jQuery is optional. &lt;script src="js/jquery.min.js"&gt;&lt;/script&gt; &lt;!-- optional --&gt; &lt;script src="js/geopattern.min.js"&gt;&lt;/script&gt; Use either the GeoPattern browser global or the jQuery plugin: // Use the global... var pattern = GeoPattern.generate('GitHub'); $('#geopattern').css('background-image', pattern.toDataUrl()); // ...or the plugin $('#geopattern').geopattern('GitHub');

http://stackoverflow.com/comment/45069871
type: QuestionComment
has text: This is really weird. Are you sure your code is fine? Can you reproduce this issue @ jsfiddle.net ?
comment on: http://stackoverflow.com/q/28364145
score: 0
type: Comment

http://stackoverflow.com/a/28390980
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28390946
has body: Try using absolute path. In case of failure, keep the image file in public/images directory. and use this address: &lt;img src="http://localhost:3000/images/Heading.png" /&gt;
has comment: http://stackoverflow.com/comment/45119296
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/45119319

http://stackoverflow.com/q/28281637
type: Question
has answer: http://stackoverflow.com/a/28284012
tagged with: canvas
tagged with: javascript
has body: Hello i make like a paint with undo function, i write all coordinates in array and then try undo just redrawing without last coordinates but problem while i redrawing my canvas parameters incorrect. i use lineJoin = "roind" but after redrawing i see without round.. this result with round line begin and line end while i drawing: this result without round begin and line end after undo function: I don't have idea where disappear my round lines while i redrawing all drawings coordinate by coordinate.. var canvas = document.getElementById('canvas'); var ctx = canvas.getContext('2d'); var points = []; var size = 10; var prevX = 0; var prevY = 0; var isCanDraw = false; $("#canvas").on("mousedown", function(e) { isCanDraw = true; prevX = e.clientX; prevY = e.clientY; points.push({x: prevX, y: prevY, size: size, mode: "begin"}); }); $("#canvas").on("mousemove", function(e) { if(isCanDraw) { stroke(e.clientX, e.clientY); points.push({x: prevX, y: prevY, size: size, mode: "draw"}); } }); $("#canvas").on("mouseup", function(e) { isCanDraw = false; points.push({x: prevX, y: prevY, size: size, mode: "end"}); }); $("#canvas").on("mouseleave", function(e) { isCanDraw = false; }); $("#undo").on("click", function(e) { deleteLast(); redraw(); }); function deleteLast() { if(points.length != 0) { var i = points.length - 1; while(points[i].mode != "begin") { i--; points.pop(); } points.pop(); } } function redraw() { ctx.clearRect(0, 0, canvas.width, canvas.height); if(points.length != 0) { for(var i=0; i &lt; points.length; i++) { var pt = points[i]; var begin=false; if(size != pt.size) { size = pt.size; begin=true; } if(pt.mode == "begin" || begin) { ctx.moveTo(pt.x, pt.y) } ctx.lineTo(pt.x, pt.y) if( pt.mode == "end" || (i == points.length-1) ) { ctx.lineJoin = "round"; ctx.stroke() } } } } function stroke(x,y) { ctx.lineWidth = size; ctx.lineJoin = "round"; ctx.beginPath(); ctx.moveTo(prevX, prevY); ctx.lineTo(x, y); ctx.closePath(); ctx.stroke(); prevX = x; prevY = y; } #canvas { bor…
answer count: 2
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28283614
has title: HTML5 canvas paint redrawing lineJoin not rounded
type: AnsweredQuestion
score: 2
upvote count: 2
possible better answer: http://stackoverflow.com/a/28284012
accepted answer: http://stackoverflow.com/a/28283614

http://stackoverflow.com/q/28435626
type: Question
has comment: http://stackoverflow.com/comment/45201988
tagged with: javascript
upvote count: 2
has comment: http://stackoverflow.com/comment/45202052
has comment: http://stackoverflow.com/comment/45202338
has comment: http://stackoverflow.com/comment/45202267
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has title: Parsing HTML from $http response losing href attributes
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45202459
has comment: http://stackoverflow.com/comment/45203122
tagged with: parsing
score: 2
answer count: 0
downvote count: 0
has body: I am having an issue parsing the HTML response of a $http.get(). I can get the raw HTML response and output it as a string to the console: ' portal portal To Parent Directory White stuff Green things Yellow wigits Blue Misc ' When I parse the HTML using DOMParser() and then query for all anchor tags within the pre tag it seems to be losing the href attributes. This is a simplified version of what I see in console.log($scope.data) at the end of the $http.get().success(). [a, a, a, a, a, item: function] 0: a ... href: "" ... As you can see in the Fiddle, the text data is conveying from the response HTML through the angular/javascript to the main page HTML just fine. Does anyone have any idea why I cannot parse out these href attributes for use in my main page? DEMO: JSFIDDLE HTML: {{link.text}} Javascript: var myApp = angular.module('myApp', []); myApp.controller('MyCtrl', ['$scope', '$http', function ($scope, $http) { $scope.data = []; $http.get('/my-api-call').success(function (data, status, headers, config) { //rather than posting my actual api link (not public yet) this is the data that is returned in the response var str = ' portal portal To Parent Directory White stuff Green things Yellow wigits Blue Misc '; var parser = new DOMParser(); var doc = parser.parseFromString(str, 'text/html'); $scope.data = doc.firstChild.querySelectorAll('pre a'); }).error(function (data, status, headers, config) { //handle $http error }); }]);

http://stackoverflow.com/a/28380350
accepted answer of: http://stackoverflow.com/q/28374879
upvote count: 1
answers question: http://stackoverflow.com/q/28374879
type: AcceptedAnswer
downvote count: 0
has body: Elsewhere here there is a tip on ensuring that .on('click') events only fire once: $(element).off().on('click', function() { // function body }); Try that.
type: Answer
has comment: http://stackoverflow.com/comment/45103639
score: 1

http://stackoverflow.com/a/28321542
downvote count: 1
type: Answer
score: 1
answers question: http://stackoverflow.com/q/28321021
upvote count: 2
has body: You can use JSON.stringify() to convert the objects to string. Just try it out $request = {"request_id":"aaaa", "reqName":"bbbb", "reqSubject":"ccc"}; alert(JSON.stringify($request.request_id));

http://stackoverflow.com/q/28366664
type: AnsweredQuestion
has body: I'm looking to get what I thought would be a simple script to run an AJAX call and keep various values stored to an object, but I cannot get the globals to remain consistent the way I would expect. I've gone around in circles trying what I think is everything. As soon as I put the AJAX call in I can't get it to play nicely with the global variables. The process value is always false that way and the content never loads in. ExtContent = function(){ var self = this; this.init = function() { self.output = null; self.process = false; }; this.request = function(url){ $.ajax({ type : 'GET', timeout : 10000, dataType : 'html', url : url, passself : self, success : function(response){ this.passself.setoutput(response); }, error : function(req,response){ if(response==='error'){ self.error=req.statusText; } } }); }; this.setoutput = function(data){ this.output = data; this.process = true; }; this.returnprocess = function(){ return self.process; }; this.returnoutput = function(){ return self.output; }; self.init(); }; &lt;div id="holder"&gt;&lt;/div&gt; loadcontent = new ExtContent(); loadcontent.request('/test.html'); if(loadcontent.returnprocess()){ $('#holder').before(loadcontent.returnoutput()); }else{ $('#holder').before('FAILED'); } I can't get the process to be true and the content to be stored in output. Thanks.
has answer: http://stackoverflow.com/a/28367210
has answer: http://stackoverflow.com/a/28367165
type: Question
has comment: http://stackoverflow.com/comment/45074838
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/28367210
has title: jQuery object, inconsistent global variables and AJAX call
tagged with: ajax
has comment: http://stackoverflow.com/comment/45076973
accepted answer: http://stackoverflow.com/a/28367165

http://stackoverflow.com/a/28387661
has comment: http://stackoverflow.com/comment/45112947
has body: Basically, you have these options: You precondition the data so it's easier to access and all intermediate objects you rely on are guaranteed to exist. You create a function that manages testing each piece of that path for you to avoid creating errors and return whatever default value you want if any part of the path doesn't exist. You test every single piece of every path that might not exist before you use it. This generally involves using an access function that accepts a path as a string such as getValue("purchaseorder.shipTo.zip") and a function that they breaks apart that string and accesses it one piece at a time. This changes the way you write ALL the code that accesses the data to go through this function and executes significantly slower. You use exception handling to catch the paths that don't exist and cause errors. In ES6, you could use a proxy to intercept requests for properties that do not exist and provide a default behavior. It is my opinion that preconditioning (perhaps on a copy of the data) leads to the easiest code for accessing the data. You combine all your code in one place to make sure that any data path you plan to access exists and perhaps even has a decent default value. Then, when you write the code to use this data, you don't have to worry about intermediate objects not existing and the access code can be simple and reliable. Here's a function that will make a copy of your original data, then precondition it to have all fields/values that are present in a shellPrototype data structure. I have used code like this for reading settings from a settings file and then merging in default values for missing properties. // recursive function to clone an object. If a non object parameter // is passed in, that parameter is returned and no recursion occurs. function clone(obj) { if (!obj || typeof obj !== 'object') { return obj; } var temp = obj.constructor(); // give temp the original obj's constructor for (var key in obj) { if (obj.hasOwnPropert…
has comment: http://stackoverflow.com/comment/45113156
has comment: http://stackoverflow.com/comment/45113499
has comment: http://stackoverflow.com/comment/45113202
score: 0
answers question: http://stackoverflow.com/q/28387605
has comment: http://stackoverflow.com/comment/45115258
has comment: http://stackoverflow.com/comment/45113164
has comment: http://stackoverflow.com/comment/45113107
has comment: http://stackoverflow.com/comment/45113384
type: Answer
has comment: http://stackoverflow.com/comment/45113747
has comment: http://stackoverflow.com/comment/45114017
has comment: http://stackoverflow.com/comment/45114172
has comment: http://stackoverflow.com/comment/45114392
has comment: http://stackoverflow.com/comment/45112984
has comment: http://stackoverflow.com/comment/45113310
has comment: http://stackoverflow.com/comment/45113061
has comment: http://stackoverflow.com/comment/45113209
has comment: http://stackoverflow.com/comment/45112899

http://stackoverflow.com/comment/45118862
comment on: http://stackoverflow.com/a/28390708
score: 0
type: AnswerComment
has text: What does this bot run on? Say for example, is it a user script. Is it something you paste into the console of a web browser or?
type: Comment

http://stackoverflow.com/a/28320814
has body: have you tried this? $(".datePickerImage").text('');
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28320667

http://stackoverflow.com/q/28393674
upvote count: 30
type: Question
tagged with: javascript
has title: jQuery not define in bootstrap module
accepted answer: http://stackoverflow.com/a/28884022
answer count: 1
favorite count: 0
score: 30
has comment: http://stackoverflow.com/comment/45123965
has body: I want to use bootstrap for my website (with node.js). But I have the following error : /var/www/node_modules/bootstrap/js/transition.js:59 }(jQuery); ^ ReferenceError: jQuery is not defined at Object. (/var/www/node_modules/bootstrap/js/transition.js:59:3) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (/var/www/node_modules/bootstrap/dist/js/npm.js:2:1) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) I tried to do a var bootstrap = require('bootstrap'); in my main node. I installed bootstrap with npm (npm install bootstrap from my folder). I also tried to instal jquery with the same way and to add a var jQuery= require('jquery'); but it does not work. Do you have any idea what could be wrong ? I am starting node.js, i may miss something Then I use &lt;link href="../node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"&gt; in my HTML webpage to refer to bootstrap `
has answer: http://stackoverflow.com/a/28884022
has comment: http://stackoverflow.com/comment/45123992
tagged with: node.js
type: AnsweredQuestion
downvote count: 0
tagged with: twitter-bootstrap

http://stackoverflow.com/q/28350913
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45045618
has body: I'm trying to create a Thermometer where I have an empty(white) stem and when getting a certain degrees Celsius, the stem fills up with mercury(red) by having two separate GRects(one white, the red one overlays the white). The trouble I'm having is that I can't make it seem like the mercury is filling up from the bottom. It either fills "down" starting at the top left corner going down like a normal GRect, or the red doesn't show up at all. I can't figure out how to invert the y coordinates so that it builds up instead of down..... Please help!! Thanks. This is what I have for the positioning of the stems: //Empty stem GRect stemwhite = new GRect(200, 50, 50, 300); stemwhite.setFilled(true); stemwhite.setFillColor(Color.WHITE); add(stemwhite); //Fill stem GRect stemred = new GRect(200, 50, 50, 300 * (tempC / 100); stemred.setFilled(true); stemred.setFillColor(Color.RED); add(stemred); tempC is the degrees Celsius that the user inputs. The only problem with this is the red is at the top of the white stem. I've tried a couple different things, like " -(300 * (tempC / 100); ", but nothing has worked yet.
tagged with: java
type: Question
has title: Java - Building GRect from the bottom left corner
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45046596

http://stackoverflow.com/a/28412035
has comment: http://stackoverflow.com/comment/45159736
has comment: http://stackoverflow.com/comment/45159770
answers question: http://stackoverflow.com/q/28411651
has body: You need to include jquery.js in your code. Try this, including the file from Google CDN:
score: 0
type: Answer

http://stackoverflow.com/q/28318875
downvote count: 0
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/9320658
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
upvote count: 2
type: UnansweredQuestion
score: 2
has body: Everytime someone clicks on parts of my website, I'd like to show a circle that becomes larger over time. I thought of doing it via a canvas. So far I managed to add circle to the position where the visitor clicked: Canvas Is it also possible to have those circles change their radius 1px per 100ms and disappear when their radius in larger than the canvas? Is it also possible to do this without a canvas?
has answer: http://stackoverflow.com/a/28319232
has answer: http://stackoverflow.com/a/28324171
type: Question
has title: How to add elements to a canvas that change over time?
answer count: 2
tagged with: canvas

http://stackoverflow.com/comment/44991632
type: Comment
comment on: http://stackoverflow.com/a/28321752
score: 0
type: AnswerComment
has text: What did you put in here?

http://stackoverflow.com/q/28396983
score: 0
has title: Is it possible to switch on JSLint checking in PhpStorm for Typescript files?
has body: Switching on JSLint code quality in PhpStorm only seems to work with js-files. Can I also switch it on for typescript (ts) files?
tagged with: phpstorm
answer count: 1
has answer: http://stackoverflow.com/a/28411659
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45132728
type: Question
tagged with: typescript
tagged with: jslint
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28411659

http://stackoverflow.com/q/28350598
score: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28888665
favorite count: 0
type: UnansweredQuestion
tagged with: android
tagged with: http://stackoverflow.com/tag/html
tagged with: google-street-view
has title: Integrating android street view and google map in my app
has body: I am new to android development. I am working on a project which uses android street view panorama and Google map I just noticed that there is no method in street view panorama for querying whether a street view exists in any location before searching for the panorama image, to prevent the app from crashing or showing black screen. Is there a solution to this problem. Again can I use Google map v3 javaScript api any where in android. You can give the best answer even if it involves learning javascript. Thanks in advance
upvote count: 1
downvote count: 1
type: Question
tagged with: google-maps-api-3

http://stackoverflow.com/a/28397466
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/28397414
upvote count: 2
has body: Why is it telling me that CustomAlert is undefined? I also attempted to assign CustomAlert() to a var but then the consol tells me that the var is now undefined?? Because you should create an object of this var customerAlert = new CustomAlert(); and then call the render method of it. Or in one statement: function HighScore( arg ) { new CustomAlert().render(); } This is called the Constructor Invocation Pattern. Actually in JavaScript functions can be invoked with one of the following ways: The method invocation pattern The function invocation pattern The constructor invocation pattern The apply invocation pattern Method Invocation pattern This method of invocation is used when the function is stored as a property of an object. Hence we call this function a method, like in other object oriented languages. When we call the function this is bound to the that object. For instance: var app = { render: function() { var winW = window.innerWidth; var winH = window.innerHeight; var dialogOverlay = document.getElementById('dialogOverlay'); var dialogbox = document.getElementById('dialogbox'); dialogOverlay.style.display = "block !important "; dialogOverlay.style.height = winH+"px !important "; dialogbox.style.left = (winW/2) - (550 * .5) + "px !important "; dialogbox.style.top = "100px !important "; dialogbox.style.display = "block !important"; } ok : function () { } }; In this case we would call the render method as below: app.render(); Function Invocation Pattern This is the case where the function is not the property of an object. In this case the function is bound to the global object -which usually is the window object in web applications-. var render = function(){ var winW = window.innerWidth; var winH = window.innerHeight; var dialogOverlay = document.getElementById('dialogOverlay'); var dialogbox = document.getElementById('dialogbox'); dialogOverlay.style.display = "block !important "; dialogOverlay.style.height = winH+"px !important "; dialogbox.style.left = (winW/2)…
type: Answer

http://stackoverflow.com/comment/45105461
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28372754
has text: @NicholasYoung I'm afraid that's a bit too vague. At what point in the process do you want to download the file? Using what as inputs? Is it just one file, or one file for each `output`? Etc., etc.
type: AnswerComment

http://stackoverflow.com/comment/45061417
score: 0
type: Comment
has text: Tell me if this is somewhere close to what you are looking for.
type: AnswerComment
comment on: http://stackoverflow.com/a/28359292

http://stackoverflow.com/q/28346196
accepted answer: http://stackoverflow.com/a/28346743
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45036759
has comment: http://stackoverflow.com/comment/45036764
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45036721
has comment: http://stackoverflow.com/comment/45037297
has answer: http://stackoverflow.com/a/28346638
has comment: http://stackoverflow.com/comment/45037087
type: Question
possible better answer: http://stackoverflow.com/a/28346638
has comment: http://stackoverflow.com/comment/45036601
has title: Dynamically search list of divs
tagged with: javascript
has comment: http://stackoverflow.com/comment/45037169
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28346743
tagged with: jquery
has body: I have a list of divs in the following structure - Html JS $(document).ready(function () { $("#searcher").on("keyup click input", function () { if (this.value.length > 0) { $(".secondDiv entryDiv").hide().filter(function () { return $(this).text().toLowerCase().indexOf($("#searcher").val().toLowerCase()) != -1; }).show(); } else { $(".secondDiv entryDiv").hide(); } }); }); What I have tried to do is use a search box - searcher using jquery so that on keypress the entryDivs are dynamically shown or hidden based on the id="colin" values of the inputs depending on what is typed. So if a user types in the letter "c" the two divs containing "colin" and "chris" would be left present however "zander" would be removed. If the search box was empty then the list defaults back to original view. Much like the example shown here.

http://stackoverflow.com/a/28345558
downvote count: 0
has comment: http://stackoverflow.com/comment/45035667
upvote count: 2
has comment: http://stackoverflow.com/comment/45036062
has comment: http://stackoverflow.com/comment/45035355
answers question: http://stackoverflow.com/q/28345398
has body: try with this: $(function(){ var bg = "http://i.imgur.com/kqRNO6M.jpg"; var html = '&lt;div style=\'background:linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.35)),url("'+ bg +'") no-repeat;\'&gt;'; }); and remember to append somewhere your html variable! :)
type: Answer
score: 2

http://stackoverflow.com/comment/44994643
type: Comment
type: QuestionComment
has text: is `AMIdownload` supposed to be a `javascript` function? You can't assign a `php` function to an `onclick` event
comment on: http://stackoverflow.com/q/28323345
score: 0

http://stackoverflow.com/a/28434622
has body: Try adding this at the end of your script: d3.selectAll("label") .data(brands) .append("text") .text(function(d) { return d; }); And delete these lines: .attr("for", function(d) { return d; }) .text(function(d) { return d; }) You don't need to re-select the input. After the .append("input") add the listener: .append("input") .on('change', function() { renderValues(this.value); })
answers question: http://stackoverflow.com/q/28433997
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45199475
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28433997

http://stackoverflow.com/comment/45154400
type: Comment
has text: I think I should've explained the "post title"; that's a Wordpress post title, not entering the address in a field ;). Your solution also doesn't work for me. No map by default, and when I enter the details, the map turns blue for a moment before reloading the page and showing nothing. At least thanks for trying to solve it!
comment on: http://stackoverflow.com/a/28401868
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45207810
score: 0
comment on: http://stackoverflow.com/q/28436535
type: Comment
has text: @Oriol In the code, there is a test for history capability via Modernizr. If true: hijackURLs() is called. In IE9, when I call `hijackURLs()` outside of any condition, nothing happens—the link neither loads in place nor loads the parent site.
type: QuestionComment

http://stackoverflow.com/comment/44931587
score: 0
type: QuestionComment
type: Comment
has text: You have extra commas in your `$scope.selects`. You wrote this `{terms: 'Advertising | Web',},` but you want to write `{terms: 'Advertising | Web'},`
comment on: http://stackoverflow.com/q/28287870

http://stackoverflow.com/comment/45262995
type: Comment
score: 0
has text: Congratulations on achieving 10K...Nice!
type: AnswerComment
comment on: http://stackoverflow.com/a/28455790

http://stackoverflow.com/comment/45051221
type: AnswerComment
has text: this doesn't fix the major problem I'm having which is that the directive looses functionality once I remove it. But thanks for your response.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28352865

http://stackoverflow.com/comment/45153090
type: AnswerComment
has text: I'm actually writing a chrome extension, and I think I just have to add this to the code : "permissions": ["http://www.reddit.com / *"]. The functions work correctly except for media:thumbnail
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28409789

http://stackoverflow.com/q/28313794
has comment: http://stackoverflow.com/comment/44977589
upvote count: 1
answer count: 1
has body: So I found this technique as a workaround for a global .remove() method in all browsers. a.outerHTML =''; delete a a = your element. My issue.. this is very confusing to me because it only works if I use outerHTML = '';. But, the delete operator says here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/delete It's only for deleting a property from a object? So, (this might be a silly question), but when setting a.outerHTML does that convert it into a deletable object then? How? Edit: I almost feel like I should delete this question because it may sound so stupid, but I am evidently lost :P
has answer: http://stackoverflow.com/a/28313829
tagged with: javascript
type: AnsweredQuestion
has title: Delete Operator Confusion
downvote count: 0
accepted answer: http://stackoverflow.com/a/28313829
score: 1
favorite count: 0
type: Question

http://stackoverflow.com/q/28289132
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28289848
score: 0
answer count: 1
tagged with: textures
tagged with: asynchronous
tagged with: three.js
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/3076414
tagged with: image
has body: I have modified an official example for the Loader object to demonstrate my issue. I want to create a mesh, with a texture map that gets loaded preferably before creating the geometry. Currently I have the issue, that local files load just fine, but not remote ones. See the behaviour in action: working demo (local): http://nylkiway.net/loadertest_local.html not working demo (remote): nylkiway.net/loadertest_remote.html Using the loader to load a locally saved .jpg the texture shows up fine on the final mesh, as can be seen in the working demo: three.js webgl - loaders - OBJ loader three.js - image loader test However, when loading the same image from a remote server, the texture gets loaded, or atleast I think it does, because the images width etc. is accessible in the onLoad() callback. But I get errors and the mesh doesnt render. Uncomment the line to: loader.load( 'http://nylkiway.net/avatar.jpg', function ( image ) { I get numerous errors: "THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter is set to THREE.LinearFilter or THREE.NearestFilter. ( undefined )" Although the image is exactly the same, and my little debug output returns the image dimensions: console.log("debug. image size: " + image.width + " X " + image.height ); "debug. image size: 460 X 460" I do not think this is a CORS issue, as the callback for finished image loading gets called. The images properties are readable as well. I feel, like this must be a frequent question, I searched but didn't really get a fitting answer. I don't think it has anything to do with the images dimensions not being a power of 2, as the locally loaded image shows just fine as a texture. Any help would be appreciated!
type: Question
has title: three.js: local texture loading works, but not remotely
has answer: http://stackoverflow.com/a/28289848

http://stackoverflow.com/a/28316693
answers question: http://stackoverflow.com/q/28316629
has comment: http://stackoverflow.com/comment/44982469
has body: You have a syntax error, it should be this: echo ''; Also if your value is a string value you need to use quotes: echo '';
upvote count: 1
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28316629
has comment: http://stackoverflow.com/comment/44982401
downvote count: 0
score: 1

http://stackoverflow.com/comment/44953547
score: 0
type: Comment
type: QuestionComment
has text: Updated the question, onclick event added
comment on: http://stackoverflow.com/q/28300923

http://stackoverflow.com/comment/45120827
type: Comment
comment on: http://stackoverflow.com/q/28391898
score: 0
has text: Did you get any error in console?
type: QuestionComment

http://stackoverflow.com/a/28426728
has body: We are removing data from Kendo datasource not from database. Our working Code is if ($('#tblEligibleEmployees').data('kendoGrid').dataSource._data.length == 0) { $('#tblEligibleEmployees').data().kendoGrid.destroy(); return false; } On getting length 0 from kendo datasource destroying kendo grid.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28405046

http://stackoverflow.com/comment/45896224
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28389892
has text: Note: Due to a bug with `body`, it is best/safest to attach delegated event handlers to `document` *as the default* (if no ancestor is closer/convenient).

http://stackoverflow.com/q/28324609
answer count: 1
accepted answer: http://stackoverflow.com/a/28325414
has comment: http://stackoverflow.com/comment/44997505
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
score: 1
has title: How to test .notify for .then in angularjs
has comment: http://stackoverflow.com/comment/44997586
type: Question
has comment: http://stackoverflow.com/comment/44997139
favorite count: 0
tagged with: deferred
has answer: http://stackoverflow.com/a/28325414
has comment: http://stackoverflow.com/comment/44997208
tagged with: angularjs
tagged with: angular-promise
has comment: http://stackoverflow.com/comment/44997458
has body: In this post function var deferredRespond = $q.defer(); var statusNotice="Loading..."; deferredRespond.notify(statusNotice); $http.post(processorUrl,{ params:request, }).success(function(respondData){ //deferredRespond.resolve(respondData); /*For Test Rejected Defer! -awh*/ deferredRespond.resolve($q.reject("Simulated Reject")); //deferredRespond.resolve($q.notify("Simulated LOADING...")); }) .error(function(){ deferredRespond.reject('Failed defer!'); }); I am able to simulate .reject by doing .resolve($q.reject But I wonder why I can not test the .notify by doing .resolve($q.notify (it will return error of undefined)? Is there some other way I can test the .notify? Thank You
upvote count: 1

http://stackoverflow.com/q/28429069
type: Question
tagged with: javascript
score: 0
has body: I am drawing an axis and a clickable circle using d3, the circle is enclosed by the axis. I have a HTML file, which calls two Javascript-files to draw them separately. However, my circle's svg is covered by the axis' and cannot be clicked. Are there anyway I can set circle's svg on the top?
answer count: 1
has title: How to access a svg underneath another one?
has comment: http://stackoverflow.com/comment/45189387
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
has answer: http://stackoverflow.com/a/28432108
accepted answer: http://stackoverflow.com/a/28432108

http://stackoverflow.com/a/28395821
type: AcceptedAnswer
has body: Change the buttons onclick to include "return false;". At the moment the button is causing the page to reload after running your script. Valeurs par défaut or if you specify the type of your button to be a button (as opposed to submit, which might be the browsers default) then the button won't cause a refresh. Valeurs par défaut
accepted answer of: http://stackoverflow.com/q/28395667
type: Answer
answers question: http://stackoverflow.com/q/28395667
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/a/28378332
type: Answer
has comment: http://stackoverflow.com/comment/45161932
has comment: http://stackoverflow.com/comment/45097217
score: 1
has comment: http://stackoverflow.com/comment/45096746
upvote count: 1
has comment: http://stackoverflow.com/comment/45295759
has comment: http://stackoverflow.com/comment/45295777
has body: JavaScript has many choices, so it confused me for quite a while, but ultimately I ended up embracing it as something new and disregarding any OOP knowledge I had. For example, take Format 1 and 2 you described above. This isn't equal to classes in other languages, but is similar in the fact that it encapsulates some "thing" in your program. You should always wrap your code in at least one function to ensure your variables are never in the global scope to avoid conflicting names with other programmers. Look up "IIFE" for more details. I generally create my objects that are simply there to move data amongst my application using the object literal notation. var student = { firstName: "Bob", age: 20 }; And stick to prototypical inheritance if my objects will need any functions like Format 4 because it offers more flexibility. Regardless of what format you decide to follow, an IIFE is important. And forget about the word "Class" and embrace the modular pattern, it is very similar but different. It's like trying to use Git like SVN. Here is an example of a printModule and a module making use of it. Notice ModuleB can replace the current printModule with another one easily simply by passing a different object into moduleB. The way I use the exports variables varies depending on the person. http://jsfiddle.net/0zuo1w4d/1/
downvote count: 0
has comment: http://stackoverflow.com/comment/45097095
answers question: http://stackoverflow.com/q/28378226

http://stackoverflow.com/a/28425231
has body: parameter interpolation quotes and escapes the parameters for use in sql statements, and does not insert barewords into the sql code. So the generated sql would look something like UPDATE PILE SET 'category1' = COALESCE( ... which is a syntax error.
downvote count: 0
answers question: http://stackoverflow.com/q/28425010
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/a/28375877
accepted answer of: http://stackoverflow.com/q/28375847
has comment: http://stackoverflow.com/comment/45092400
answers question: http://stackoverflow.com/q/28375847
has comment: http://stackoverflow.com/comment/45092028
has body: isNaN returns a boolean and your comparing it to numbers. you'll want to compare x to your range. if(z || x&lt;1 || x&gt;10) Here is how I would clean up your code a bit function alpha(){ //name your variables something meaningful var userInputField = document.getElementById('input1'); //using parse int tells yourself and future programmers you want an int //it also gives you NaN if it's not a number so you don't have to check yourself //the 10 is the radix you want to convert to var userInputedValue = parseInt(x.value,10); //check explicitly for NaN will save you some headaches if(userInputedValue === NaN || userInputedValue&lt;1 || userInputedValue&gt;10){ console.log("Invalid"); } else { console.log("valid"); } }
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45092120
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45092511

http://stackoverflow.com/a/64983387
answers question: http://stackoverflow.com/q/28295072
score: 17
downvote count: 0
type: Answer
has body: The formula goes like this px in vw: 100 * px / windowWidth px in vh: 100 * px / windowHeight vh in px: windowHeight * vh / 100 vw in px: windowWidth * vw / 100 Some code for inspiration: (I'm a JS noob though) function viewport_convert(px = 0, vw = 0, vh = 0){ if(px != 0){ if(vw){ return (100 * px / window.innerWidth); } else { return (100 * px / window.innerHeight); } } else if(vw != 0 &amp;&amp; vh != 0){ var w_h_arr = []; w_h_arr["width"] = Math.ceil((window.innerWidth * vw / 100)); w_h_arr["height"] = Math.ceil((window.innerHeight * vh / 100)); return w_h_arr; } else if(vw != 0){ return Math.ceil((window.innerWidth * vw / 100)); } else if(vh != 0){ return Math.ceil((window.innerHeight * vh / 100)); } }
upvote count: 17

http://stackoverflow.com/a/28341568
type: Answer
score: -1
downvote count: 1
has body: Question 1: Is it possible to use a controller per template ? Ans: Yes. Its very simply. How, is shown in next answer. Question 2: Is it a good practice to define a controller per template ? Ans: As per the AngularJs shown rules, Its good practice. Now see the 2 different way of defining the controller for the template. a. Directly into the template like: Whole template data goes inside this div. b. from the app.js where we load the template like this: .state('app.products.all', { url: '/all', templateUrl: 'tpl/products/blocks/thumb.html', controller: 'ProductsAllCtrl' }) Here i have also shown the controller with the template path. Second way is more better then the first.
upvote count: 0
answers question: http://stackoverflow.com/q/28341336

http://stackoverflow.com/comment/44955917
comment on: http://stackoverflow.com/a/28301579
score: 0
type: AnswerComment
has text: Ok that's fine, I'll try that. I just wanted to know if you meant country or county, as that had me confused also?
type: Comment

http://stackoverflow.com/comment/44936217
comment on: http://stackoverflow.com/a/28290039
has text: That seems to have done the trick, thank you. It appears that all that was changed was the addition of the 'm' character to the end, right? What exactly did that do to change the RegEx?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28391172
has body: I'm looking to reset my vertical scroller. Basically once it reaches the end I haven't been able to transition it through again. An endless loop if you will. Below is my script jQuery(document).ready(function(){ var div = jQuery('.scroll'); setInterval(function(){ var pos = div.scrollTop(); div.scrollTop(pos + 2); }, 200) }); What I was thinking was resetting like below, but that didn't work. jQuery(document).ready(function(){ var div = jQuery('.scroll'); setInterval(function(){ var pos = div.scrollTop(); div.scrollTop(pos + 2); }, 200) scrollTop =0; }); HTML Structure &lt;div class="scroll"&gt; test &lt;br&gt;&lt;br&gt; test 0 &lt;br&gt;&lt;br&gt; test 1 &lt;br&gt;&lt;br&gt; test 2 &lt;br&gt;&lt;br&gt; test 3 &lt;br&gt;&lt;br&gt; test 4 &lt;/div&gt;
tagged with: javascript
has comment: http://stackoverflow.com/comment/45119592
upvote count: 1
answer count: 1
downvote count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/45119691
favorite count: 0
has answer: http://stackoverflow.com/a/28391235
has comment: http://stackoverflow.com/comment/45119611
accepted answer: http://stackoverflow.com/a/28391235
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45119685
score: 1
tagged with: scroll
has title: Autoscroll reset to form endless vertical loop
type: Question

http://stackoverflow.com/q/28300395
has title: .Net Ticks to ISO 8601 Date format using JavaScript
favorite count: 0
accepted answer: http://stackoverflow.com/a/28300698
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: javascript
tagged with: datetimeoffset
has answer: http://stackoverflow.com/a/28300698
tagged with: mongodb
tagged with: .net
answer count: 1
has body: I am saving DateTimeOffset object in MongoDB. Mongo driver serilizes DateTimeOffset as following. [635519027206007023,0] I need it to be converted to ISO 8601 format as follows. 2015-02-02T01:43:19+05:00 Conversion can be easily done using help of .NET DateTimeOffset class. But, in this case I am retrieving DateTimeOffset directly from MongoDB using JavaScript (Node.js). Hence I end up retrieving array of long. How can I convert array of longs [635519027206007023,0] to ISO 8601 format 2015-02-02T01:43:19+00:00 using JavaScript?
downvote count: 0

http://stackoverflow.com/comment/45003496
type: QuestionComment
has text: Is the function `popup()` actually being called?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28327784

http://stackoverflow.com/comment/44991267
score: 0
type: AnswerComment
has text: In your first line of php code, you are creating a string, not an object. That string is serialized as a string, and not json. You would want to work with PHP objects on the php side and not with json strings. Thats why I showed you an example of how to build the object `(object)['request_id': $requestId, 'reqName': $requestName, 'reqSubject': ['English', 'A Math']];` Codeseekers Answer is correct, but basically just a workaround for your current inconsistent serialization mechanism.
comment on: http://stackoverflow.com/a/28321260
type: Comment

http://stackoverflow.com/comment/45321655
type: AnswerComment
score: 0
type: Comment
has text: Tried using 'exit' event instead of 'close' for `child`?
comment on: http://stackoverflow.com/a/28426813

dygraphs
tags question: http://stackoverflow.com/q/28280743
tag name: dygraphs
tags question: http://stackoverflow.com/q/28403556
type: Tag

http://stackoverflow.com/comment/45089807
type: AnswerComment
has text: @rblakeley: What's an example for another case? I'm just the messenger. If you don't like this behavior you have to take it to those who write the specification.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28374530

http://stackoverflow.com/a/28363498
answers question: http://stackoverflow.com/q/28363387
upvote count: 3
has comment: http://stackoverflow.com/comment/45068767
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/45068713
score: 3
has body: For write it direct on page you need to use the Response.Write as var nUserID = &lt;% if (ids != null) {Response.Write(ids.userID.ToString());}%&gt; beside that, if you need to add at the end ; or place it inside quotas is up to you. The &lt;% %&gt; did not write on page, just run the code. The &lt;%= %&gt; write on the page as the Response.Write
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28363387
has comment: http://stackoverflow.com/comment/45068823

http://stackoverflow.com/comment/45102089
comment on: http://stackoverflow.com/q/28381561
score: 0
has text: @Mouser, loans, prevObject: m.fn.init[1], context: document, selector: "Loans", jquery: "1.11.1", constructor: function , this is the first line displayed in my chrome console, if you're wondering about loans, that is what my data is, it's like a different content, which have lots of nested properties
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45165558
type: Comment
comment on: http://stackoverflow.com/q/28412671
has text: Well, on jsFiddle and on SO that operation is blocked. You will have to test that from your own web server.
score: 0
type: QuestionComment

http://stackoverflow.com/q/28409023
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28409053
has title: Inject html tags before and after my elements
has body: I need to populate a jQuery dialog dynamically with data. The code below works but the beginning and ending html tags are both inserted before the data ( ... ) and not before and after as needed. var dialog = $(' ').appendTo('body'); dialog.empty(); dialog.append(' '); $.each(obj.data, function (i, filePath) { dialog.append(' ' + filePath + ' '); }); dialog.append(" "); Any idea how to proceed? What I have now: dialog[0].innerHTML " ... ... " What I need: dialog[0].innerHTML " ... ... "
answer count: 1
favorite count: 0
upvote count: 1
has comment: http://stackoverflow.com/comment/45151820
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28409053
linked to: http://stackoverflow.com/q/8084687
score: 0
downvote count: 1
duplicate of: http://stackoverflow.com/q/8084687
type: Question

http://stackoverflow.com/a/52475498
has comment: http://stackoverflow.com/comment/91949918
has body: This is a warning, But addressing this will make Reacts rendering much FASTER, This is because React needs to uniquely identify each items in the list. Lets say if the state of an element of that list changes in Reacts Virtual DOM then React needs to figure out which element got changed and where in the DOM it needs to change so that browser DOM will be in sync with the Reacts Virtual DOM. As a solution just introduce a key attribute to each li tag. This key should be a unique value to each element.
score: 1
upvote count: 3
downvote count: 2
has comment: http://stackoverflow.com/comment/91950019
has comment: http://stackoverflow.com/comment/91950309
answers question: http://stackoverflow.com/q/28329382
has comment: http://stackoverflow.com/comment/91949444
has comment: http://stackoverflow.com/comment/91949817
type: Answer

http://stackoverflow.com/a/28401424
type: Answer
has body: No. JavaScript runs on the user's browser and your Java code runs on your webserver, so basically the only way to communicate between the two is via HTTP requests. If you don't want to use AJAX, you could provide all of the relevant info when you submit the form to the server for validation. You could pass all the info you need to re-generate the form as it was, like which new fields are there and such First, you'll need to add a new webservice to your Java webapp which performs validation. To achieve this, you could either add additional logic to your servlet (so that it looks for a request parameter like "doValidation=1" and performs validation if it's there) or write a different servlet that handles validation itself. You'll need to decide the format it should expect the form data in and how it should return the validation information. On your frontend page, you'll need to modify the behavior of the form so that, when you need to do validation, it performs a request to this webservice and passes along the form data. I would probably do this with jQuery and do something like jQuery.ajax(...) and pass the contents of the form as a JSON object. When your validation servlet returns data from the ajax call, you'll need to update the form based on the data it provides. If I was doing it, I would probably just have the servlet return a JSON object like {errorMessage:"..."} and I would use jQuery to add an element to the form containing the text of the validation error when it occurs. If the servlet returns an empty string or JSON object or something, I would consider it a validation success.
answers question: http://stackoverflow.com/q/28398515
score: 0

http://stackoverflow.com/a/28409616
upvote count: 2
has comment: http://stackoverflow.com/comment/45152944
type: Answer
has comment: http://stackoverflow.com/comment/45154587
has comment: http://stackoverflow.com/comment/45153061
score: 2
has comment: http://stackoverflow.com/comment/45153508
has comment: http://stackoverflow.com/comment/45154457
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45154414
has body: change this: if (windowsize &lt; 800) { to this: if ($window.width() &lt; 800) { The issue seems to me is your var windowsize is outside of function at doc ready. so it never gets updated value when window resize happens. i guess you require this: var $window = $(window); var windowsize = $window.width(); var body = $('html, body'); var spans = $('.pick-country').html(); //&lt;----cache it here function wrapContent() { if ($window.width() &lt; 800) { $('.pick-country &gt; span').replaceWith(function() { return $('&lt;option/&gt;').text($(this).text()).attr('value', $(this).data('id')); }); var select = $('.pick-country &gt; option').wrapAll('&lt;select class="country-list"&gt;&lt;/select&gt;'); } else { $('.pick-country').html(spans); // replace the old content here } } Updated Fiddle
has comment: http://stackoverflow.com/comment/45152880
has comment: http://stackoverflow.com/comment/45153475
has comment: http://stackoverflow.com/comment/45154695
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28409549
has comment: http://stackoverflow.com/comment/45152919
has comment: http://stackoverflow.com/comment/45153688
answers question: http://stackoverflow.com/q/28409549

http://stackoverflow.com/q/28424785
has answer: http://stackoverflow.com/a/69425698
has body: I have a hashmap stored in request request.setAttribute("occupationMap", occupationMap); I need to store the same map in javascript hashmap on a JSP. So I can fetch the key values in multi-tier dropdown based on the conditions. var occupationMap = '&lt;%=request.getAttribute("occupationMap")%&gt;'; alert(occupationMap); Can anyone suggest how do I convert occupationMap into a javascript map on JSP. Thanks.
has comment: http://stackoverflow.com/comment/45182551
type: Question
tagged with: hashmap
tagged with: javascript
has comment: http://stackoverflow.com/comment/45231073
score: 0
answer count: 1
has title: Java hashmap value to be used as a javascript hashmap in jsp
tagged with: jsp
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45182368

http://stackoverflow.com/q/28402340
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28402390
score: 0
has answer: http://stackoverflow.com/a/28402390
answer count: 2
has body: When my page loads I want to make an http call to the server to see if the user's login session is still valid. The client will send a session key with the current timestamp, and server will compare that timestamp to see if it is longer than its specified timeout period. The server will then return either true or false. If the http call returns true and the login is valid I want to generate this html: logout If the call returns false and the login has expired I want to show the following: login I am not sure how to do this with AngularJS.
accepted answer: http://stackoverflow.com/a/28402813
tagged with: angularjs
has title: How to generate different html content depending on http results in AngularJS?
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28402813

http://stackoverflow.com/comment/45151017
type: QuestionComment
comment on: http://stackoverflow.com/q/28408532
has text: You can use store json data in the localStorage using `JSON.stringify` and `JSON.parse`, which will give you better control of the data you're serializing
score: 4
type: Comment

http://stackoverflow.com/comment/45044531
comment on: http://stackoverflow.com/q/28348651
has text: Ah got it, seems that the express generated default is `app.use(bodyParser.urlencoded({ extended: false }));`
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44923045
comment on: http://stackoverflow.com/q/28284115
has text: Thanks for your help so far. I've added the script as well. I didn't write it, and JavaScript isn't my forte, so I'm a bit iffy still on how it all works.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28350593
type: Answer
has body: Would something like this work? onsubmit="return validate();" // add to your form tag function validate() { checkbox = document.getElementById('myCheckbox').value; if (!checkbox) { alert('checkbox is empty'); return false; } else { return true; } }
answers question: http://stackoverflow.com/q/28350387
score: 0

http://stackoverflow.com/a/28421765
type: Answer
answers question: http://stackoverflow.com/q/28421327
has body: Here is one possible answer: (?:^|, *)(?![^",]+")(?:((?=[^"&lt;]+@)|(?![^"&lt;]+@)"?(?&lt;name&gt;[^"&lt;]*)"? *))&lt;?(?&lt;email&gt;[^,&gt;]*)&gt;? This is using ruby regexes, and uses forward matches to determine if an entry has a name. (?:^|, *): start at the front of the string, or after a , and a number of spaces (?![^",]+"): negative lookahead, abort match if there are some characters and then a ". This stops commas from starting matches inside strings. (?:((?=[^"&lt;]+@)|(?![^"&lt;]+@)"?(?&lt;name&gt;[^"&lt;]*)"? *)): matching the name: (?=[^"&lt;]+@) if a @ occurs before a quote or open brace, it is just a email address without name, so do no match (?![^"&lt;]+@)"?(?&lt;name&gt;[^"&lt;]*)"? *): otherwise, match the name (skipping the open and close quote if they are present &lt;?(?&lt;email&gt;[^,&gt;]*)&gt;?: match the email. On rubular Note that for a real job, this would be a terrible approach. The regex is near incomprehensible, not to mention fragile. It also isn't complete, eg what happens if you can escape quotes inside the name? I would write a dedicated parser for this if you really need it. If you are just trying to extract some data though, the regex may be good enough.
score: 0

http://stackoverflow.com/a/28388723
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28356003
answers question: http://stackoverflow.com/q/28356003
upvote count: 1
has body: Why it doesn't work when preprocessing first: The issue relates how the sass files are referenced when compiled. Since style.sass imports partials/variables this file is referenced outside the stream and it will retrieve the original (not preprocessed) file. Why it works preprocessing after: Since the compiled .css still have the '/* @echo HOST_URL */' value the preprocess task is able to replace that value with the value required. No black magic, or inverted streams.
score: 1

http://stackoverflow.com/comment/45073000
comment on: http://stackoverflow.com/a/28365954
has text: Correct, jQuery is smart enough to add classes only once.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28382406
score: 1
has body: How can I use nested $http (ajax request in angularjs)? $http({ url:'/Project/getAllNotif', method:'POST' }) .success(function(data, status, headers, config) { angular.forEach(data, function(notif, key) { notif.msg = $sce.trustAsHtml(notif.msg); }); $rootScope.notifs = data; if($rootScope.notifs.length != 0){ angular.forEach($rootScope.notifs, function(notif, key) { ids.push(notif); }); } $scope.ajaxCal2(ids); }); I call a function in success of ajax request but it doesnt work and get me some errors like this this is undefined $scope.ajaxCall2= function(){ $http({ url:'/project/removeNotifs', method:'POST', data:$.param({'ids':$scope.ids}), headers: {'Content-Type': 'application/x-www-form-urlencoded'} }) .success(function(data, status, headers, config) { $scope.notifNumber = 0; console.log($scope.notifNumber); }) }
type: Question
upvote count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45119256
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/45104319
has title: nested ajax request in angularjs and use $http
has comment: http://stackoverflow.com/comment/45104930
answer count: 0
tagged with: angularjs
type: UnansweredQuestion
downvote count: 0

http://stackoverflow.com/a/28365607
upvote count: 1
has body: The encryption/decryption works with the default parameters: var result = sjcl.json.encrypt( 'pw123', '{text: "this should be decrypted"}' ); var originalText = sjcl.json.decrypt( 'pw123', result); But what is v and iv? v is probably the version information for the ciphertext so that later versions of SJCL can decrypt it. It is simply set to 1 and never used in the code. The iv is the initialization vector that is needed for most block cipher modes such as CCM. For AES it is 16 bytes long or simply the block size.
has comment: http://stackoverflow.com/comment/45076512
score: 1
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28364434
answers question: http://stackoverflow.com/q/28364434

http://stackoverflow.com/a/28419747
has comment: http://stackoverflow.com/comment/45180330
type: Answer
has comment: http://stackoverflow.com/comment/45179275
has comment: http://stackoverflow.com/comment/45179291
downvote count: 0
has comment: http://stackoverflow.com/comment/45180459
score: 1
accepted answer of: http://stackoverflow.com/q/28419269
answers question: http://stackoverflow.com/q/28419269
has comment: http://stackoverflow.com/comment/45174545
has comment: http://stackoverflow.com/comment/45172946
has comment: http://stackoverflow.com/comment/45173049
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45173031
has comment: http://stackoverflow.com/comment/45174440
has body: Try using the full path of 'forever'. In terminal run 'which forever' and use the path it gives you in your bash. It would look something like this full/path/forever restart ../../../www/example.io/public_html/server.js

http://stackoverflow.com/a/28316686
has comment: http://stackoverflow.com/comment/44982477
score: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44982564
answers question: http://stackoverflow.com/q/28316603
type: Answer
has body: You appear to be iterating over text.length instead of LettersEnglish.length or LettersLeet.length. This means that if you have a password shorter than the length of these arrays, not all the characters in them will be substituted.
upvote count: 1

http://stackoverflow.com/q/28296321
answer count: 1
has answer: http://stackoverflow.com/a/28296645
accepted answer: http://stackoverflow.com/a/28296645
downvote count: 0
tagged with: javascript
tagged with: jquery
type: Question
score: 2
type: AnsweredQuestion
tagged with: fullpage.js
favorite count: 0
tagged with: angularjs
has body: I have a problem with removing event listeners from mousewheel and wheel. I'm using fullpage.js plugin. The problem is, when I get from my "about page" to another by clicking link (I am using the ui router for angular.js) and then clicking on back button to get back on about page, the event listeners on mousewheel and wheel are not removed and get an additional listener attached. Repeating these steps add more listeners. .directive('dfAboutPagesView', function( ) { return { restrict: 'A', link: function(scope, element, attrs) { scope.checkPackages = { all: false }; scope.$on("$destroy", function() { $(document).off(); }); var fullpage_in = function () { element.fullpage({ scrollingSpeed: 500, autoScrolling: false }); element.fullpage({ onLeave: function (index, nextIndex, direction) { if (index == 1 &amp;&amp; direction == 'down') { $('#header').slideUp(500, 'easeInQuad'); } else if (index == 2 &amp;&amp; direction == 'up') { $('#header').slideDown(500, 'easeInQuad'); } else if (index == 3 &amp;&amp; direction == 'down') { $('#footer').slideDown(500, 'easeInQuad'); } else if (index == 4 &amp;&amp; direction == 'up') { $('#footer').slideUp(500, 'easeInQuad'); } } }); }; fullpage_in(); } } })
upvote count: 2
has title: Remove event listeners from directive - Angular.js

http://stackoverflow.com/comment/45148280
type: Comment
comment on: http://stackoverflow.com/q/28406760
type: QuestionComment
score: 0
has text: Actually i use right now as swipper a rewrite version of https://github.com/thebird/Swipe I looked at your plugin it seems they got the same issue : http://flexslider.woothemes.com/video.html Look at this page in mobile view and try to swipe on the vimeoh video doesnt work.

http://stackoverflow.com/comment/45085403
type: AnswerComment
score: 0
type: Comment
has text: ... So the location object is already there in the DetailsController before the transition starts. But it's evaluated (as well as the ng-show) after the animation start. To show you what I mean I uploaded another video: http://youtu.be/dSU2sH7a7DM (look at the header bar)
comment on: http://stackoverflow.com/a/28317063

onclick
tags question: http://stackoverflow.com/q/28422205
tags question: http://stackoverflow.com/q/28421735
tags question: http://stackoverflow.com/q/28333305
tags question: http://stackoverflow.com/q/28424116
type: Tag
tags question: http://stackoverflow.com/q/28315407
tags question: http://stackoverflow.com/q/28328357
tags question: http://stackoverflow.com/q/28423197
tags question: http://stackoverflow.com/q/28382408
tags question: http://stackoverflow.com/q/28335443
tag name: onclick
tags question: http://stackoverflow.com/q/28372466
tags question: http://stackoverflow.com/q/28399538
tags question: http://stackoverflow.com/q/28398772
tags question: http://stackoverflow.com/q/28395667
tags question: http://stackoverflow.com/q/28341371
tags question: http://stackoverflow.com/q/28382362

http://stackoverflow.com/comment/45245057
score: 0
type: Comment
has text: so if someone want to send cookie to a server using: "document.write(' )"...it wont work now? right? so which method attackers use? actually am studying XSS vulnerability.please help me..
comment on: http://stackoverflow.com/a/28436279
type: AnswerComment

http://stackoverflow.com/comment/45069036
has text: Thank you @George ! But i wonder is that a way like (I am just asking): $("#open-button").click(function () { $('#additem').css({'@media all and (max-width: 1366px) margin-left': '10%' }); });
type: Comment
comment on: http://stackoverflow.com/a/28363597
score: 0
type: AnswerComment

http://stackoverflow.com/a/28382473
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45104050
downvote count: 0
has comment: http://stackoverflow.com/comment/45107756
has comment: http://stackoverflow.com/comment/45105202
has comment: http://stackoverflow.com/comment/45103730
type: Answer
has comment: http://stackoverflow.com/comment/45105210
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/45106250
has comment: http://stackoverflow.com/comment/45103696
answers question: http://stackoverflow.com/q/28382338
has body: Add data-role=navigate attribute to ul element where navigation is housed, In the javascript section of this fiddle, please try with the following code, $(function() { $("[data-role=navigate]").find("li &gt; a").click(function() { $(this).parents("ul").find("li.active").removeClass("active"); $(this).parent().addClass("active"); }) }) I will explain in brief what the code does... 1) Binds a click event handler to &lt;a&gt; inside &lt;li&gt; which is inside &lt;ul&gt; with attribute data-role=navigate 2) When the click happens, it removes the active class for the current element. 3) Assigns the active class to the immediate parent of the &lt;a&gt; It is a good practice to target specific needs in JS by placing attribute in the DOM elements and hooking up event listeners using that attribute. Hope it helps!
has comment: http://stackoverflow.com/comment/45104777
accepted answer of: http://stackoverflow.com/q/28382338

http://stackoverflow.com/comment/44963700
has text: @Axwell Could you put the new HTML and code in an edit to your original question. It is hard to look at all that in a comment. Also, I used `$elt` in my fiddle as that is what I named the JQuery object. Is that what yours is called?
comment on: http://stackoverflow.com/a/28306088
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/65382534
score: 2
type: AnswerComment
type: Comment
has text: I never said I consider this to be good architecture, but it is what it is - a design decision somewhere early in Chrome APIs. I'm not part of Chrome dev team, so I wouldn't be able to tell you why this was chosen.
comment on: http://stackoverflow.com/a/28432087

http://stackoverflow.com/a/28422482
answers question: http://stackoverflow.com/q/28422408
has comment: http://stackoverflow.com/comment/45178561
type: Answer
has comment: http://stackoverflow.com/comment/45178123
has body: You just need to break the function out and call it onLoad in addition to each keypress. $(window).load(function() { var countChars = function(elm) { var diff = (2550 - $(elm).val().length); if (diff >= 501) { $("#count_4_1").html("Characters remaining: " + diff + ""); } else if ((diff <= 500) && (diff >= 101)) { $("#count_4_1").html("Characters remaining: " + diff + ""); } else if (diff <= 100) { $("#count_4_1").html("Characters remaining: " + diff + ""); } }; countChars("#input_4_1"); $("#input_4_1").keyup(function() { countChars(this) } ); }); But might I suggest refactoring that code a bit: $(window).load(function() { var countChars = function(elm, counter) { var diff = (2550 - $(elm).val().length), color = 'ff0000'; if (diff > 500) { color = '55a500'; } else if (diff > 100) { color = 'ff6600'; } $(counter).html('Characters remaining: ' + diff + ''); }; countChars('#input_4_1','#count_4_1'); $("#input_4_1").keyup(function() { countChars(this, '#count_4_1') } ); });
has comment: http://stackoverflow.com/comment/45178209
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28422408
score: 1
has comment: http://stackoverflow.com/comment/45180793
has comment: http://stackoverflow.com/comment/45181482
has comment: http://stackoverflow.com/comment/45182588
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45178486

http://stackoverflow.com/comment/44971177
comment on: http://stackoverflow.com/a/28301651
score: 0
has text: Thanks, sorry I didn't see the hue addition. You're right, doing it through filter will probably be easier for my needs, though the method I've used so far does give some really good results that look differently than just putting a filter over the top. Would be good I think to complete the other method even if I end up using the filter option as it might prove useful in the future. It also loads and works really quickly so far, though may not be the case once it is extended to all the images I need. I'll give the filter option a go and post back tomorrow. Thanks
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28313550
has answer: http://stackoverflow.com/a/28313572
accepted answer: http://stackoverflow.com/a/28313572
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: ajax
type: AnsweredQuestion
type: Question
has title: Javascript ajax call adding "?=####" to the end of my call
has body: I have a simple ajax command calling a URL to my server: $.ajax({ type: "GET", url: "/action" }); And the response from my logs show as /action?_=1423024004825 Is there anyway to remove this?
tagged with: caching
score: 0
has comment: http://stackoverflow.com/comment/44977137

http://stackoverflow.com/a/28385880
has body: The .remove() method removes the elements on which it is called, optionally filtered by a selector. In the line $('#' + catId).parent().remove('.subcatBtns'); You define a set of matched elements which contains only one element (the button container) and then call .remove() on this set with the selector ".subcatBtns". Since the container does not match the selector, nothing gets removed. Try, instead: $('#' + catId).parent().find('.subcatBtns').remove();
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45109480
type: Answer
score: 11
upvote count: 11
answers question: http://stackoverflow.com/q/28385539
accepted answer of: http://stackoverflow.com/q/28385539

http://stackoverflow.com/comment/45014491
has text: @basarat I didn't want to answer with the assumption they were using IIS, but yeah that's most likely the issue.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28321316

http://stackoverflow.com/q/28298621
favorite count: 0
type: UnansweredQuestion
answer count: 0
has body: I developed for the code in c3.js,but tickformat in x-axis lot of years and months are showing,i unable to show the particular years and month,How to use for the d3.js libraries in c3.js any referral websites .The given code i had developed. setTimeout(function () { chart = c3.generate({ size:{height:500,width:600}, padding:{left:100}, data: { json: [{"key":[2000,0],"value":500},{"key":[2000,1],"value":600},{"key":[2000,2],"value":200},{"key":[2000,3],"value":100},{"key":[2000,4],"value":700},{"key":[2000,5],"value":200},{"key":[2000,6],"value":1940},{"key":[2000,7],"value":1562},{"key":[2000,8],"value":2163},{"key":[2000,9],"value":2148},{"key":[2000,10],"value":2228},{"key":[2000,11],"value":4081},{"key":[2001,0],"value":600},{"key":[2001,1],"value":1000},{"key":[2001,2],"value":5385},{"key":[2001,3],"value":9647},{"key":[2001,4],"value":6209},{"key":[2001,5],"value":6661},{"key":[2001,6],"value":26472},{"key":[2001,7],"value":11965},{"key":[2001,8],"value":13179},{"key":[2001,9],"value":14389},{"key":[2001,10],"value":63365},{"key":[2001,11],"value":17158},{"key":[2001,0],"value":10000}], names: { value: 'transactions', }, keys: { x: 'key', value: ['value'], } }, axis: { x: { type: 'category' }, tick: { format: function (x) { return x.getFullYear(); } } }, zoom: { enabled: true }, grid: { x: { show: true }, y: { show: true } }, regions: [ {axis: 'x', end: 1, class: 'regionX'}, {axis: 'x', start: 2, end: 4, class: 'regionX'}, {axis: 'x', start: 5, class: 'regionX'}, {axis: 'y', end: 50, class: 'regionY'}, {axis: 'y', start: 80, end: 140, class: 'regionY'}, {axis: 'y', start: 400, class: 'regionY'}, {axis: 'y2', end: 900, class: 'regionY2'}, {axis: 'y2', start: 1150, end: 1250, class: 'regionY2'}, {axis: 'y2', start: 1300, class: 'regionY2'}, ] }); chart.transform('area', 'value'); chart.transform('area-spline'); }, 2000);
score: 1
upvote count: 1
type: Question
has title: How to months and years to show the perticular tick format in c3.js
tagged with: javascript
downvote count: 0
tagged with: c3

http://stackoverflow.com/comment/45027239
type: AnswerComment
comment on: http://stackoverflow.com/a/28340248
score: 0
type: Comment
has text: thanks for the response. I haven't installed APC or Varnish cache on my store. I am using merge css and it updates for the first time in a day only.any another solution for this?

http://stackoverflow.com/comment/45236495
type: Comment
comment on: http://stackoverflow.com/a/28432026
has text: One more thing, i need point for my above image (updated as small image). Could you do that??? Thanks a ton :)
type: AnswerComment
score: 0

http://stackoverflow.com/q/28377207
downvote count: 0
possible better answer: http://stackoverflow.com/a/28377298
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28377298
favorite count: 0
upvote count: 8
type: Question
accepted answer: http://stackoverflow.com/a/28377235
has title: jQuery selector: Selecting a certain combination of classes when multiple exist
has body: I have tried to do some research already and haven't found anything, but If I've missed the answer, please tell me. Basically I have multiple elements with multiple classes each, but the combinations are unique. I want to select a certain combination of classes, but not other elements that have this elements in combination with others. I would like to know if this selector exists in jQuery or if there is some other way to accomplish what I am explaining. See the example below: /div> When trying to log only the element with the classes a b c, I tried using: $('.a.b.c').each( function() { console.log($(this)); } the output is: [ ... , ...</div , ... ] I am looking for the output to be: [ ... ] Any guidance is appreciated. Thanks!
has answer: http://stackoverflow.com/a/28377775
score: 8
has answer: http://stackoverflow.com/a/28377235
answer count: 3
type: AnsweredQuestion
tagged with: jquery-selectors

http://stackoverflow.com/comment/44989625
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28319823
type: AnswerComment
has text: neither is triggering an event and listening to that event only to pass data to the element which you could do directly instead of triggering the event. Btw: I never mentioned any global scope on my answer. I spoke about the outer scope!

http://stackoverflow.com/a/28322991
score: 0
type: AcceptedAnswer
has body: The answer would be a programmatic method to fake a ISO3166 code if there's only 2 letters in the browser's languages-accepted setting. But I don't think there's a way to always be correct, although it looks like with major languages there seems to be a corresponding ISO3166 country code identical to the language (fr_FR, de_DE, es_ES - but, interestingly: no en_EN ). So I guess the hack way would be to just add the underscore and the uppercase version of the 2 letters, if they're not there already, and let it break and default to US english for those languages that don't have a variant like that. But, I'd rather do better. It's unfortunate LinkedIn's API is acting this way, since the standards seem to clearly state that the country/region code is optional. see http://en.wikipedia.org/wiki/IETF_language_tag
type: Answer
accepted answer of: http://stackoverflow.com/q/28321985
answers question: http://stackoverflow.com/q/28321985

http://stackoverflow.com/a/28359163
downvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/45061478
has comment: http://stackoverflow.com/comment/45061408
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45061978
type: Answer
accepted answer of: http://stackoverflow.com/q/28358962
has body: Try this one: Iterate through each p, get its html (not text, in order to get the &lt;br&gt; element), replace the &lt;br&gt; with empty string using regex (one that matches &lt;br&gt; just before the &lt;/p&gt;), replace the original with the updated html. $('p').each(function(){ var p = $(this); p.html(p.html().replace(/(&lt;br)\s?\/?&gt;\s?$/g,'')); }); REGEX: /(&lt;br)\s?\/?&gt;\s?$/g matches: &lt;br&gt;, &lt;br/&gt;, &lt;br /&gt;, &lt;br &gt;
answers question: http://stackoverflow.com/q/28358962
upvote count: 2

http://stackoverflow.com/a/28413610
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28413355
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28413355
has body: I want to add this as an answer because the comments section simply cannot handle the content im trying to get across. JS Fiddle does not normally generate references when you run code in the editor. Try adding the following to your HTML/PHP or whatever file type you are using for markup. It sounds like you havent included the necessary references to both JQuery and JQuery UI.

http://stackoverflow.com/comment/45085635
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28370165
has text: Have you tried `boxes.selectAll("rect")`?

http://stackoverflow.com/q/28300043
type: Question
tagged with: websocket
has body: I'm using Python websockets to return JSON objects (I think) however I'm not sure how to deal with the response. I have an example using JavaScript which uses parseJSON, a snippet is bellow: socket = io.connect("__socket address__"); socket.on("connect", function() {socket.emit("subscribe_areas", areas)}); var d = jQuery.parseJSON(c); console.log(d); d.type == "INTERPOSE"; which returns data I can access eg d.type == "INTERPOSE";: Object {area: "BE", type: "MOVE", to: "0109", from: "0107", value: "2L65"} Object {area: "BE", type: "MOVE", to: "0113", from: "0109", value: "2L65"} where as my Python I recieve: (u'{"area":"EH","type":"INTERPOSE","to":"B243","value":""}',) (u'{"area":"EH","type":"INTERPOSE","to":"0337","value":""}',) (u'{"area":"EH","type":"INTERPOSE","to":"0085","value":""}',) Why does the python return JSON wrapped in brackets and commars? My Python is bellow: from socketIO_client import SocketIO import logging import json def on_connect(): print('CONNECTED') areas = ['EH'] socketIO.emit('subscribe_areas', areas) def on_message(*answer): print(answer) socketIO = SocketIO('_address_', _port_) socketIO.on('connect', on_connect) socketIO.on('message', on_message) socketIO.wait() I've tried decoding using json.load, json.loads, json.decode but recieve all sorts of errors. What am I missing and why is the return wrapped in brackets and such?
tagged with: javascript
has answer: http://stackoverflow.com/a/28300102
answer count: 1
downvote count: 0
favorite count: 0
has title: how to deal with JSON response
tagged with: python
accepted answer: http://stackoverflow.com/a/28300102
type: AnsweredQuestion
score: 1
tagged with: http://stackoverflow.com/tag/json
upvote count: 1

http://stackoverflow.com/comment/45184568
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28426320
has text: Looks like this script is in your ajax callback, move it to your document ready callback

http://stackoverflow.com/q/28416550
has title: How to put my Web Socket server application in the Heroku?
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/30996092
type: Question
tagged with: heroku
answer count: 2
tagged with: javascript
upvote count: 1
has body: I created a heroku account to use Node.js but I don't know how to put my Server.js in the server (that I created): http://calnetaskmanager.herokuapp.com/, I've read a lot of guides from Heroku and I've searched a LOT, but I can't find anyone explaining simply how to put a Server.js into a Heroku server. Can someone leave a simple example of putting a websocket server in the heroku. This server need to be accessible by anyone. I placed the Client side if necessary, and the Server.js P.S.: "If you see any english mistake or something sounds weird, edit please!" Thanks in Advance. Client Side: $(function() { "use strict"; // for better performance - to avoid searching in DOM var content = $('#content'); var input = $('#input'); var status = $('#status'); // my color assigned by the server var myColor = false; // my name sent to the server var myName = false; // if user is running mozilla then use it's built-in WebSocket window.WebSocket = window.WebSocket || window.MozWebSocket; // if browser doesn't support WebSocket, just show some notification and exit if (!window.WebSocket) { content.html($('&lt;p&gt;', { text: 'Sorry, but your browser doesn\'t ' + 'support WebSockets.' })); input.hide(); $('span').hide(); return; } // open connection var connection = new WebSocket('ws://127.0.0.1:1337'); connection.onopen = function() { // first we want users to enter their names input.removeAttr('disabled'); status.text('Choose name:'); }; connection.onerror = function(error) { // just in there were some problems with conenction... content.html($('&lt;p&gt;', { text: 'Sorry, but there\'s some problem with your ' + 'connection or the server is down.' })); }; // most important part - incoming messages connection.onmessage = function(message) { // try to parse JSON message. Because we know that the server always returns // JSON this should work without any problem but we should make sure that // the massage is not chunked or otherwise damaged. try { var json = JSON.parse(message.dat…
tagged with: websocket
favorite count: 0
has answer: http://stackoverflow.com/a/28423482
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: node.js

http://stackoverflow.com/a/28317046
type: Answer
answers question: http://stackoverflow.com/q/28316000
has body: Here is a nice library I use in MVC called reCAPTCHA plugin for .NET: https://code.google.com/p/recaptcha/ There is a Nuget package available for it. Nuget id: recaptcha current verion 1.0.5.0 Now to use it: in your View Inside your view above or bellow your Submit button: You add this code: &lt;p&gt; @Html.Raw(@Html.GenerateCaptcha()) @Html.ValidationMessage("captcha") &lt;/p&gt; Then in your controller action add the RecaptchaControlMvc.CaptchaValidator attribute and also add an addition bool paramater for the recapccha e.g. captchaValid HttpPost, RecaptchaControlMvc.CaptchaValidator] [OutputCache(NoStore = true, Duration = 0, VaryByParam = "None")] public ActionResult Register(RegistrationViewModel model, bool captchaValid) { // If the bool is true The Recapcha validation was successful. // If not then you can add a model error with the property name for the: `@Html.ValidationMessage("captcha")` if (!isLoan &amp;&amp; !captchaValid) { ModelState.AddModelError("captcha", "Verification word is incorrect. Try again."); } if (ModelState.IsValid) { // go an ddo your registration or login } else { // handle errors and other messages } return View(model); } The Library will take care of the rest.
score: 0

http://stackoverflow.com/a/28363356
score: 1
answers question: http://stackoverflow.com/q/28362570
type: Answer
has body: Older verions then IOS8 pauses "DOM painting" while the scroll event is fired. An excellent article about the onscroll differences between IOS versions can be found here: http://developer.telerik.com/featured/scroll-event-change-ios-8-big-deal/ http://ejohn.org/blog/learning-from-twitter/ Since IOS version 8 the onscroll will fire continuously. You could check IOS version with javascript. function iOSversion() { if (/iP(hone|od|ad)/.test(navigator.platform)) { var v = (navigator.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/); return [parseInt(v[1], 10), parseInt(v[2], 10), parseInt(v[3] || 0, 10)]; } } version = iOSversion(); if (version[0] &gt; 7) { alert('Continuous scrolling is working!'); }
upvote count: 1
downvote count: 0

http://stackoverflow.com/a/28360827
answers question: http://stackoverflow.com/q/28345547
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28345547
type: Answer
score: 1
upvote count: 1
has body: Always make DOM manipulation from directive. That will give better control on DOM which you want to manipulate. Use link function inside your directive. because you also need to update scope variable. And then bind blur &amp; focus event to element inside your link function. As you are passing the "Parameter" string on focus. you can do the same by mentioning attribute inside your element like parameter="Parameters" HTML &lt;input type="text" id="myId" ns-validate="" class="someClass" ng-model="Date" blur-checker parameter="Parameters" tabindex="-1"&gt; Directive angular.module('tpmobile').directive('blurChecker', function() { return { restrict: 'A', link: function(scope, element, attrs) { var parameterName = attrs.parameter; //I don't know what it does here, but you can get parameter name here element.on('blur', function(event) { element.prop('readonly', false).removeClass('focus'); }); element.on('focus', function(e) { scope.dateSet = false; element.blur(); element.prop('readonly', true).addClass('focus'); }) } } }); Hope this could help you. Thanks.

http://stackoverflow.com/q/28316341
possible better answer: http://stackoverflow.com/a/28316623
score: 2
type: AnsweredQuestion
downvote count: 0
type: Question
has body: There are a lot of nice functions like filter(), hasOwnProperty() or indexOf(), but I don't know how to handle with them in my problem. First, let me show you my current code: var Lines = []; // [..] pushing a lot of objects in the Lines Array, now it is like this: Lines[0] = {line: 'a', x: 2, y: 4, z: 3, visible: true} Lines[1] = {line: 'b', x: 3, y: 4, z: 3, visible: true} Lines[2] = {line: 'c', x: 5, y: 3, z: 3, visible: true} Lines[3] = {line: 'd', x: 1, y: 4, z: 3, visible: true} Lines[4] = {line: 'e', x: 2, y: 4, z: 3, visible: true}//same as Lines[0] Lines[5] = {line: 'f', x: 6, y: 6, z: 3, visible: true} Lines[6] = {line: 'g', x: 5, y: 7, z: 3, visible: true} Lines[7] = {line: 'h', x: 3, y: 4, z: 3, visible: true}//same as Lines[1] //.. Now I want to have a function where I can multiple lines where x and y are the same. (in example index 0 &amp; 4 are the same and 7 and 1 are the same) and set visible to false if there are two lines at the same x &amp; y position, otherwise set visible to true. Now the question: How can I check multiple object properties (x &amp; y have to be the same) in an Array and handle them?
accepted answer: http://stackoverflow.com/a/28316602
has title: How to check multiple object properties twice in JavaScript?
has answer: http://stackoverflow.com/a/28316623
upvote count: 2
answer count: 2
has answer: http://stackoverflow.com/a/28316602
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44981919

http://stackoverflow.com/q/28390844
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45119021
has answer: http://stackoverflow.com/a/28390920
tagged with: javascript
has body: I'm want to shorten this function with array document.mySchedule.breakfast.onchange = function() { var id = document.mySchedule.breakfast.selectedIndex; var val = document.mySchedule.breakfast[id].value; strUser[0]=val; } document.mySchedule.lunch.onchange = function() { var id = document.mySchedule.lunch.selectedIndex; var val = document.mySchedule.lunch[id].value; strUser[1]=val; } document.mySchedule.dinner.onchange = function() { var id = document.mySchedule.dinner.selectedIndex; var val = document.mySchedule.dinner[id].value; strUser[2]=val; } I'm try this way but it didn't seem to be work. var selectData = ["breakfast","lunch","dinner"] for(i = 0; i &lt; selectData.lenght; i++) { document.mySchedule.selectData[i].onchange = function() { var id = document.mySchedule.selectData[i].selectedIndex; var val = document.mySchedule.selectData[i][id].value; strUser[i]=val; } } by the way this use to control selector. Hope someone can help. thank you
tagged with: selector
type: Question
score: 0
accepted answer: http://stackoverflow.com/a/28390920
tagged with: function
answer count: 1
tagged with: arrays
has comment: http://stackoverflow.com/comment/45119095
has title: Javascript array to point variable name with similar function

load-order
type: Tag
tags question: http://stackoverflow.com/q/28341700
tag name: load-order

http://stackoverflow.com/comment/45039800
comment on: http://stackoverflow.com/a/28347828
has text: Ahh! Thank you for explaining my errors! RegEx is a mystery I will never be able to memorize (atleast it feels that way now). I will consider using replace instead!
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45181574
type: QuestionComment
has text: @KYOUMAH: Give me your email Id. I Can sent you the file. Its a little big for copy paste.
type: Comment
comment on: http://stackoverflow.com/q/28408173
score: 0

http://stackoverflow.com/a/28410066
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28409927
answers question: http://stackoverflow.com/q/28409927
score: 2
type: AcceptedAnswer
downvote count: 0
has body: var numberString = '1.123.355,50'; numberString = numberString .replace(/\./g, '') // replace all separators .replace(/,/, '.'); // replace comma with dot var parsed = parseFloat(numberString);
type: Answer

http://stackoverflow.com/comment/45175029
type: QuestionComment
has text: It's not unusual to fetch html templates and json data separately and then render the final html with the json data client-side.
comment on: http://stackoverflow.com/q/28420920
score: 0
type: Comment

http://stackoverflow.com/comment/45202052
has text: Unfortunately, I don't have any ability to modify the links in the original HTML. Is there a way to give the DOMParser a context to start from?
comment on: http://stackoverflow.com/q/28435626
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28316602
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28316341
answers question: http://stackoverflow.com/q/28316341
type: AcceptedAnswer
downvote count: 0
has body: var index = {}, lines = [/* your lines here */]; lines.forEach(function (line) { var key = line.x + ':' + line.y; line.visible = !(key in index); index[key] = true; }); Create an index (an object) that will contain the properties you want to check for uniqueness. In your case, the combination of x and y will be the unique property (i.e. the key). We can use a separated string for that: line.x + ':' + line.y. Take care to use a separator that can not naturally occur in x and y, a colon will do fine for numbers. Go though the lines one by one, check if their key already is in the index. If it is, make them invisible and vice versa. Store the key in the index, repeat.
type: Answer
score: 1

http://stackoverflow.com/a/28322021
type: Answer
answers question: http://stackoverflow.com/q/28321813
score: 0
has body: If i right understood your problem: function print(elemID, text){ document.getElementById(elemID).appendChild(document.createTextNode(text)); } var res; print('show1', (res = Math.random())); print('show2', (res = res * 50)); print('show3', (res += 30)); print('show4', (res = res.toFixed(0))); fiddle

httprequest
tags question: http://stackoverflow.com/q/28411420
tags question: http://stackoverflow.com/q/28391814
tags question: http://stackoverflow.com/q/28348750
tag name: httprequest
tags question: http://stackoverflow.com/q/28293863
type: Tag

eclipse
tag name: eclipse
tags question: http://stackoverflow.com/q/28287425
tags question: http://stackoverflow.com/q/28396315
tags question: http://stackoverflow.com/q/28337856
type: Tag

http://stackoverflow.com/q/28373657
score: -2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45091363
type: Question
has answer: http://stackoverflow.com/a/28373745
upvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28373745
has title: over simple issue : checkbox calling javascript function
has comment: http://stackoverflow.com/comment/45087878
answer count: 1
favorite count: 0
has body: I can't see why this doesn't work I got an "handle_email" is not defined error :-( I am on using django. It is difficult to see why it doesn't work :( so simple !! I can't really put all the code because stackoverflow doesn't allow me to have only code on this question ;) {% extends "base.html" %} {% block content %} {% for user, info in to_display.items %} {% for k , v in info.items %} {% if v != "" and k != "id" %} {{k}} : {{v}} {% endif %} {% endfor %} {% endfor %}
linked to: http://stackoverflow.com/q/14323376
downvote count: 2
tagged with: django

http://stackoverflow.com/comment/45063022
has text: You could also try to encode the js files. You can use http://www.jsobfuscate.com/
score: 0
comment on: http://stackoverflow.com/q/28360130
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28400136
tagged with: node.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28400478
score: 0
type: Question
has comment: http://stackoverflow.com/comment/45136355
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has body: I was wondering if someone knows how to extract the file content from an uploaded file when using express/nodejs I have the following code and it's clear how to pipe the input to a filestream, but how do I deserialize the upload to a plain javascript object? The purpose is to extract information from the uploaded file and use it somewhere else. Ideally I don't want to go via a temporary file on disk. The format of the file is json. app.post("/upload", function(req, res){ req.pipe(req.busboy); req.busboy.on('file', function (fieldname, file, filename) { console.log("Uploading: " + filename); console.log(file); console.log(fieldname); // I don't want to go via a file, but straight to a JS object //fstream = fs.createWriteStream('/files/' + filename); // //file.pipe(fstream); // //fstream.on('close', function () { // // res.redirect('back'); // //}); }); }); The file upload is triggered like this: var formData = new FormData($('form')[0]); e.preventDefault(); $.ajax({ url: 'upload', type: 'POST', data: formData, cache: false, dataType:'json', contentType: false, enctype: 'multipart/form-data', processData: false, success: function (response) { } });
tagged with: express
has comment: http://stackoverflow.com/comment/45140268
has title: Parse file content during file upload
has answer: http://stackoverflow.com/a/28400478
answer count: 1
tagged with: busboy

http://stackoverflow.com/q/28288660
has title: Google Map API v3 not working in Wordpress
has comment: http://stackoverflow.com/comment/44931555
tagged with: wordpress
has comment: http://stackoverflow.com/comment/44960957
linked to: http://stackoverflow.com/q/11159860
type: Question
tagged with: google-maps
has comment: http://stackoverflow.com/comment/44940960
downvote count: 0
has answer: http://stackoverflow.com/a/28311874
has comment: http://stackoverflow.com/comment/44932157
tagged with: javascript
has comment: http://stackoverflow.com/comment/44932138
tagged with: google-maps-api-3
answer count: 1
score: 1
has comment: http://stackoverflow.com/comment/44932204
favorite count: 0
has comment: http://stackoverflow.com/comment/44932797
has comment: http://stackoverflow.com/comment/44933114
type: UnansweredQuestion
has body: Hi this script shows a Google's map in Palo Alto, CA. When i use it in a simple .html page it works perfectly, but when i include it in a Wordpress page it doesn't show up. What am i missing? thanks Visit a Diner Near You
upvote count: 1

http://stackoverflow.com/a/28298979
upvote count: 1
type: AcceptedAnswer
has body: If I understand your question correctly, you can solve your problem by using location.replace() on the B and C pages for navigating between them. This has the effect of not saving the current page in the sessions history, so that clicking back returns the user to whichever page she was on before B or C. You can read more about replace here.
accepted answer of: http://stackoverflow.com/q/28298769
type: Answer
answers question: http://stackoverflow.com/q/28298769
downvote count: 0
has comment: http://stackoverflow.com/comment/44984402
has comment: http://stackoverflow.com/comment/44950008
has comment: http://stackoverflow.com/comment/44951843
score: 1
has comment: http://stackoverflow.com/comment/44982250

http://stackoverflow.com/q/28391918
has comment: http://stackoverflow.com/comment/45120976
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28392201
tagged with: php
has comment: http://stackoverflow.com/comment/45121000
type: Question
has answer: http://stackoverflow.com/a/28392099
has body: I have this code. All i want is when i click the Assist button. The data in database will be show in the textbox and textarea. But i am having trouble with the textarea. In the database, it has new line and i cant get the value of it. can someone help me with it?? &lt;?php $tmp=mysqli_query($link, "select * from med_rec_tmp"); if($tmp){ while($row=mysqli_fetch_array($tmp)){ $rem = nl2br($row['Remarks']);?&gt; &lt;tr&gt; &lt;td&gt;&lt;?php echo $row['Temp_RecNo']; ?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo $row['FirstName']; ?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo $row['MiddleName']; ?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo $row['LastName']; ?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo $rem;?&gt;&lt;/td&gt; &lt;td&gt; &lt;script type="text/javascript"&gt; $("#assist&lt;?php echo $row['Temp_RecNo']; ?&gt;").on('click', function(){ var txt = '&lt;?php echo $rem; ?&gt;'; var regex = /&lt;br\s*[\/]?&gt;/gi; var txt2 = txt.replace(regex, "\n"); $("#rem").val(txt2); $("#fname").val('&lt;?php echo $row['FirstName'];?&gt;'); $("#mname").val('&lt;?php echo $row['MiddleName'];?&gt;'); $("#lname").val('&lt;?php echo $row['LastName'];?&gt;'); $("#id").val('&lt;?php echo $row['Temp_RecNo'];?&gt;'); }); &lt;/script&gt; &lt;center&gt; &lt;div class="btn-group btn-group-xs btn-group-justify" role="group" aria-label="..."&gt; &lt;button type="submit" class='btn btn-info' id='assist&lt;?php echo $row['Temp_RecNo']; ?&gt;'&gt;&lt;span class='fa fa-trash'&gt;&lt;/span&gt;&amp;nbsp;Assist&lt;/button&gt; &lt;/div&gt; &lt;/center&gt; &lt;/td&gt; &lt;/tr&gt; &lt;?php }}?&gt; this is the textarea code &lt;div class="col-lg-12" style="padding:0px;"&gt; &lt;label class="control-label"&gt;Remarks:&lt;/label&gt; &lt;/div&gt; &lt;div class="col-lg-12" style="padding:0px;"&gt; &lt;textarea class="form-control" style="width:100%;max-width:100%;min-width:100%;min-height:80px;max-height:80px;resize:none;" id="rem" name="remarks" rows="10" cols="50"&gt;&lt;/textarea&gt; &lt;/div&gt;
has comment: http://stackoverflow.com/comment/45120982
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28392183
score: 0
has title: Setting the values of textarea with new lines
has comment: http://stackoverflow.com/comment/45121009
answer count: 3
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/43833262
has body: You need to mock your objects before your unit tests, and the methods/properties that you use of your objects. So you need to mock: sessionService and its methods/properties: save(), account.newPassword, account.currentPassword And webServiceDal and its method: changePassword Then you need to inject the angular injections that you use: $scope, $location And remember to inject angular parameters using the _AngularName_ syntax.
answers question: http://stackoverflow.com/q/28325880
score: 0
type: Answer

http://stackoverflow.com/comment/88082597
has text: Can you rewrite it on js ? Because to understand your answer one need to learn unnecessary technology.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/50534527

http://stackoverflow.com/q/28367734
has comment: http://stackoverflow.com/comment/45076817
has answer: http://stackoverflow.com/a/28367772
tagged with: javascript
tagged with: jquery
type: AnsweredQuestion
tagged with: datatables
has body: I have datatable: function drawRadnici() { $('#tableradnici').dataTable({ "ajax": { "url": 'track_radnici.php', "type": 'POST', "data": {ajdi:ajdi}, }, paging: false, //"dom":' &lt;"search"f&gt;&lt;"top"l&gt;rt&lt;"bottom"ip&gt;&lt;"clear"&gt;', // end , "columns": [ { "data": "datum"}, { "data": "radnik"},{ "data": "radnih_sati"},{ "data": "cena"},{ "data": "ukupno"},{ "data": "ID"} ], "columnDefs": [ { "targets": 5, "data": "ID", "render": function(data, type, full, meta) { // return data; return '&lt;i value="'+data+'" class="fa fa-times"&gt;&lt;/i&gt;'; } } ] }); }; and work fine, but when I have empty JSON data from database then I get: Uncaught TypeError: Cannot read property 'length' of null MY json when I havent data is: {data:null} WHat I was try to do - I try to add success function to ajax: "ajax": { "url": 'track_radnici.php', "type": 'POST', "data": {ajdi:ajdi}, "success": function (data) { if (data == null) { $('#tabeleradnici').html('No result'); } } }, so I try when I dont have data to add just text to #tabeleradnici ... but this also dont work ...
type: Question
accepted answer: http://stackoverflow.com/a/28367772
tagged with: datatable
has title: DataTable - Cannot read property 'length' of null
score: 0
tagged with: http://stackoverflow.com/tag/json
answer count: 1

http://stackoverflow.com/comment/102180314
type: Comment
has text: @Arashsoft This answer worked 4 years ago and I haven't used Angular in a few years. I wouldn't be surprised if they changed this behavior in the interim. I'd suggest looking at the angular source code to see what changed
type: AnswerComment
comment on: http://stackoverflow.com/a/34501500
score: 0

http://stackoverflow.com/q/28357785
score: 5
has answer: http://stackoverflow.com/a/28357855
tagged with: javascript
answer count: 3
has title: using key value pair of same object inside itself with 'this' in javascript
duplicate of: http://stackoverflow.com/q/4616202
favorite count: 0
has answer: http://stackoverflow.com/a/69936826
upvote count: 5
type: UnansweredQuestion
has body: Let's say I have two objects like var a = { b: 1, c: this.b }; And var funcObj = { b : function() { return 1; }, c: function() { console.log(return this.b()) } } On logging these two like console.log(a.c)//results undefined console.log(funcObj.c()) //results 1 Why can't the first function use the this property but the second one can? I am really confused.
tagged with: object
has comment: http://stackoverflow.com/comment/45058824
linked to: http://stackoverflow.com/q/4616202
downvote count: 0
has answer: http://stackoverflow.com/a/28358201
type: Question

http://stackoverflow.com/a/28404983
type: Answer
answers question: http://stackoverflow.com/q/28339235
has comment: http://stackoverflow.com/comment/45144607
score: 0
has body: Did you try setting the autoscale option to false? Try setting the autoscale to false in axes{} or xaxis(or yaxis) Check jqPLot docs : jqPlot Autoscale Axis Hope it helps !!

http://stackoverflow.com/comment/45026508
type: Comment
type: QuestionComment
score: 0
has text: currentnode.parent().removeClass("checked")?
comment on: http://stackoverflow.com/q/28340731

http://stackoverflow.com/a/28350151
answers question: http://stackoverflow.com/q/28349972
type: Answer
has comment: http://stackoverflow.com/comment/45044883
has comment: http://stackoverflow.com/comment/45048340
score: 0
has body: https://developers.facebook.com/docs/graph-api/reference/v2.2/user/feed#publish You would need to authorize the user with publish_actions to do that. You need to go through the Login Review process with that permission and the message parameter must be 100% user generated according to the platform policy. A lot of things to consider, i´d just stick to the popup.

http://stackoverflow.com/comment/45068114
type: QuestionComment
comment on: http://stackoverflow.com/q/28362958
score: 0
has text: Is Preetesh.Dev's answer is the correct way to do this?
type: Comment

http://stackoverflow.com/a/28423169
type: Answer
has body: This may work for you thenums = "4567"; if (thenums.match(/(0123|1234|2345|3456|4567|5678|6789|7890|(\d)\2\2\2)/)) { alert("bad number sequence, bad!"); } This looks for 4 digit sequential strings or 4 same-digit strings anywhere within your variable. If you want to match the entire string you can do thenums = "4567"; if (thenums.match(/^(0123|1234|2345|3456|4567|5678|6789|7890|(\d)\2\2\2)$/)) { alert("bad number sequence, bad!"); } If you'd prefer to trip on three-digit repetitions, you can remove one of the \2s. demo fiddle Update, fiddling with this, I made this regex that will search for a string containing sequential numbers if it matches the whole string. ^(0(?=$|1(?=$|2(?=$|3(?=$|4(?=$|5(?=$|6(?=$|7(?=$|8(?=$|9)))))))))|1(?=$|2(?=$|3(?=$|4(?=$|5(?=$|6(?=$|7(?=$|8(?=$|9(?=$|0)))))))))|2(?=$|3(?=$|4(?=$|5(?=$|6(?=$|7(?=$|8(?=$|9(?=$|0(?=$|1)))))))))|3(?=$|4(?=$|5(?=$|6(?=$|7(?=$|8(?=$|9(?=$|0(?=$|1(?=$|2)))))))))|4(?=$|5(?=$|6(?=$|7(?=$|8(?=$|9(?=$|0(?=$|1(?=$|2(?=$|3)))))))))|5(?=$|6(?=$|7(?=$|8(?=$|9(?=$|0(?=$|1(?=$|2(?=$|3(?=$|4)))))))))|6(?=$|7(?=$|8(?=$|9(?=$|0(?=$|1(?=$|2(?=$|3(?=$|4(?=$|5)))))))))|7(?=$|8(?=$|9(?=$|0(?=$|1(?=$|2(?=$|3(?=$|4(?=$|5(?=$|6)))))))))|8(?=$|9(?=$|0(?=$|1(?=$|2(?=$|3(?=$|4(?=$|5(?=$|6(?=$|7)))))))))|9(?=$|0(?=$|1(?=$|2(?=$|3(?=$|4(?=$|5(?=$|6(?=$|7(?=$|8))))))))))+$ And a formatted version, for your viewing pleasure. ^(0(?=$|1(?=$|2(?=$|3(?=$|4(?=$|5(?=$|6(?=$|7(?=$|8(?=$|9))))))))) |1(?=$|2(?=$|3(?=$|4(?=$|5(?=$|6(?=$|7(?=$|8(?=$|9(?=$|0))))))))) |2(?=$|3(?=$|4(?=$|5(?=$|6(?=$|7(?=$|8(?=$|9(?=$|0(?=$|1))))))))) |3(?=$|4(?=$|5(?=$|6(?=$|7(?=$|8(?=$|9(?=$|0(?=$|1(?=$|2))))))))) |4(?=$|5(?=$|6(?=$|7(?=$|8(?=$|9(?=$|0(?=$|1(?=$|2(?=$|3))))))))) |5(?=$|6(?=$|7(?=$|8(?=$|9(?=$|0(?=$|1(?=$|2(?=$|3(?=$|4))))))))) |6(?=$|7(?=$|8(?=$|9(?=$|0(?=$|1(?=$|2(?=$|3(?=$|4(?=$|5))))))))) |7(?=$|8(?=$|9(?=$|0(?=$|1(?=$|2(?=$|3(?=$|4(?=$|5(?=$|6))))))))) |8(?=$|9(?=$|0(?=$|1(?=$|2(?=$|3(?=$|4(?=$|5(?=$|6(?=$|7))))))))) |9(?=$|0(?=$|1(?=$|2(?=$|3(?…
score: 0
has comment: http://stackoverflow.com/comment/45179648
answers question: http://stackoverflow.com/q/28423056

http://stackoverflow.com/comment/44975509
score: 0
type: Comment
type: QuestionComment
has text: You mention the styles are gone... If you could edit your question and put your css maybe we can see what's going on
comment on: http://stackoverflow.com/q/28312326

http://stackoverflow.com/comment/45034909
has text: try remove the name from it.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28345296

http://stackoverflow.com/a/28361533
type: Answer
score: 0
has body: When you moved the script from being inline to being external you also moved the script tag to the &lt;head&gt;. Now the script runs before any element that matches div:not(:first-child) p exists so first_container doesn't have any elements in it. Move the script element back to where it was before. Alternatively, move the code you have into a function and then run that function after the document has loaded (e.g. with addEventListener('load', your_function)).
answers question: http://stackoverflow.com/q/28361475

http://stackoverflow.com/a/28348035
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/28347477
has body: In .banner:before, .banner:after set border-top style to solid, border-top: 10px solid #5C5C5B;.
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28347477
upvote count: 1

http://stackoverflow.com/q/28420697
type: Question
has comment: http://stackoverflow.com/comment/45174598
has comment: http://stackoverflow.com/comment/45196641
has title: Setting Top dynamically not working in firefox
tagged with: firefox
tagged with: javascript
tagged with: jquery
score: 0
tagged with: css
has comment: http://stackoverflow.com/comment/45195318
answer count: 0
has body: var topvalue=document.getElementById("lvl1App").scrollTop-2; $('thead.fixedheader2 th').css({ "position":"relative", "top": topvalue, "height":"10px", "background-color":"#CCCC99" }); the backgroud color is applying to each th but top is not getting set in firefox. It is working in all other browser IE10,IE11,Chrome,Safari but not in firefox,
type: UnansweredQuestion

tcp
type: Tag
tags question: http://stackoverflow.com/q/28437000
tag name: tcp

http://stackoverflow.com/comment/44980766
type: QuestionComment
has text: @OzgurBar and what should i add at dataString im new in ajax.. dont really know about it my apologize
comment on: http://stackoverflow.com/q/28315584
score: 0
type: Comment

http://stackoverflow.com/a/28410006
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28409927
has body: You can use the replace function var num = 1.123.355,50; current = num.replace(/,/g, '.'); // Current now has '.' instead of ',' I think Flash Thunder has the more thorough answer.

http://stackoverflow.com/comment/45183995
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28417766
has text: Thanks, this works to have the function run asynchronously but I need to make sure it is finished before stoping the refresh function. Is this where I should use the dfd resolve the promise? Or? I basically need the result to be transmitted to my local scope which it is not right now on the first refresh but only on the second
score: 0

http://stackoverflow.com/q/28421735
type: UnansweredQuestion
has title: How to get my javascript function to start on element click?
type: Question
has answer: http://stackoverflow.com/a/28422311
score: 0
answer count: 2
tagged with: function
tagged with: javascript
has comment: http://stackoverflow.com/comment/45176790
tagged with: timer
tagged with: element
has body: My code is as below, but it seems to start immediately on page load, when I want it to start when an element is clicked on. Not sure why it is firing on page load? The code removes the 'next question' and 'prev question' elements from view when the timer is elapsed so the user must end the quiz. The element to be clicked on (for example #pretest) should theoretically disappear at the same time and commence the timer, but each method I try either breaks the timer or the timer ignores the rule completely. Total JS newbie. $(function() { $('#next-question,#prev-question').removeAttr('disabled'); setTimeout(enableButton, 678000); function enableButton(){ $('#next-question,#prev-question').css( 'display', 'none' ); $('#next-question,#prev-question').attr("disabled", "false"); } }); function countdown() { var m = $('.min'); var s = $('.sec'); if(m.length == 0 && parseInt(s.html()) <= 0) { $('.displayCounter_ng').html('Test Complete'); } if(parseInt(s.html()) <= 0) { m.html(parseInt(m.html()-1)); s.html(60); } if(parseInt(m.html()) <= 0) { $('.displayCounter_ng').html('59 seconds'); } s.html(parseInt(s.html()-1)); } setInterval('countdown()',1000);
has comment: http://stackoverflow.com/comment/45176769
tagged with: onclick
has answer: http://stackoverflow.com/a/28421958

http://stackoverflow.com/comment/45198693
comment on: http://stackoverflow.com/a/28434217
score: 1
has text: @DRX that two lines of code is all you need. I AM NOT USING AN ARRAY . So, you don't need to worry about how many properties.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45086423
comment on: http://stackoverflow.com/a/28372325
type: AnswerComment
score: 0
type: Comment
has text: I might be wrong but I believe that OP wants to know how to call a function defined in the local scope of a certain prototype method. What you explained is how to create a global function which logs its parameter..

http://stackoverflow.com/comment/44977986
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28313990
score: 0
has text: @dandavis What's the difference between doing what you're saying and my `return namespace`?

http://stackoverflow.com/q/28299865
has comment: http://stackoverflow.com/comment/44952503
tagged with: vbscript
type: Question
has comment: http://stackoverflow.com/comment/45036815
tagged with: c#
has comment: http://stackoverflow.com/comment/44982215
has body: I have a problem. I have to set a custom printer in the print dialogue while working on client side environment. By using windows.print() I can see the list of printers but how can I choose the printer of my own choice from that list when the print dialogue is open.
tagged with: javascript
has comment: http://stackoverflow.com/comment/44993063
score: 0
tagged with: printing
tagged with: asp.net
answer count: 0
type: UnansweredQuestion
has title: How to set default printer in selection list asp.net

papaparse
type: Tag
tags question: http://stackoverflow.com/q/28317438
tag name: papaparse

http://stackoverflow.com/a/28430400
answers question: http://stackoverflow.com/q/28429783
score: 0
type: Answer
has body: Your code was not very easy to maintain, so I made my own version, try it out: function sort() { var text = document.getElementById("text").value; // will contain a list of chars with their associated count var charCounter = {}; for (var i = 0, l=text.length; i &lt; l; i++) { var char = text[i]; // if char is a number if(!isNaN(parseInt(char))){ if(charCounter[char]){ charCounter[char]++; } else { charCounter[char] = 1; } // if char is not a number } else { if(charCounter['other characters']){ charCounter['other characters']++; } else { charCounter['other characters'] = 1; } } } outputList(charCounter); } function outputList(obj){ var keys = Object.keys(obj); var output = ''; for(var i=0, l=keys.length; i&lt;l; i++){ output += 'Number of ' + keys[i] + ' : ' + obj[keys[i]] + '.\n'; } alert(output); } JS Fiddle Demo

http://stackoverflow.com/q/28293331
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28293404
favorite count: 0
has comment: http://stackoverflow.com/comment/44939564
has title: what actually does this keyword in javascript works?
has body: Actually i am beginner in javascript and i am making a todo list with only javascript and given is my code.. function updateItemStage() { var cbId = this.id.replace("cb_", ""); var itemText = document.getElementById("Item_" + cbId); if (this.checked) { itemText.className = "checked"; } else { itemText.className = ""; } } function addNewItem(list, itemText) { totalItems++; var listItem = document.createElement("li"); var checkBox = document.createElement("input"); checkBox.type = "checkbox"; checkBox.onclick = updateItemStage; checkBox.id = "cb_" + totalItems; var span = document.createElement("span"); span.innerHTML = itemText; span.id = "Item_" + totalItems; listItem.appendChild(checkBox); listItem.appendChild(span); list.appendChild(listItem); } var totalItems = 0; var btnNew = document.getElementById("btnAdd"); btnNew.onclick = function() { var todoInput = document.getElementById("todoInput") var itemText = todoInput.value; if(!itemText || itemText == "") { return false; } addNewItem(document.getElementById("todolist"), itemText); }; Using this code i successfully create a todo list but in this code i didn't get what is the main role and work of this keyword.. can anyone help me please to understand this problem ???????????
has comment: http://stackoverflow.com/comment/44939670
has comment: http://stackoverflow.com/comment/44939471
downvote count: 1
has answer: http://stackoverflow.com/a/28293404
type: AnsweredQuestion
score: -1
type: Question
upvote count: 0

http://stackoverflow.com/q/28363520
answer count: 3
tagged with: css
has body: I need to make my changes only at my responsive css and I don't want it to affect my normal css? How can I do it with the codes. Here is my js: $("#open-button").click(function () { $('#additem').css({ 'margin-left': '10%' }); }); The below is my css and responsive css /*normal css*/ #additem{ margin-left:0; } /*responsive css*/ @media all and (max-width: 1366px) { #additem{ margin-left: 25%; } }
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28363597
has comment: http://stackoverflow.com/comment/45068849
score: 2
type: Question
has comment: http://stackoverflow.com/comment/45068918
has title: Changing css class for responsive css
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45068816
favorite count: 0
has answer: http://stackoverflow.com/a/28363635
has comment: http://stackoverflow.com/comment/45068847
has answer: http://stackoverflow.com/a/28363610

http://stackoverflow.com/comment/45137437
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28400872
has text: Can you change the value of onclick? You can refer it to a custom function that calls both alerts in whatever order you like.
score: 0

http://stackoverflow.com/q/28383925
score: 0
has body: I am trying to display values 1,2,3,4,5 in a dropdown in VisualForce Page, however I want to display value '3' as selected by default. &lt;apex:page controller="sampleCon"&gt; &lt;apex:includeScript value="{!URLFOR($Resource.jQuery, 'jquery-ui-1.9.2.custom/js/jquery-1.8.3.js')}"/&gt; &lt;apex:includeScript value="{!URLFOR($Resource.jQuery, 'jquery-ui-1.9.2.custom/js/jquery-ui-1.9.2.custom.min.js')}"/&gt; &lt;apex:stylesheet value="{!URLFOR($Resource.jQuery, 'jquery-ui-1.9.2.custom/css/ui-lightness/jquery-ui-1.9.2.custom.min.css')}"/&gt; &lt;script type="text/javascript"&gt; var j$ = jQuery.noConflict(); j$('#noOfItems option').filter(function () { return j$(this).text() == '3'; })[0].selected = true; &lt;/script&gt; &lt;apex:form &gt; &lt;br/&gt; &lt;apex:selectList size="1" id="noOfItems" &gt; &lt;apex:selectOptions value="{!items}" id="test"/&gt; &lt;/apex:selectList&gt; &lt;/apex:form&gt; &lt;/apex:page&gt; Here {!items} contains 1,2,3,4,5 and if i display 1 is getting selected as default. I have tried many options from google but nothing is working for me. (jQuery is running fine)
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45106159
has comment: http://stackoverflow.com/comment/45105908
has comment: http://stackoverflow.com/comment/45105837
answer count: 0
has comment: http://stackoverflow.com/comment/45106011
type: Question
has comment: http://stackoverflow.com/comment/45105820
has title: Set default display value for dropdown using jQuery

http://stackoverflow.com/comment/45054401
has text: @DaveGoten If I pass in the date as `April`, it has to show `[60, 40]`, if its `march`, since its not a complete quarter I need to see the array as `[10,20,30]`. Its not possible with the above code.
type: Comment
comment on: http://stackoverflow.com/a/28353831
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45163508
has text: @Phylogenesis nope, this is my only click handler on the page.
comment on: http://stackoverflow.com/q/28414737
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28295666
has answer: http://stackoverflow.com/a/28295807
has comment: http://stackoverflow.com/comment/44944138
score: 2
has comment: http://stackoverflow.com/comment/44944623
has comment: http://stackoverflow.com/comment/44944282
has body: I want to call a jQuery function once the ASP.Net GridView is displayed. I have tried ready/load functions but none works for me. the grid is inside Update Panel &lt;asp:GridView ID="grdNumberPlan" runat="server" CssClass="table table-condensed table-hover table-striped rt" Visible="false"&gt; &lt;/asp:GridView&gt; $('#&lt;%=grdNumberPlan.ClientID%&gt;').ready(function () { alert('hello'); }); $('#&lt;%=grdNumberPlan.ClientID%&gt;').load(function () { alert('hello'); }); aspx.cs code protected void ddlCity_SelectedIndexChanged(object sender, EventArgs e) { try { if (ddlHLR.SelectedValue == "0") { ((UIMaster)Page.Master).SetMessage(MessageType.Warnining, "Kindly select HLR"); grdNumberPlan.DataSource = null; grdNumberPlan.DataBind(); rowNewRanges.Visible = false; grdNumberPlan.Visible = false; return; } if (ddlCity.SelectedValue == "0") { ((UIMaster)Page.Master).SetMessage(MessageType.Warnining, "Select the city"); grdNumberPlan.DataSource = null; grdNumberPlan.DataBind(); rowNumPlanSum.Visible = false; grdNumberPlan.Visible = false; return; } //rangeList(); NumberingPlan objNumberingPlan = new NumberingPlan(); objNumberingPlan.CityID = Convert.ToInt32(ddlCity.SelectedValue); objNumberingPlan.HlrID = Convert.ToInt32(ddlHLR.SelectedValue); objNumberingPlan.ExclusiveType = Convert.ToInt32(ddlIssuanceType.IsExclusive.ToString()); objNumberingPlan.Operation_Type = OperationType.Get; InventoryManagementServiceClient client = new InventoryManagementServiceClient(); DataTable dt = new DataTable(); dt = client.GetNumberingPlanRanges(objNumberingPlan).Tables[0]; grdNumberPlan.Visible = true; rowNumPlanSum.Visible = true; grdNumberPlan.DataSource = dt; grdNumberPlan.DataBind(); ///Fill NDC dropdown list /// NDC objNDC = new NDC(); objNDC.HLRID = Convert.ToInt32(ddlHLR.SelectedValue); objNDC.CityID = Convert.ToInt32(ddlCity.SelectedValue); objNDC.Operation_Type = OperationType.Get; DataTable dtNDC = new DataTable(); serviceClient = new CommonServiceClient(); dtNDC = serviceClie…
has title: Call Jquery function after asp.net grid is loaded
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/44943822
has comment: http://stackoverflow.com/comment/44944022
tagged with: javascript
has comment: http://stackoverflow.com/comment/44943974
has answer: http://stackoverflow.com/a/28296283
upvote count: 3
answer count: 2
downvote count: 1
tagged with: jquery
tagged with: asp.net
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/28424038
answer count: 1
tagged with: javascript
tagged with: extjs
score: 0
has title: How to render icon and call function when click icon
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28426862
type: Question
has body: I want to do Lock/Unlock icon button by using Renderer. If clicking the button, it will show message box yes/no to confirm. If click Yes, it should call SubmitValue function. The problem is it cannot call javascript SubmitValue function. How do I call function when click Yes confirm box? Renderer.js var renderLock = function (value, p, record) { if (JSON.parse(value)) { return '&lt;img src="Images/icon/lock.png" &gt;'; } else { return '&lt;img src="Images/icon/unlock.png" &gt;'; } } Common.js var GetGrid_LockButton = function (Active, FieldId, FieldName, Grid_Name, URL) { return { menuDisabled: true , sortable: false , hidden: Permit_No_Del , text: 'Lock' , renderer: renderLock , align: 'center' , xtype: 'actioncolumn' , dataIndex: 'IS_LOCK' , width: 45 , listeners: { click: function () { Ext.MessageBox.confirm('confirm?', function (btn) { if (btn == "yes") { SubmitValue(URL, { id: rec.get(FieldId) }, "Ext.getCmp('" + Grid_Name + "').getStore().load();", "Yes"); } }); } } }; } Thank you in advance.

http://stackoverflow.com/comment/44982013
type: Comment
type: QuestionComment
has text: this is the code for html: other codes are oroginally from jQuery. Select Project Select Duration
score: 0
comment on: http://stackoverflow.com/q/28309433

http://stackoverflow.com/a/38986143
has comment: http://stackoverflow.com/comment/135096158
downvote count: 0
type: Answer
upvote count: 29
has comment: http://stackoverflow.com/comment/123033284
has comment: http://stackoverflow.com/comment/135107457
score: 29
has comment: http://stackoverflow.com/comment/116842074
answers question: http://stackoverflow.com/q/28314368
has body: We have an application that allows the user to set "parameters" in the page. What we do is set those params on the URL, using React Router (in conjunction with History) and a library that URI-encodes JavaScript objects into a format that can be used as your query string. When the user selects an option, we can push the value of that onto the current route with: history.push({pathname: 'path/', search: '?' + Qs.stringify(params)}); pathname can be the current path. In your case params would look something like: { selectedOption: 5 } Then at the top level of the React tree, React Router will update the props of that component with a prop of location.search which is the encoded value we set earlier, so there will be something in componentWillReceiveProps like: params = Qs.parse(nextProps.location.search.substring(1)); this.setState({selectedOption: params.selectedOption}); Then that component and its children will re-render with the updated setting. As the information is on the URL it can be bookmarked (or emailed around - this was our use case) and a refresh will leave the app in the same state. This has been working really well for our application. React Router: https://github.com/reactjs/react-router History: https://github.com/ReactTraining/history The query string library: https://github.com/ljharb/qs

http://stackoverflow.com/q/28285372
downvote count: 0
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/44924779
tagged with: angularjs-http
has title: Angular http json request issue
has answer: http://stackoverflow.com/a/28285440
has answer: http://stackoverflow.com/a/28285467
type: UnansweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: angularjs-directive
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/44924733
tagged with: javascript
has body: Hello I have a simple question but I'm running into problems. I edited some code that I found on line. I'm trying to utilize an Angular http service to retrieve JSON data but it doesn't seem to be working var app = angular.module('app', []); app.controller('MainCtrl', function($scope, $http) { $http.get('https://www.dropbox.com/s/325d678ksplb7qs/names.json') sucess(function(data, status, headers, config) { $scope.posts = data; }). error(function(data, status, headers, config) { // log error }); }); My code example is below http://codepen.io/jimmyt1001/pen/dPVveN
has answer: http://stackoverflow.com/a/28285529
answer count: 3

http://stackoverflow.com/comment/45090132
has text: Thanks for the quick answer. But what's the point of that callback? Just an implementation matter?
type: AnswerComment
comment on: http://stackoverflow.com/a/28374469
score: 0
type: Comment

http://stackoverflow.com/comment/45028631
has text: Good answer but I really want to see DOM level 2 events ;)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28341813
type: Comment

extjs
tags question: http://stackoverflow.com/q/28409834
tags question: http://stackoverflow.com/q/28409620
tags question: http://stackoverflow.com/q/28376617
tags question: http://stackoverflow.com/q/28370593
tags question: http://stackoverflow.com/q/28340231
type: Tag
tags question: http://stackoverflow.com/q/28301740
tags question: http://stackoverflow.com/q/28424038
tags question: http://stackoverflow.com/q/28319695
tags question: http://stackoverflow.com/q/28375166
tags question: http://stackoverflow.com/q/28282512
tags question: http://stackoverflow.com/q/28308388
tags question: http://stackoverflow.com/q/28293245
tags question: http://stackoverflow.com/q/28337009
tags question: http://stackoverflow.com/q/28294123
tag name: extjs
tags question: http://stackoverflow.com/q/28433867
tags question: http://stackoverflow.com/q/28430733
tags question: http://stackoverflow.com/q/28396760
tags question: http://stackoverflow.com/q/28296088
tags question: http://stackoverflow.com/q/28353784
tags question: http://stackoverflow.com/q/28290031
tags question: http://stackoverflow.com/q/28376710
tags question: http://stackoverflow.com/q/28383720

http://stackoverflow.com/comment/44945399
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28296340
has text: `{{foo}}` is automatically "translated" to `` so there should be absolutely no differences between them.

http://stackoverflow.com/comment/45087777
comment on: http://stackoverflow.com/q/28372112
has text: You're not setting the cookie correctly. The cookie should be in the form `name=value`. You're just putting the JSON into `document.cookie` without giving it a name.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28523362
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/28364342
downvote count: 0
answers question: http://stackoverflow.com/q/28364342
has body: $(_selector_).aciTree(_options_) call will init the tree view just once (using the provided options). Nothing will happen if you call it twice. To be able to init the tree view with other options, you'll need to destroy it first. In your case, you need just to update the tree view ajax.url option. First unload the tree, then reload it from the new url. To update one of the aciTree options at runtime, use the option method. Note that you can use the dot notation to reach deep level properties: api.option('ajax.url', '_your_new_url_'); Then you can call unload/ajaxLoad (as in your example).
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/q/28358904
score: 1
has comment: http://stackoverflow.com/comment/45066590
has comment: http://stackoverflow.com/comment/45061222
type: Question
tagged with: image-loading
has title: Check image is loaded when source set by js?
downvote count: 0
has answer: http://stackoverflow.com/a/28359093
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28358933
favorite count: 0
has body: How could i check that image is loaded when i am set image source from jquery. i want change image on mouse over and due large image size its taking time to loading so want to show loading image until it loads. Here is my code snippet: timer = setInterval(function() { selector.attr('src', 'localhost/product/image1.jpg'); image1 is 436x436 and its taking time to load i want to show loading image before loading this image Please help me...
possible better answer: http://stackoverflow.com/a/28358966
has answer: http://stackoverflow.com/a/28358966
has answer: http://stackoverflow.com/a/28359080
has comment: http://stackoverflow.com/comment/45060852
linked to: http://stackoverflow.com/q/1977871
has answer: http://stackoverflow.com/a/28358984
answer count: 5
tagged with: image-load
upvote count: 1
has answer: http://stackoverflow.com/a/28358933
type: AnsweredQuestion

http://stackoverflow.com/a/28406626
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/45147633
downvote count: 0
has body: I prefer using css transitions these days over jquery animations. To me that appears more clear and easier to read, since logic and visualization are more separate. In the end the action is not the fading, but the change of state (or class in this case). The fading effect is a pure optic gimmick. nav ul { display: block; opacity: 0; transition: opacity 500ms; } nav ul.show { opacity: 1; }
type: Answer
answers question: http://stackoverflow.com/q/28406445

http://stackoverflow.com/q/28341003
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28341536
favorite count: 0
upvote count: 1
tagged with: css
has body: I am using the cycle2 jQuery plugin in my website, it all works but I want to place the prev and next buttons alongside my thumbnails. I didn't want to do absolute positioning as I wanted it to be responsive. Is there a way of constantly aligning the next and prev to the first and last thumbnail? Here is my code. Thanks! &lt;div id="main"&gt; &lt;script src="http://malsup.github.io/jquery.cycle2.carousel.js"&gt;&lt;/script&gt; &lt;script src="http://malsup.github.io/jquery.cycle2.tile.js"&gt;&lt;/script&gt; &lt;div class="row"&gt; &lt;div class="container"&gt; &lt;div class="col-md-12"&gt; &lt;div id="slideshow-1"&gt; &lt;div id="cycle-1" class="cycle-slideshow" data-cycle-slides="&gt; div" data-cycle-timeout="0" data-cycle-prev="#slideshow-1 .cycle-prev" data-cycle-next="#slideshow-1 .cycle-next" data-cycle-caption="#slideshow-1 .custom-caption" data-cycle-caption-template="Slide {{slideNum}} of {{slideCount}}" data-cycle-fx="tileBlind"&gt; &lt;div&gt; &lt;img src="images/slider.jpg" class="img-responsive slideshow-img"&gt; &lt;/div&gt; &lt;div&gt; &lt;img src="images/slider.jpg" class="img-responsive slideshow-img"&gt; &lt;/div&gt; &lt;div&gt; &lt;img src="images/slider.jpg" class="img-responsive slideshow-img"&gt; &lt;/div&gt; &lt;div&gt; &lt;img src="images/slider.jpg" class="img-responsive slideshow-img"&gt; &lt;/div&gt; &lt;div&gt; &lt;img src="images/slider.jpg" class="img-responsive slideshow-img"&gt; &lt;/div&gt; &lt;div&gt; &lt;img src="images/slider.jpg" class="img-responsive slideshow-img"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="slideshow-2"&gt; &lt;div id="cycle-2" class="cycle-slideshow" data-cycle-slides="&gt; div" data-cycle-timeout="0" data-cycle-prev="#slideshow-2 .cycle-prev" data-cycle-next="#slideshow-2 .cycle-next" data-cycle-caption="#slideshow-2 .custom-caption" data-cycle-caption-template="Slide {{slideNum}} of {{slideCount}}" data-cycle-fx="carousel" data-cycle-carousel-visible="5" data-cycle-carousel-fluid=true data-allow-wr…
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45027339
accepted answer: http://stackoverflow.com/a/28341536
has comment: http://stackoverflow.com/comment/45027218
downvote count: 1
type: Question
answer count: 1
tagged with: javascript
has title: Place previous and next buttons alongside thumbnails
tagged with: jquery

http://stackoverflow.com/a/28388495
type: Answer
downvote count: 0
has body: Fixed it: firing an alert instead of just randomly. Also: getPlaylistItem is not supported in old versions of JW Player. It's supported in 6.5 and above.
answers question: http://stackoverflow.com/q/28388169
score: 1
upvote count: 1

http://stackoverflow.com/comment/45063133
score: 0
type: QuestionComment
type: Comment
has text: with conditional statement, onload event and this http://stackoverflow.com/questions/21695729/how-to-get-child-element-text-using-only-javascript
comment on: http://stackoverflow.com/q/28360197

http://stackoverflow.com/a/30361299
has body: The tooltips in Google Charts are absolutely very customizable. By setting the 'tooltip.isHtml: true' you can manipulate the tooltip output with HTML markup. Google has a breakdown of how to do it here.
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28385239
upvote count: 1

http://stackoverflow.com/a/28555605
type: Answer
has body: Unfortunately, JS exceptions are handled by the WebView and even native plugins run in their own separate thread, and will not crash the main Application thread if you raise an exception there (this may not be true for hybrid applications). So you need to hook into the main activity and cause it to throw an Exception on the main thread. Subclass the CordovaActivity class and override the plugin messaging method: @Override public Object onMessage(String id, Object data) { if ("crashApp".equals(id)) { throw new Exception(); } super(id, data); } Write an Android native plugin for Phonegap as per this answer. What it does doesn't matter, but when you message it from the Javascript you should use the id 'crashApp' which should be picked up by your overridden method in the CordovaActivity subclass, and raise the Exception on the main thread. . Then you can message your plugin using this id whenever you have a Javascript exception by overriding the window.onerror function: window.onerror = function myFunction(errorMsg, url, lineNumber) { /* call Android native function to throw Exception */ ; return false; } This will throw all Javascript errors down into your Java code where they can raise the ANR dialog (and you can pass debugging information with it too).
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/28340920
upvote count: 3
has comment: http://stackoverflow.com/comment/47996562
has comment: http://stackoverflow.com/comment/47947550
has comment: http://stackoverflow.com/comment/47944101

http://stackoverflow.com/q/28327792
has comment: http://stackoverflow.com/comment/45003267
tagged with: http://stackoverflow.com/tag/xml
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/19901843
has answer: http://stackoverflow.com/a/28329729
linked to: http://stackoverflow.com/q/12385501
upvote count: 1
type: Question
score: 1
tagged with: java
tagged with: http://stackoverflow.com/tag/json
answer count: 2
has body: I'm now working with API calls currectly, so most the requests are done through ajax call. As you can expect, both the data sent to server and data received from server will be xml data. I've successfully able to dynamically construct the xml data during the sign up process and during post requests. By utilising JaxB, I've done the necessary steps in server. Now I've to get the data as xml from server if a user needs to view a ceertain resource. Like before, I'm using jaxb to convert Java object into xml data and I'm getting the xml data in success function of Javascript. There are lot of examples and questions present on converting this xml data into user viewable form. By my main goal is to make every function Dynamic, Consider now I'm going to show the list of users to admin, I can use these examples to convert my xml data into tables. Display JSON Data in HTML Table populate jquery data table with returned json data If I'm doing like that, I've to manually write the same process with some modification based on table fields for every list view. This is a bad practise if I'm going to copy paste the same code with some modifications for 10 list views. I would like to make the xml to table conversion as a common function for any number of tables no matter how many fields are present in it. I'm getting the xml data from server as String. So I've converted it to recognizable xmlData using following code. var xmlData = jQuery.parseXML(data); //data is the xml String which I'm getting from server //Converting xmlData into JSON Objects var containerTag = myTag //I can get this from - document.getElementById("tableId").name var output = new Array( ); var rawData = xmlData.getElementsByTagName(containerTag)[0]; var i, j, oneRecord, oneObject; for (i = 0; i < rawData.childNodes.length; i++) { if (rawData.childNodes[i].nodeType == 1) { oneRecord = rawData.childNodes[i]; oneObject = output[output.length] = new Object( ); for (j = 0; j < oneRecord.childNodes.length; j++) { if …
possible better answer: http://stackoverflow.com/a/28329729
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28328149
favorite count: 0
accepted answer: http://stackoverflow.com/a/28328149
has title: Converting JSON Object to table rows Dynamically

http://stackoverflow.com/q/28369936
possible better answer: http://stackoverflow.com/a/28370035
score: 2
type: AnsweredQuestion
upvote count: 2
tagged with: ascx
tagged with: vb.net
type: Question
has body: I am trying to make a simple javascript function work in the .ascx file in my asp.net and vb.net application. I have included the following html code inside the asp panel tag. <asp:CheckBox ID="tick" runat="server" Text="Please tick the box to confirm the above information are correct" Checked="false" CssClass="small" onchange="EnableSubmit()" /> and the following javascript code in the .ascx file to understand the problem better that I am talking about and to see my page live please go to the following link. http://t.c.mypeoplebiz.com/sagepay-careers/2935-commercial-litigator-solicitor-1-3-years-pqe.aspx and click apply now button. A popup will appear. please give a email address to register. (don't worry. it does not have to be a original email address. just abc@xyz.com is fine). When you upload a document then you can see the form.The check box is at the bottom of the page.
has answer: http://stackoverflow.com/a/28370026
tagged with: javascript
answer count: 2
downvote count: 0
tagged with: asp.net
has title: Simple Javascript function is not working on .ascx file
has answer: http://stackoverflow.com/a/28370035
tagged with: colorbox
favorite count: 0
accepted answer: http://stackoverflow.com/a/28370026
linked to: http://stackoverflow.com/q/3785816

http://stackoverflow.com/comment/45119021
has text: What "*didn't seem to work*" mean?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28390844

http://stackoverflow.com/q/28309543
score: -1
has comment: http://stackoverflow.com/comment/44970118
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/44970213
has body: I currently have an ajax request which populates form data on submission. I'd like to adjust so that it populates when a form field (ex: ordernum) has an entered value. I've tried to adjust the coding to execute onChange but just get an error. function get_data() { // stop the form submitting // event.preventDefault(); // grab the ID and send AJAX request if not (empty / only whitespace) var ID = this.elements.ordernum.value; if (/\S/.test(ID)) { ajax_request(this.action, {"action" : "fetch", "ordernum" : ID}, process_response); } else { alert("No ID supplied"); } } // encapsulate the lot within a function scope called on document ready window.addEventListener("DOMContentLoaded", function() { // hook the submit action on the form var frm = document.getElementById("quick-form"); frm.addEventListener("submit", frm_submit, false); /** * function to handle form submit, and request data from server * @param {Event} event */ function frm_submit(event) { // stop the form submitting event.preventDefault(); // grab the ID and send AJAX request if not (empty / only whitespace) var ID = this.elements.ordernum.value; if (/\S/.test(ID)) { ajax_request(this.action, {"action" : "fetch", "ordernum" : ID}, process_response); } else { alert("No ID supplied"); } } ... blah ... }
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28309848
has title: How can I run ajax request on field exit?
upvote count: 0
favorite count: 0
tagged with: ajax
type: Question

http://stackoverflow.com/a/28408079
has body: Maybe you like something like this. CSS: table{ width:100%; } table tr td{ border: 2px solid grey; } .itemcheck{ float:left; } .tdText{ float:left; margin-left:15px; margin-top:10px; margin-bottom:10px; } HTML: sample1 sample2 sample3 sample4
answers question: http://stackoverflow.com/q/28407664
score: 0
type: Answer

http://stackoverflow.com/q/28338373
type: UnansweredQuestion
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45022166
has comment: http://stackoverflow.com/comment/45022366
has comment: http://stackoverflow.com/comment/45022242
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
has body: Hi i am newbie in javascript and jquery, right now i am building a simple. It returned error at the last line. Thank you for your time. There is some more code above but seem it requires some text so cut them out Countdown.prototype.reset = function() { time = this.start_time.split(":"); this.minutes = parseInt(time[0]); this.seconds = parseInt(time[1]); this.update_target(); } Countdown.prototype.tick = function() { if (this.seconds &gt; 0 || this.minutes &gt;0) { if (this.seconds == 0) { this.minutes= this.minutes - 1; this.seconds = 59 } else { this.seconds = this.seconds -1; } } this.update_target(); } Countdown.prototype.update_target = function() { seconds = this.seconds; if (seconds &lt; 10) { seconds = "0" + seconds; } $(this.target_id).val(this.minutes + ":" + seconds) }
favorite count: 0
answer count: 0
has title: JQuery javascript timer

scroll
tags question: http://stackoverflow.com/q/28391172
tags question: http://stackoverflow.com/q/28423557
tags question: http://stackoverflow.com/q/28392145
tags question: http://stackoverflow.com/q/28416343
tags question: http://stackoverflow.com/q/28325809
tags question: http://stackoverflow.com/q/28335350
tags question: http://stackoverflow.com/q/28433709
tags question: http://stackoverflow.com/q/28401019
tags question: http://stackoverflow.com/q/28299661
tags question: http://stackoverflow.com/q/28353979
tags question: http://stackoverflow.com/q/28422141
tags question: http://stackoverflow.com/q/28342809
tags question: http://stackoverflow.com/q/28316252
type: Tag
tags question: http://stackoverflow.com/q/28382847
tags question: http://stackoverflow.com/q/28325536
tags question: http://stackoverflow.com/q/28335096
tags question: http://stackoverflow.com/q/28403329
tags question: http://stackoverflow.com/q/28416775
tag name: scroll
tags question: http://stackoverflow.com/q/28318655

drupal
type: Tag
tag name: drupal
tags question: http://stackoverflow.com/q/28307112
tags question: http://stackoverflow.com/q/28314454

http://stackoverflow.com/a/28288747
has body: See the different cursors available you can use cursor CSS | MDN Try the following .on('mouseover', function() { d3.select(this) .style('fill', '#3b6887') .style('cursor', 'pointer'); });
score: 0
accepted answer of: http://stackoverflow.com/q/28288682
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28288682
type: Answer

http://stackoverflow.com/a/28297425
has body: I guess alert is not working in webview try document.write or console.log for see Thanks
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/44949846
has comment: http://stackoverflow.com/comment/44947931
answers question: http://stackoverflow.com/q/28295678
downvote count: 0

http://stackoverflow.com/a/28340163
has comment: http://stackoverflow.com/comment/45026010
downvote count: 0
score: 1
has body: Option 3: use two canvas, on main - draw only on mouse release, and on second preview canvas, just show progress, so drawing will be visible even on mouse move. Also for preview canvas we need to do some tricks like clean previous line segment, so everything looks good. //main canvas var el = document.getElementById('c'); var ctx = el.getContext('2d'); //preview var el2 = document.getElementById('c2'); var ctx2 = el2.getContext('2d'); ctx.lineWidth = 10; ctx2.lineWidth = 10; ctx.lineJoin = ctx.lineCap = 'round'; ctx2.lineJoin = ctx2.lineCap = 'round'; ctx.strokeStyle = "rgba(255, 0, 0, 0.5)"; ctx2.strokeStyle = "rgba(255, 0, 0, 0.5)"; var isDrawing, points = [ ]; el2.onmousedown = function(e) { isDrawing = true; points.push({ x: e.clientX, y: e.clientY }); ctx.beginPath(); ctx2.beginPath(); }; el2.onmousemove = function(e) { if (!isDrawing) return; points.push({ x: e.clientX, y: e.clientY }); //draw just the last segment if(points.length&gt;1) { ctx.moveTo(points[points.length-2].x, points[points.length-2].y); ctx.lineTo(points[points.length-1].x, points[points.length-1].y); //start preview ctx2.beginPath(); //clean from last line ctx2.globalCompositeOperation = "destination-out"; ctx2.strokeStyle = "rgba(255, 0, 0, 1)"; ctx2.moveTo(points[points.length-2].x, points[points.length-2].y); ctx2.lineTo(points[points.length-1].x, points[points.length-1].y); ctx2.stroke(); //rest ctx2.strokeStyle = "rgba(255, 0, 0, 0.5)"; ctx2.globalCompositeOperation = "source-over"; //draw new line segment ctx2.moveTo(points[points.length-2].x, points[points.length-2].y); ctx2.lineTo(points[points.length-1].x, points[points.length-1].y); ctx2.stroke(); } }; el2.onmouseup = function() { ctx2.clearRect(0, 0, ctx2.canvas.width, ctx2.canvas.height); ctx.stroke(); isDrawing = false; points.length = 0; }; canvas { border: 1px solid #ccc; position:absolute; } &lt;canvas id="c" width="500" height="200"&gt;&lt;/canvas&gt; &lt;canvas id="c2" width="500" height="200"&gt;&lt;/canvas&gt;
answers question: http://stackoverflow.com/q/28321588
upvote count: 1
has comment: http://stackoverflow.com/comment/45025733
type: Answer

http://stackoverflow.com/comment/45182197
type: Comment
type: QuestionComment
has text: please share your code
comment on: http://stackoverflow.com/q/28424891
score: 0

http://stackoverflow.com/q/28409066
type: Question
accepted answer: http://stackoverflow.com/a/28420916
has comment: http://stackoverflow.com/comment/45152201
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28420916
upvote count: 1
tagged with: google-chrome-extension
has comment: http://stackoverflow.com/comment/45152890
favorite count: 0
downvote count: 0
has body: I am currently developing a Chrome Extension and I want that the pageAction icon appears for an amount of URL's (around 500). In my background.js file (among other code), I have this: // Called when the url of a tab changes function checkForValidUrl(tabId, changeInfo, tab) { // If the tabs url starts with "http://specific_domain" if (tab.url.indexOf('http://specific_domain') == 0) { // Shows the page action chrome.pageAction.show(tabId); } }; // Listen for any changes to the URL of any tab chrome.tabs.onUpdated.addListener(checkForValidUrl); I can get it to work on a specific site already, but I want to change the 'http://specific_domain' to a list of permitted sites, like a white list. I have access to a JSON file that is online. Here's a snippet of it: { "antelife.com": { "fbid": "AntElifecom", "type": "store", "name": "AntElife" }, "amazon.com": { "fbid": "Amazon", "type": "store", "name": "Amazon" }, "ebay.com": { "fbid": "eBay", "type": "store", "name": "eBay" }, "mobilegeeks.com": { "fbid": "mobilegeekscom", "type": "publisher", "name": "Mobile Geeks" } } I want to extract the domains, and somehow iterate for all of them and if they are on the list, the pageAction icon should appear. Something like this: function checkForValidUrl(tabId, changeInfo, tab) { for (var i = 0, iLength = whiteListUrl.length; i &lt; iLength; i++) { if (tab.url.indexOf('http://www.'+whiteListUrl[i]) &gt; -1) { chrome.pageAction.show(tabId); notification.show(); break; } } }; chrome.tabs.onUpdated.addListener(checkForValidUrl); Any kind of help should be useful. Many thanks.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45152842
has title: Get Chrome pageAction icon to appear for an URL list in JSON
score: 1
tagged with: http://stackoverflow.com/tag/json
tagged with: manifest

http://stackoverflow.com/q/28329224
tagged with: sockets
tagged with: node.js
type: AnsweredQuestion
has title: Check if user refreshed, went back, closed browser etc.. socket.io
has body: I have an application where I use socket.io alongside node.js. I can't find / figure out a way to check for events when users leave application i.e. close browser, refresh page, go back etc.. every one is connected in specific room. I need to know when someone leaves the room, know what their socket.io id was etc.. is there a method to achieve this?
tagged with: socket.io
type: Question
has answer: http://stackoverflow.com/a/28329979
tagged with: javascript
score: 0
answer count: 1
tagged with: websocket
accepted answer: http://stackoverflow.com/a/28329979

http://stackoverflow.com/comment/45169161
comment on: http://stackoverflow.com/a/28417747
type: AnswerComment
score: 0
type: Comment
has text: This solution works, Thanks! I guess my usage of 'this' was incorrect in the question.

http://stackoverflow.com/q/28425545
upvote count: 1
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has body: I am trying to create text node in xml using jQuery. Below is the code which create text node in xml, but it is creating textnode with default namespace. function CheckChildNodeExistance(bindName, $xml) { $xmlNode = $xml.find(bindName); if ($xmlNode.length <= 0) { debugger; var bName = bindName.split(' '); //$xml.find(bName[0] + ' ' + bName[1]).append('<' + bName[2] + '></' + bName[2] + '>'); //var str1 = $xml.createTextNode(bName[2]); //this line gives me error //$xml.append(str1); $xml.append($('<' + bName[2] + '></' + bName[2] + '>')); } } $xml is my jQuery xml object. Output of this method create xml element with default namespace. if you closely look into address node, it has default namespace which is causing the problem. I want to remove this namespace. Can anybody help me on this ABCDEFGH HO 1 1 1 1 1 <E_Mail>1</E_Mail> 1 1 1 1307 gt_Undefined tYES Manish S Chourasia
tagged with: http://stackoverflow.com/tag/xml
tagged with: xml-namespaces
answer count: 0
downvote count: 0
score: 1
tagged with: namespaces
type: Question
has title: unable to create textnode using jQuery without default namespace
tagged with: javascript

http://stackoverflow.com/a/28739889
type: Answer
has body: I got around this by hiding the Next button until an option is selected. I added a new option (No optional extras) with a value of 0 for users that don't require any and this got around the click function issue.
answers question: http://stackoverflow.com/q/28305857
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28305857

http://stackoverflow.com/q/28407887
type: UnansweredQuestion
upvote count: 1
tagged with: image
type: Question
has title: Angular: Run JS code when include finished loading image
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
has body: What I want is to show loading animation while image is loading. Basically I have large system and all code bits are injected using ngInclude. So if I have to construct the bit I'm interested in it would look like: &lt;div ng-controller="MyTabCtrl"&gt; &lt;div id="preview-panel" waiting-animation="img/loading.gif" waiting-property="isLoadingPreview"&gt; &lt;ng-include src="htmlInclude" /&gt; &lt;/div&gt; &lt;/div&gt; And htmlInclude html for example would just be a div with img. The htmlInclude changes when I click different posts I have. So far I loaded low quality images so loading wasn't an issue - it was quick. Now I want to load high-quality images and their loading takes a while. So all my included html (text, buttons etc) is loaded, and the image gets replaced after a few moments. I tried to fiddle with different events I found in other questions, but they don't seem to be working for me. Either the loading doesn't appear at all, or it appears and stays there even after loading is complete. Some stuff I tried is: $scope.$on('$includeContentLoaded', function () { $scope.isLoadingPreview = false ; }); or $scope.$on('$viewContentLoaded', function() { $scope.isLoadingPreview = false ; }); How can I make this happen? Thanks!
tagged with: loading
tagged with: angularjs
answer count: 0

http://stackoverflow.com/a/28329162
has comment: http://stackoverflow.com/comment/45007930
has comment: http://stackoverflow.com/comment/45008814
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45010286
score: 5
has comment: http://stackoverflow.com/comment/45007017
type: Answer
has comment: http://stackoverflow.com/comment/45008901
has comment: http://stackoverflow.com/comment/45006320
has body: So after some debugging (see below in reverse for that chain) it turns out the issue is another message which isn't JSON encoded is being caught by the related code first. While we could trace through to where the other message is coming from (on further discussion, there is apparently a handshake that was being sent on the same socket and getting picked up by this handler—the culprit at last!), it might be easier to just drop it, so we need some validation code: Credit to an amalgam of the answers by @Gumbo and @Matt for the following (because we need to actually run a test, but want to check for null/etc cases too so we're not throwing errors when we go to reference the return object) function IsValidJSON(test) { try { var obj = JSON.parse(test); if (obj &amp;&amp; typeof obj === "object" &amp;&amp; obj !== null) { return true; } } catch (e) { } return false; } With that function available, now we can simply change the original code to: var message; if (IsValidJSON(event.data)) { message = JSON.parse(event.data); console.log(message['error']); } I'm leaving the following earlier versions of the answer in as a debug trail, since this ended up being more of a process of finding the problem than one where the problem and solution were self evident: So this has turned slightly mysterious, let's try going back to basics and verifying that nothing weird/unprintable is in the output: var asciioutput = event.data.charAt(0) + ':' + event.data.charCodeAt(0); for (var i = 1; i &lt; event.data.length; i++) { asciioutput += ', ' + event.data.charAt(i) + ':' + event.data.charCodeAt(i); } console.log(asciioutput); You should end up with a result in your console that looks like this: {:123, ":34, e:101, r:114, r:114, o:111, r:114, ":34, ::58, ":34, W:87, r:114, o:111, n:110, g:103, :32, a:97, c:99, c:99, o:111, u:117, n:110, t:116, ":34, }:125 If your variable includes those wrapping quotes, then they are the problem: remove them. In other words, if console.log(event.data) shows,…
answers question: http://stackoverflow.com/q/28329013
has comment: http://stackoverflow.com/comment/45006706
upvote count: 5
accepted answer of: http://stackoverflow.com/q/28329013
has comment: http://stackoverflow.com/comment/45006495

http://stackoverflow.com/comment/48386786
comment on: http://stackoverflow.com/q/28301617
has text: Need any more help with this? If so I'll update my answer.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28306079
has comment: http://stackoverflow.com/comment/44977563
has comment: http://stackoverflow.com/comment/44963753
tagged with: php
has comment: http://stackoverflow.com/comment/44963693
has body: I am trying to open a base 64 image code in light box is it possible or not ? i tried using fancy box light-box but it didn't worked. here is my code please suggest me any light-box and also tell me how to use that light-box with base 64 :- $SQL_img=mysql_query("select * from image_table"); while($Get=mysql_fetch_array($SQL_img)) { ?> <? echo ' '; ?> <? } ?> --------------------------------WHOLE CODE---------------------------- Short code is enabled. <? mysql_connect('localhost','root',''); mysql_select_db('db_store'); $SQL_img=mysql_query("select * from image_table"); while($Get=mysql_fetch_array($SQL_img)) { ?> <? echo ' '; ?> <? } ?>
has comment: http://stackoverflow.com/comment/44977704
has comment: http://stackoverflow.com/comment/44963634
type: UnansweredQuestion
downvote count: 2
tagged with: mysql
upvote count: 1
has comment: http://stackoverflow.com/comment/44977507
type: Question
has title: how to open base64 image in light box
score: -1
has answer: http://stackoverflow.com/a/28314576
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44978536
favorite count: 0

http://stackoverflow.com/q/28359521
has comment: http://stackoverflow.com/comment/45062312
has comment: http://stackoverflow.com/comment/45061914
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45062110
tagged with: jsp
has comment: http://stackoverflow.com/comment/45062491
has body: I am submitting the form on click button, but whatever I have changed that data is not sent but the previous data is sent, is there a way in which I can commit the data of the field in forms then send?? $j("body").on('click', "#btn_snd",function(){ Retrieve_Property_name(); $j(this).closest("form").submit(); }); }); The changes are done using ajax function Retrieve_Property_name() { $j(".class_cat").hide(); var property_name = $j("#property_name").val(); $j.ajax({ type : "POST", url : "ShowCat.jsp", data : "property_name=" + property_name , success : function(data) { if(data.trim()=="No") { $j("#Cat_name_hidden").val("General"); alert("Inside No"); } else if(data.trim()=="Yes") { alert("Inside yes"); if($j("#Cat_name").val()==null) { $j("#Cat_name_hidden").val(" NULL"); } else { // alert("Categories:-"+$j("#Cat_name").val()); $j("#Cat_name_hidden").val($j("#Cat_name").val()); // arr1 = $j("#Cat_name").val(); } $j(".class_cat").show(); } alert(); } }); } This is the change function
tagged with: javascript
tagged with: jquery
score: -1
has comment: http://stackoverflow.com/comment/45062249
upvote count: 0
has comment: http://stackoverflow.com/comment/45061947
answer count: 1
has comment: http://stackoverflow.com/comment/45062202
favorite count: 0
has comment: http://stackoverflow.com/comment/45062091
has comment: http://stackoverflow.com/comment/45062055
has comment: http://stackoverflow.com/comment/45062098
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45062538
has comment: http://stackoverflow.com/comment/45061918
has title: Dynamically changed value in jQuery not seen in sent jsp form
has comment: http://stackoverflow.com/comment/45062522
has answer: http://stackoverflow.com/a/28360137
accepted answer: http://stackoverflow.com/a/28360137

http://stackoverflow.com/a/28301518
has comment: http://stackoverflow.com/comment/44980256
has body: First retrive the number from the form (I have modified html a bit) &lt;input type="text" name="id_number" id="IdentityNumber" maxlength="13"&gt; string identityNumber = document.getElementById("IdentityNumber"); then you can reuse the logic as used in the answer below for extracting the fields from it.. (date of birth and gender) South African ID Number Validate and Get Age and Gender Then assign them back to the respective textboxes. (as per the @Elgringorrible answer above.)
type: Answer
answers question: http://stackoverflow.com/q/28300892
score: 0

http://stackoverflow.com/comment/44972868
has text: one second. i'm typing something out
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28310768

http://stackoverflow.com/comment/45118918
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28390683
has text: @Bart okay, that's fine.
score: 0

http://stackoverflow.com/comment/45158538
has text: This solution won't work. The menu doesn't collapse after it's open. See http://jsfiddle.net/ucmxk42k/ and my solution below.
type: Comment
comment on: http://stackoverflow.com/a/28411397
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45147339
has text: Yes, I am sure that would work but some of the functionality I want to implement is inside events in the viewmodel and you define those before it is bound.
score: 0
comment on: http://stackoverflow.com/q/28370386
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45114702
type: AnswerComment
has text: Okay, good eye! That gives me "sub_cat=" with no value attached
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28388526

class
tags question: http://stackoverflow.com/q/28400995
tags question: http://stackoverflow.com/q/28307310
tags question: http://stackoverflow.com/q/28316427
tags question: http://stackoverflow.com/q/28394934
tags question: http://stackoverflow.com/q/28399393
type: Tag
tags question: http://stackoverflow.com/q/28308578
tags question: http://stackoverflow.com/q/28334029
tags question: http://stackoverflow.com/q/28336845
tag name: class
tags question: http://stackoverflow.com/q/28420316
tags question: http://stackoverflow.com/q/28410289

http://stackoverflow.com/q/28397168
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45132821
tagged with: jquery
has comment: http://stackoverflow.com/comment/45130323
type: UnansweredQuestion
tagged with: checkbox
answer count: 0
has body: I have a form with a bunch of checkboxes and a whole bunch of JS fires when you check/uncheck them. The problem is that if you check a few boxes, submit the form and then hit the back button, your browser leaves the checkboxes checked, but none of the other JS fires like it would if you clicked to check the boxes. My half @ssed solution was to have the form on load uncheck all checkboxes. That way the user would have to re-check the boxes and all the JS would fire. unfortunately the code I'm using to uncheck the boxes works in Chrome, but not IE11. In IE11, hitting back results in the checkboxes still being checked. Is there something else I should be doing? $("input:checkbox").prop("checked",false);
has comment: http://stackoverflow.com/comment/45130312
type: Question
has title: prop("checked",false) not working in IE11

http://stackoverflow.com/comment/45078789
has text: Check that `require('react')` is returning what you expect it to. Also I don't see `DefaultRoute = React.createClass` anywhere in your code. I see `DefaultRoute = Router.DefaultRoute`, are those supposed to be the same?
type: QuestionComment
comment on: http://stackoverflow.com/q/28368872
score: 3
type: Comment

http://stackoverflow.com/comment/45161564
has text: Ok tnx, it wors fine :-)
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28413528
type: AnswerComment

http://stackoverflow.com/comment/45236365
score: 1
has text: Thanks for this answer @Sprazer but it hasn't worked for me yet. How are you implementing it? Do you use it with the code above? Do you mix the code or have one before the other? In the latter, which comes first?
comment on: http://stackoverflow.com/a/28435298
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28421740
has answer: http://stackoverflow.com/a/28421850
has answer: http://stackoverflow.com/a/28421780
has answer: http://stackoverflow.com/a/28421836
answer count: 4
possible better answer: http://stackoverflow.com/a/28421788
has body: I don't understand why I can't access through the b or c variables in the global function of the object object, got some trouble with variables inheritance in JS objects. var object = { a: 'a', global: function() { var b = 'b'; this.c = 'c'; }, render: function() { console.log('render()'); return this.a + ' / ' + this.global.b + ' / ' + this.global.c; } }; It renders : a / undefined / undefined I made a fiddle here
has answer: http://stackoverflow.com/a/28421788
has comment: http://stackoverflow.com/comment/45176630
tagged with: javascript-objects
downvote count: 1
tagged with: object
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28421780
score: -1
type: Question
has title: Can't access variable in Javascript object
upvote count: 0
tagged with: javascript
favorite count: 0

http://stackoverflow.com/comment/44944793
comment on: http://stackoverflow.com/a/28294422
score: 0
type: Comment
has text: Thanks I caught a few lessons from your upgraded code. I discovered another problem and I have fixed it though, What do you think about the call stack after I called ch() in the compare function, seems like the call stack was on line one where I called ch() but in ch(), I returned it back to the beginning of compare(). is that possible?
type: AnswerComment

http://stackoverflow.com/comment/45091062
has text: i need to put php array into java array automatically, what do you suggest to do with that?
type: Comment
comment on: http://stackoverflow.com/a/28375230
score: 0
type: AnswerComment

http://stackoverflow.com/q/28352483
tagged with: javascript
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/6505033
type: Question
has comment: http://stackoverflow.com/comment/45048812
duplicate of: http://stackoverflow.com/q/6505033
has body: I realized this while using the Chrome Devtools. 100 + 2 // outputs 102 0100 + 2 // outputs 66 01001 + 6 // outputs 519 060 + 3 // outputs 51 024 + 9 // outputs 29 Anyone can explain what is going on?
answer count: 2
has answer: http://stackoverflow.com/a/28352535
score: 0
has title: What does the leading zero means?
has answer: http://stackoverflow.com/a/28352533
has comment: http://stackoverflow.com/comment/45048897

http://stackoverflow.com/q/28327854
type: Question
has answer: http://stackoverflow.com/a/28327971
upvote count: 0
tagged with: javascript
has body: I have a JSON output from a non-configurable system where various date/time variables have values like \/Date(1422691756316)\/ How can I get that into a readable format (I need to display it via PHP and Javascripts).
has title: Data format - JSON
answer count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: datetime
downvote count: 1
tagged with: http://stackoverflow.com/tag/json
score: -1

http://stackoverflow.com/a/28281302
type: Answer
downvote count: 0
score: 3
has body: The object $('.valign:contains("#1")') is a jQuery instance which is always truthy value. It means that even if '.valign:contains("#1")' selector doesn't yield any result $('.valign:contains("#1")') will still be "true". Proper way to check if selector matches some elements is to use length property of the returned object: if ($('.valign:contains("#1")').length) { // ... }
upvote count: 3
answers question: http://stackoverflow.com/q/28281264

http://stackoverflow.com/q/28362673
type: Question
tagged with: closures
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28362799
type: UnansweredQuestion
tagged with: jsdoc
has body: For example how would I document this? var f = function () { var g = function() {}; g.h = function(); return g; } This isn't a pattern I've invented. See http://bost.ocks.org/mike/chart/
tagged with: properties
has title: How to document properties of a function and functional constructors in jsdoc?
tagged with: methods

http://stackoverflow.com/q/28425675
score: 0
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28426219
has answer: http://stackoverflow.com/a/28425740
accepted answer: http://stackoverflow.com/a/28425740
has title: jquery - change input value when go to next
tagged with: input
type: AnsweredQuestion
has body: When you press tab button while you typing in an input[text] you will go to next input automatically, when you fill up all inputs and after again want to re-fill them, values will highlight with blue color, so i tried to do this without pressing tab button, it's already go to next input but it will not highlight to get new value and you have to drag (select all) the value to replace new one. so i want to when it go to next value WHEN it already filled up it get blue highlight and editable. please see my JSFiddle and fill up all input then re-fill them then you will see you can not change value until you drag the value to change. JSFiddle $(".digits").keyup(function () { if (this.value.length == this.maxLength) { $(this).prev('.digits').focus(); } });
has answer: http://stackoverflow.com/a/28426219
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/44928069
score: 0
type: Comment
has text: What do they want you to do with the file when you access. I am watching it right now. Does not look very confidential
comment on: http://stackoverflow.com/a/28286842
type: AnswerComment

http://stackoverflow.com/comment/44989662
comment on: http://stackoverflow.com/q/28320152
type: QuestionComment
has text: @CMS can you help me out in this question :)
score: 0
type: Comment

http://stackoverflow.com/comment/45161145
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28413877
has text: Thank you! I'm confused, though, because I ran something very similar to this that had no .resolve or .reject -- just several .then -- and it worked. Are there situations in which .resolve is implied or something?
score: 0

http://stackoverflow.com/q/28410514
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/45154765
accepted answer: http://stackoverflow.com/a/28410623
has comment: http://stackoverflow.com/comment/45154662
downvote count: 0
tagged with: mongoose
tagged with: javascript
type: Question
has body: I searched an option inside documentation and on the net but I didn't find any answer, so let's ask the question. Why by running the following code : var accountSchema = mongoose.Schema({ id : { type:Number, unique:true }, login : { type:String, unique:true, index:true }, password : String, usedBySession : String }); var account = mongoose.model('Account', accountSchema); account.findOne({id:1}).exec() .then(function(result){ console.log(result); },function(err){ throw err; }); I get all fields (with _id) instead only my schema fields ? Server response is below. {"__v":0,"_id":"538deecb900f64d43163759a","id":1,"login":"dbyzero","password":"f71dbe52612345678907ab494817525c6"} What is the cleanest way to clean the response if no option exists ?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28410623
score: 1
favorite count: 0
has title: Is it possible to make find() and findOne() method return only schema fields

http://stackoverflow.com/comment/45193948
comment on: http://stackoverflow.com/q/28431860
has text: Could you include the html?
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45158221
comment on: http://stackoverflow.com/q/28412342
score: 0
type: Comment
has text: Sorry, the first line should be: var days= [1, 2, 4];
type: QuestionComment

http://stackoverflow.com/comment/45238676
has text: @demo Yeah, afaik it's just just like that.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28428629
type: Comment

http://stackoverflow.com/comment/45014682
comment on: http://stackoverflow.com/a/28333516
type: AnswerComment
score: 0
type: Comment
has text: Hello Chris, this is a web app for Mobile (both Android and iOS) but there is a small problem...I made a test on my local apache server and it works GREAT but when I put it on my server, the button got pressed but no actions done...Why? :( In my example when iframe's button pressed, it do an ECHO 'OK!'; so in local I see the echo but on my server the button got pressed but I can't see the "OK" echo...Any suggestion?

http://stackoverflow.com/q/28360927
has comment: http://stackoverflow.com/comment/45064650
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45064292
has body: How can I append the Html to corresponding div which has the same data-attribute value? I pass a data-attribute-value to the moda when the button is clicked and it is also added to the submit button in the modal to pass the valu back again. I want to find the element with that data-attribut value and append the html to it. Image (1) Image (1) Images (5) Jquery: $mediaModalBtn.on('click',function(){ var mediaSelect = $(this).data('media-select') , galleryPosition = $(this).data('gallery-position'); $.ajax({ url: 'http://example.com/abc/media', success: function (result) { $( "#mediaModalFiles" ).html( result ); $('#mediaModal').modal('show'); $('#selectMediaBtn').attr('data-gallery-position',galleryPosition); $('#mediaModal').checkboxes('max', mediaSelect); $("#selectMediaBtn").attr('disabled','disabled'); } }); }); $('body').delegate('input[name="media[]"]','change',function () { var media = new Array(); $('input[name="media[]"]:checked').each(function () { media.push(this.value); }); if ( media.length > 0 ) { $("#selectMediaBtn").removeAttr('disabled'); } else { $("#selectMediaBtn").attr('disabled','disabled'); } }); $('body').delegate('#selectMediaBtn', 'click', function () { var galleryPosition = $(this).data('gallery-position') , targetGalleryPosition = $('.popup-gallery[data-gallery-position = "'+galleryPosition+'" ]') , media = new Array(); $('input[name="media[]"]:checked').each(function () { media.push(this.value); }); if ( media.length > 0 ) { $.ajax({ url: 'http://example.com/abc/media/fetch', data: { media : media }, success: function (result) { $('#mediaModal').modal('hide'); $( targetGalleryPosition ).html( result ); } }); } });
downvote count: 1
type: Question
upvote count: 0
has comment: http://stackoverflow.com/comment/45064276
tagged with: javascript
tagged with: jquery
score: -1
has answer: http://stackoverflow.com/a/28361457
has comment: http://stackoverflow.com/comment/45064762
has title: How to append Html to the corresponding div with same class
has comment: http://stackoverflow.com/comment/45064370
answer count: 1
favorite count: 0

http://stackoverflow.com/comment/107386475
type: Comment
has text: @jonruna Here is a take on the "old and incorrect implementation" (hopefully correct, though!): https://stackoverflow.com/a/60693500/352375
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/53707293

http://stackoverflow.com/q/28352013
tagged with: cookies
score: 1
has answer: http://stackoverflow.com/a/28352243
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
has title: Using phantom.cookies with Casperjs
has answer: http://stackoverflow.com/a/28352779
favorite count: 0
tagged with: casperjs
type: UnansweredQuestion
has body: In Phantom using phantom.cookies you can access the cookies set in phantom. How can you achieve the same in casperjs? I tried using this.evaluate(function(){ return document.cookie; }) However, you don't get the expiry date and also you don't get the json output as with phantom.cookies.
upvote count: 1
tagged with: phantomjs

range
tags question: http://stackoverflow.com/q/28338729
tags question: http://stackoverflow.com/q/28373097
type: Tag
tag name: range

http://stackoverflow.com/comment/56744208
type: AnswerComment
type: Comment
has text: Best practice is to turn off debug info in production ($compileprovider.debuginfoenabled(false)), so this method won't work if that is the case
score: 1
comment on: http://stackoverflow.com/a/28417199

http://stackoverflow.com/comment/45042502
comment on: http://stackoverflow.com/q/28349160
score: 0
type: Comment
type: QuestionComment
has text: @KevinB how do I do this then? If push comes I can leave it as is but would like the spinner to show the user something is happening.

http://stackoverflow.com/a/28423813
type: Answer
has body: mechanize cannot handle javascript: How do I use Mechanize to process JavaScript? Instead, you can automate a real browser via selenium. Example: from selenium import webdriver driver = webdriver.Firefox() driver.get('myurl') link = driver.find_element_by_link_text('search') link.click()
answers question: http://stackoverflow.com/q/28423784
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28423784
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/48173129
score: 0
type: Comment
comment on: http://stackoverflow.com/a/30028002
type: AnswerComment
has text: For future reference, this sort of response would be better as a comment to the original question.

http://stackoverflow.com/a/28389938
has comment: http://stackoverflow.com/comment/45117500
downvote count: 0
type: Answer
has body: Use both the inline style attribute style="overflow:hidden;" as well as the attribute scrolling="no". overflow:hidden is the proper HTML5 counterpart, so it's best to mix both. Edit: In fact, if it is suited for your case, try using the iframe seamless boolean attribute. It practically makes the iframe styled as if it's part of the containing document, including no borders or scrollbars. I recommend it because it's like a one-stop for what you need to accomplish, and it does the work for you. You can try a combination of all the three attributes I recommended for ideal browser compatibility.
upvote count: 1
answers question: http://stackoverflow.com/q/28389783
score: 1

http://stackoverflow.com/comment/45102278
comment on: http://stackoverflow.com/a/28381727
type: AnswerComment
score: 0
type: Comment
has text: I like to add class to my tag like , is there any way I can add it?

http://stackoverflow.com/comment/44997890
type: QuestionComment
comment on: http://stackoverflow.com/q/28322807
score: 0
has text: Yeeeaaaah, it's right @hax!!!! Put the link in answer!!!
type: Comment

http://stackoverflow.com/comment/45102131
type: Comment
type: QuestionComment
has text: anyone home? can nobody help me now?
comment on: http://stackoverflow.com/q/28381054
score: 0

http://stackoverflow.com/q/28331652
has body: I'm trying to improve my understanding of callbacks/error handling/async structure of Node.js working on challenges at nodeschool.io. I have one local module file and one actual program file. Here they are: my_module.js module.exports = function(path, extension, callback) { var fs = require('fs'); if (path) { fs.readdir(path, function(err, list) { if (err) return callback(err); var filtered = list.filter(function(item) { //console.log(item.split(".")); if (item.split(".")[1] == extension) return item }) callback(null, filtered); }) } else { callback("===&gt; Please provide a directory path.") } } program.js var my_module = require('./my_module'); var path = process.argv[2]; var extension = process.argv[3]; my_module(path, extension, function(err, data) { if (err) return new Error(err); console.log(data.join("\n")); }) This program works just fine. BUT when it should give an error, it doesn't. Inside my_module.js, if path variable is empty I want to give the error "Please provide a directory path.". The weird thing is, when I write console.log instread of callback, I can show the message. But when I call the callback as callback("===&gt; Please provide a directory path.") nothing happens. No errors, it's silent. Why is this? And how to fix that? Thanks
accepted answer: http://stackoverflow.com/a/28331726
upvote count: 1
tagged with: node.js
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28333848
type: Question
possible better answer: http://stackoverflow.com/a/28333848
has answer: http://stackoverflow.com/a/28331726
tagged with: javascript
answer count: 2
downvote count: 0
tagged with: asynchronous
has title: Callbacks and error handling in an asynchronous function
favorite count: 0

http://stackoverflow.com/q/28339984
favorite count: 0
linked to: http://stackoverflow.com/q/3264370
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
duplicate of: http://stackoverflow.com/q/3264370
answer count: 0
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45025114
has title: How do I make a 'li a'-link clickable?
has body: I have tried to make a webpage recently, just for practice, but I have one simple problem: I can't seem to make the whole 'button' around the 'li a' clickable, how do I do that? This is the CSS I use for my menu: #sideMenu { list-style-type: none; } #sideMenu:hover { background-color: gray; } #sideMenu li { list-style-type: none; float: left; padding: 5px 0 5px 10px; margin: 0 0 0 20px; width: 20%; font-size: 100%; border: 1px solid black; text-align: center; letter-spacing: 5px; border-radius: 5px; color: black; } #sideMenu li a { color: black; text-decoration: none; } #sideMenu li a:hover { text-decoration: overline; } Please ask if anything is unclear!
type: Question
tagged with: styling
tagged with: javascript
has comment: http://stackoverflow.com/comment/45025216
upvote count: 1
tagged with: jquery

http://stackoverflow.com/q/28420724
downvote count: 0
score: 24
type: Question
has title: How to determine the intended frame-rate on an html video element
tagged with: canvas
tagged with: javascript
has comment: http://stackoverflow.com/comment/45177398
has answer: http://stackoverflow.com/a/28455790
accepted answer: http://stackoverflow.com/a/28455790
answer count: 3
has answer: http://stackoverflow.com/a/72396640
linked to: http://stackoverflow.com/q/72997777
tagged with: http://stackoverflow.com/tag/html
upvote count: 24
favorite count: 0
possible better answer: http://stackoverflow.com/a/73098112
has comment: http://stackoverflow.com/comment/45207990
has answer: http://stackoverflow.com/a/73098112
has body: Is there a way to determine the intended frame rate of content playing in the html video element? Does the video element even know the intended FPS or frame count, or does it simply "guess" (maybe 24fps) and play at the guessed speed? Here are my unsuccessful attempts: Look for a FPS or FrameCount property on the video element itself--Nope! Look for cross-video-format header info about FPS or FrameCount--Nothing consistent! Look for an event that is triggered upon frame changing--Nope! My next attempt is more complicated: Sample the video by capturing frames to a canvas element and count frames by determining when the pixels change. Does anyone have a simpler answer before I do the complicated attempt?
type: AnsweredQuestion
tagged with: video

http://stackoverflow.com/comment/45028638
has text: Unfortunately, I don't know that. I just thought it was sa simple js issue that caused the checkbox to be set to a certain value regardless of it was checked or not. I thought it had something to do with the fact that the actual value was in the checkbox tag. But it seems it's more complicated.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28301848

http://stackoverflow.com/comment/44923159
has text: It's NOT a duplicate. I'm not looking for code samples. I'm looking for documentation.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28284093

http://stackoverflow.com/q/28298449
type: UnansweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/44952080
has comment: http://stackoverflow.com/comment/44949100
has body: I have created a simple button that asks for latitude and longitude and if the users inputs lets say 22,15 a marker should show up but for some reason my code isn't working the code is: var map; var marker; var myLatLng = new google.maps.LatLng(); function initialize() { var myLatLng = new google.maps.LatLng(45.4375, 12.3358); myOptions = { zoom: 5, center: myLatLng, mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById('map'), myOptions); function zoomto() { map.set('zoom', parseInt(prompt('zoom value'))); } function setCentre() { map.setOptions({center: new google.maps.LatLng(prompt("Latitude: "),prompt("Longitude: "))}); } google.maps.event.addDomListener(window, 'load', initialize); function Marker1 () { map.setOptions({Marker: new google.maps.LatLng(prompt("Latitude: "),prompt("Longitude: "))}); } function Marker () { map.setOptions({Marker: new google.maps.LatLng(prompt("Latitude: "),prompt("Longitude: "),prompt("Color "),prompt("style "),prompt("number "))}); } var marker = new google.maps.Marker({ position: myLatLng, title: 'Hello World' });​ I have many buttons zoom or move to which both work however I can't get the markers to work. thanks for looking and help.
has comment: http://stackoverflow.com/comment/44948821
tagged with: markers
has title: add a marker according to Google Api v3 book/also with a button
type: Question
tagged with: google-maps
upvote count: 0
has comment: http://stackoverflow.com/comment/44949743
score: -2
has comment: http://stackoverflow.com/comment/44948780
answer count: 1
linked to: http://stackoverflow.com/q/27107440
tagged with: javascript
has comment: http://stackoverflow.com/comment/44948950
tagged with: google-maps-api-3
has answer: http://stackoverflow.com/a/28303428
has comment: http://stackoverflow.com/comment/44948859
favorite count: 0
has comment: http://stackoverflow.com/comment/44950401
has comment: http://stackoverflow.com/comment/44948762

http://stackoverflow.com/comment/45103639
type: AnswerComment
comment on: http://stackoverflow.com/a/28380350
score: 0
type: Comment
has text: Yeah, tried that... problem was I had several buttons and links on the page bound to the body element: this made them all one-fire only. But thanks!

http://stackoverflow.com/comment/44923277
type: Comment
has text: @bhspencer No, that breaks relatively fundamental expectations around how enums should behave. Having an enum be names representing (typically consecutive) integer values is rather widespread.
comment on: http://stackoverflow.com/a/28282066
type: AnswerComment
score: 0

http://stackoverflow.com/a/28359171
answers question: http://stackoverflow.com/q/28358902
type: Answer
score: 2
upvote count: 2
has body: better way to submit form in angular is using "ng-sbmit" you can use something like ng-submit="functionHandlingSubmitTask()" you can look into given link to http://learnwebtutorials.com/angularjs-tutorial-submitting-form-ng-submit
downvote count: 0

http://stackoverflow.com/q/28383589
type: AnsweredQuestion
has title: How can I unregister a Collection in Meteor?
downvote count: 0
has comment: http://stackoverflow.com/comment/45105934
score: 1
has body: I am trying to implement simple functionality to allow a Meteor app to check whether a certain MongoDB string can be successfully used for a connection. In order to do so I have an event trigger a server method that establishes a connection to the MongoDB and returns the number of docs inside the collection. The (simplified) method I am using takes the mongo connection string and a collection name and returns the number of docs inside the collection. var mongoUrl = "mongodb://user:password@192.168.0.98:27017/mydb"; var collectionName = "test"; Meteor.methods({ testDbConnection: function(mongoUrl, collectionName) { var database = new MongoInternals.RemoteCollectionDriver(mongoUrl); TestCollection = new Mongo.Collection(collectionName, { _driver: database }); var numberOfDocs = TestCollection.find().count(); // HELP: how to unregister TestCollection? return numberOfDocs; } }); The first call of the method works, but because I have not unregistered TestCollection all subsequent calls fail, because Meteor already has an insert method for the test collection defined. Exception while invoking method 'testDbConnection' Error: A method named '/test/insert' is already defined at packages/ddp/livedata_server.js:1444:1 at Function._.each._.forEach (packages/underscore/underscore.js:113:1) at [object Object]._.extend.methods (packages/ddp/livedata_server.js:1442:1) at [object Object].Mongo.Collection._defineMutationMethods (packages/mongo/collection.js:886:1) at new Mongo.Collection (packages/mongo/collection.js:208:1) at [object Object].Meteor.methods.testDbConnection (app/app.js:55:24) at maybeAuditArgumentChecks (packages/ddp/livedata_server.js:1599:1) at packages/ddp/livedata_server.js:648:1 at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1) at packages/ddp/livedata_server.js:647:1 How can I unregister a Collection in Meteor in order to perform these ad hoc database connections?
type: Question
tagged with: mongodb
has answer: http://stackoverflow.com/a/28409682
accepted answer: http://stackoverflow.com/a/28409682
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: meteor
has comment: http://stackoverflow.com/comment/45105511
tagged with: collections

http://stackoverflow.com/comment/44962592
comment on: http://stackoverflow.com/a/28305700
type: Comment
has text: Yes, [it does work](http://jsfiddle.net/660m7g7k/5/) with valid JSON, the property names need to be enclosed in quotes.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45161620
comment on: http://stackoverflow.com/q/28413948
type: Comment
type: QuestionComment
score: 1
has text: The searching & sorting should be done in the server-side code, the parameters are all sent in the ajax call querystring (have a look in the Net panel of Firebug or similar)

http://stackoverflow.com/a/45465286
has comment: http://stackoverflow.com/comment/116973101
has comment: http://stackoverflow.com/comment/116894058
has comment: http://stackoverflow.com/comment/116899234
upvote count: 5
has comment: http://stackoverflow.com/comment/116972217
has comment: http://stackoverflow.com/comment/116892214
score: 5
downvote count: 0
has comment: http://stackoverflow.com/comment/116899750
type: Answer
has body: Based on the previous answers, I monkeypatched getBBox on my app init so it will transparently apply the hack. Now I can call getBBox directly on any element, whether it's attached or not. _getBBox = SVGGraphicsElement.prototype.getBBox; SVGGraphicsElement.prototype.getBBox = function() { var bbox, tempDiv, tempSvg; if (document.contains(this)) { return _getBBox.apply(this); } else { tempDiv = document.createElement("div"); tempDiv.setAttribute("style", "position:absolute; visibility:hidden; width:0; height:0"); if (this.tagName === "svg") { tempSvg = this.cloneNode(true); } else { tempSvg = document.createElementNS("http://www.w3.org/2000/svg", "svg"); tempSvg.appendChild(this.cloneNode(true)); } tempDiv.appendChild(tempSvg); document.body.appendChild(tempDiv); bbox = _getBBox.apply(tempSvg); document.body.removeChild(tempDiv); return bbox; } };
answers question: http://stackoverflow.com/q/28282295

primefaces
tags question: http://stackoverflow.com/q/28344182
tags question: http://stackoverflow.com/q/28358475
tag name: primefaces
type: Tag
tags question: http://stackoverflow.com/q/28343486

http://stackoverflow.com/comment/44957493
score: 2
has text: add a `fail` handler and see if it is triggered.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28303126

http://stackoverflow.com/comment/45000959
type: QuestionComment
score: 1
has text: wow, a question which is legitimately about `[java]` and `[javascript]` ;)
comment on: http://stackoverflow.com/q/28326682
type: Comment

http://stackoverflow.com/q/28328310
type: AnsweredQuestion
has body: I am searching Elasticsearch through javascript, mainly just doing a very simple trending analysis. What I want to see is which country across the world has the most hamburgers sold. The problem is instead of seeing United States, United Kingdom returned, I get "united" as a result since that term is obviously occuring with both of those results. How do i query to return the full country name? Not just states, or united? My data doing a plain search in ES looks like: "country": "United States", "place_name": "United States", "hSold": "27", My query in JS: esClient.search({ index: 'burgers', size: 20, body: { // Begin query. query: { "match_all" : {} }, // Aggregate on the results facets: { tagcloud: { terms: { field: 'country', 'size': 20 } } } // End query. } The results i see back: United: 1047 States: 987 south: 870 kingdom: 600 I should have results like United States, not united. Any help greatly appreciated. Thanks
tagged with: angularjs
has answer: http://stackoverflow.com/a/28328604
type: Question
tagged with: elasticsearch
tagged with: bower
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/28328604
has title: ElasticSearch Query with only partial term returned
tagged with: javascript

http://stackoverflow.com/comment/45183318
score: 0
comment on: http://stackoverflow.com/q/28425409
type: Comment
type: QuestionComment
has text: I cannot figure out why I'm getting those results. I think you're right, i'll ask my question in codereview!

http://stackoverflow.com/comment/45168459
score: 0
comment on: http://stackoverflow.com/q/28373361
type: Comment
type: QuestionComment
has text: Would it be possible to create a jfiddle with the client HTML code only?

http://stackoverflow.com/q/28405677
linked to: http://stackoverflow.com/q/263392
type: Question
has comment: http://stackoverflow.com/comment/61794326
tagged with: php
has answer: http://stackoverflow.com/a/28405864
has body: here i try to fetch json data from following url https://www.flickr.com/services/api/render?method=flickr.places.find&amp;api_key=xxxxx&amp;query=$search_data&amp;format=json&amp;nojsoncallback=1 contain following information which i want to get according above link { "places": { "place": [ { "place_id": "Dm5SiT1TULMEIMYN", "woeid": "2295402", "latitude": 23.03, "longitude": 72.591, "place_url": "/India/Gujarat/Ahmedabad", "place_type": "locality", "place_type_id": 7, "timezone": "Asia/Kolkata", "_content": "Ahmedabad, Gujarat, India", "woe_name": "Ahmedabad" }, { "place_id": "mz1zSK1YUrJTfvUrOA", "woeid": "90883450", "latitude": 23.027, "longitude": 72.57, "place_url": "/India/Gujarat", "place_type": "locality", "place_type_id": 7, "timezone": "Asia/Kolkata", "_content": "Ahmedabad, India", "woe_name": "Ahmedabad" } ], "query": "Ahmedabad, Gujarat, India", "total": 2 }, "stat": "ok" } but here problem is that this link return null i'm using following code of php $json_array = file_get_contents("https://www.flickr.com/services/api/render?method=flickr.places.find&amp;api_key=xxxxx&amp;query=Ahmedabad,%20Gujarat,%20India&amp;format=json&amp;nojsoncallback=1"); $json_array = iconv('UTF-16', 'UTF-8', $json_array); $json_data=json_decode($json_array,true); print_r($json_data);
upvote count: 3
has comment: http://stackoverflow.com/comment/45145811
tagged with: http://stackoverflow.com/tag/json
answer count: 3
has title: get json data from URL using php
has answer: http://stackoverflow.com/a/28406395
tagged with: arrays
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
has comment: http://stackoverflow.com/comment/45145857
score: 3
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/45145875
has answer: http://stackoverflow.com/a/28405812

http://stackoverflow.com/comment/45011653
score: 1
comment on: http://stackoverflow.com/a/28332223
has text: Alas, I need the global flag so I guess I'll reset `RegExp.lastIndex`
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45060801
score: 1
type: AnswerComment
has text: Thank You So Much Ethan...like that but i will have to pass file and image address dynamically...i am going to upvote this usefull answer..cheers
comment on: http://stackoverflow.com/a/28348358
type: Comment

http://stackoverflow.com/a/28345888
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28344695
type: Answer
has comment: http://stackoverflow.com/comment/45036081
answers question: http://stackoverflow.com/q/28344695
score: 2
has body: Alright, this should do what you are asking for. I don't think it is very user friendly, but that is up to you. Demo Fiddle //this prevents the animate method from running multiple times. var scrolling = false; jQuery(document).ready(function () { $(window).scroll(function () { if ( $(window).scrollTop() &lt;= 100 &amp;&amp; scrolling === false) { //set to true to prevent multiple scrolls scrolling = true; //run the animation $('html, body').animate({ scrollTop: $('#content').offset().top }, 1000, function() { //when animation is complete, set scrolling to false scrolling = false; }); } }); });
downvote count: 0
upvote count: 2

http://stackoverflow.com/a/28409723
score: 0
type: Answer
has body: Pointer-events does not work in IE9. Check this http://caniuse.com/#search=pointer-events. Try checking for the class at the JavaScript end and then disable the functionality. I use caniuse.com to check Browser compatibility all the times.
answers question: http://stackoverflow.com/q/28409569

http://stackoverflow.com/comment/45097661
has text: Have you seen the ajax request in your network tab (of the developer console)? If not, there must be something else in the code preventing `document.ready`. Maybe just try putting the ajax request in the head of the page.
type: Comment
comment on: http://stackoverflow.com/q/28378705
score: 0
type: QuestionComment

http://stackoverflow.com/q/28308578
tagged with: static-members
favorite count: 0
tagged with: class
accepted answer: http://stackoverflow.com/a/28309199
tagged with: member
has comment: http://stackoverflow.com/comment/45006036
answer count: 4
has answer: http://stackoverflow.com/a/33660403
has title: Member variables in ES6 classes
has body: Is there any way to use the ECMAScript6 class notation to declare either a static class variable or a default value for an instance variable? Without class what I have in mind would be written as function MyClass(arg) { if(arg) this.arg = arg; } MyClass.classVariable = 42; MyClass.prototype.arg = "no arg specified"; The most obvious ES6-like notation in my opinion would have been class MyClass { constructor(arg) { if(arg) this.arg = arg; } static let classVariable = 42; let arg = "no arg specified"; } But this doesn't work, since according to the current spec draft the only productions of ClassElement are static and instance methods and semicolons all by themselves. OK, one can use a pair of getter and setter methods to achieve similar semantics to what I outlined, but I guess at a severe performance penalty and with really bizarre syntax. Is there some draft which suggests including variables in the class notation, one way or another? If so, what was the suggested syntax, where was it published, where was it discussed, how did the discussion go, and what's the current state of affairs on that front? As it stands, this question can't be answered if no such thing has been discussed before, at any level, but I consider that unlikely. A bit of background: I'm currently toying with the Google closure compiler performing advanced compilation, using ES6 as input. For that to work, I need a place to put my type annotations for member variables, and I used to place them using syntax like /** @type {string} */ MyClass.prototype.arg; which is a semantic no-op in ECMAScript but provides the type information to the closure compiler nice and easy. I haven't yet found a similarly nice way to do this with a class construct. But if you care to address this aspect, that would be a comment. The question above is about member declarations which are more than no-ops, so that's what an answer here should discuss.
possible better answer: http://stackoverflow.com/a/33660403
has answer: http://stackoverflow.com/a/35191057
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/20279484
score: 35
has answer: http://stackoverflow.com/a/28309199
type: Question
tagged with: ecmascript-6
has comment: http://stackoverflow.com/comment/45023418
upvote count: 35
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/78536332

http://stackoverflow.com/comment/45157922
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28409258
has text: sorry for that. I have added once again

http://stackoverflow.com/q/28378705
score: 9
type: Question
has comment: http://stackoverflow.com/comment/45097496
has title: Run ajax request on document.ready jquery
has comment: http://stackoverflow.com/comment/45098781
has comment: http://stackoverflow.com/comment/45097290
tagged with: javascript
has comment: http://stackoverflow.com/comment/45098012
has comment: http://stackoverflow.com/comment/45097263
has comment: http://stackoverflow.com/comment/45098112
has comment: http://stackoverflow.com/comment/45098767
answer count: 1
has comment: http://stackoverflow.com/comment/45097919
has comment: http://stackoverflow.com/comment/45097896
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28379252
tagged with: ajax
upvote count: 9
accepted answer: http://stackoverflow.com/a/28379252
has comment: http://stackoverflow.com/comment/45097909
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45097698
tagged with: php
has comment: http://stackoverflow.com/comment/45097661
has comment: http://stackoverflow.com/comment/45097857
type: AnsweredQuestion
downvote count: 0
has body: Ajax $(document).ready(function() { $.ajax({ type: 'POST', url: '../include/ListOfCities.php', dataType: "json", data: { Country: "Japan" }, success: function(data) { console.log(data); var city = ('#city'); $(city).empty(); for (var i = 0; i &lt; data.length; i++) { $(city).append('&lt;option id=' + data[i].sysid + ' value=' + data[i].city_name + '&gt;' + data[i].city_name + '&lt;/option&gt;'); } } }); }); php $country = mysql_real_escape_string($_POST['Country']); $stmt = $dbh-&gt;prepare("SELECT * FROM city_tbl WHERE country_name = ? "); $stmt-&gt;bindValue(1, $country, PDO::PARAM_STR); if ($stmt-&gt;execute()) { if ($stmt-&gt;rowCount() &gt; 0) { while ($selected_row = $stmt-&gt;fetch(PDO::FETCH_ASSOC)) { $citylist[] = array('sysid' =&gt; $selected_row['sys_id'], 'code' =&gt; $selected_row['city_code'], 'name' =&gt; $selected_row['city_name'], 'parentid' =&gt; $selected_row['parent_id']); } $input = array_map("unserialize", array_unique(array_map("serialize", $citylist))); echo json_encode($input, JSON_UNESCAPED_UNICODE); } } I want to display the all the city in japan in a select option menu i want to load the cities when the page loads i am sending the ajax request like above but i don't get any result the ajax above works fine when i use it on button. Is sending ajax request different from on button click and on document ready..Any suggestion how to make ajax request on document ready is appreciated
has comment: http://stackoverflow.com/comment/45097558

http://stackoverflow.com/q/28399838
answer count: 1
has answer: http://stackoverflow.com/a/28400032
favorite count: 0
has body: The code: function terminator(sig) { if (typeof sig === "string") { console.log('Received %s - terminating Node server ...', sig); process.exit(1); }; console.log('Node server stopped.'); }; process.on('exit', function() { terminator(); }); function terminatorSetup(element, index, array) { process.on(element, function() { terminator(element); }); }; ['SIGHUP', 'SIGINT', 'SIGQUIT', 'SIGILL', 'SIGTRAP', 'SIGABRT', 'SIGBUS', 'SIGFPE', 'SIGUSR1', 'SIGSEGV', 'SIGUSR2', 'SIGPIPE', 'SIGTERM'].forEach(terminatorSetup); Somehow this does not work on Windows, exiting with Ctrl+C doesn't print anything on the console, but when I insert a console.log(element); before process.on(element, ...); it works just fine. Am I missing anything? Nothing I use there should be async afaik.
type: UnansweredQuestion
tagged with: destructor
tagged with: node.js
score: 2
downvote count: 0
has title: NodeJS destructor
type: Question
tagged with: javascript
upvote count: 2

http://stackoverflow.com/q/28323692
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/44997066
has answer: http://stackoverflow.com/a/28341886
has comment: http://stackoverflow.com/comment/44995180
tagged with: safari
tagged with: http://stackoverflow.com/tag/svg
upvote count: 1
type: Question
tagged with: object
tagged with: javascript
has comment: http://stackoverflow.com/comment/44997355
has body: I have the following code to display a series of portfolio images stored as SVG's in a scrolling div: Scrolling in Safari, using two fingers or the mouse-wheel, does not work when the cursor is over one of the SVG's. The page behaves as expected (scrolling works everywhere) in Chrome and Firefox. Is there a Safari-specific CSS tag that enables scroll events to pass through the SVG's? The SVG's are drawn in object tags because they include some bitmapped elements that won't be displayed if they are called in img tags in webkit-based browsers. [temporary] the page I am working on is here.
answer count: 2
has answer: http://stackoverflow.com/a/28324952
has comment: http://stackoverflow.com/comment/44995255
downvote count: 0
score: 1
favorite count: 0
has title: How to enable Safari scrolling over SVG's (object tags in scrolling div)?

http://stackoverflow.com/a/28300102
answers question: http://stackoverflow.com/q/28300043
has body: You told Python to expect 0 or more arguments: def on_message(*answer): print(answer) Python then gives you a tuple of all arguments passed in; your print statements show you got one argument, so you got a tuple with just one element in it. That one element is a JSON string that you'd decode with json.loads(). Take the first element and decode that: def on_message(*answer): print(json.loads(answer[0])) or don't use * and require that one argument is passed in, always and load from that one argument def on_message(answer): print(json.loads(answer))
upvote count: 2
score: 2
accepted answer of: http://stackoverflow.com/q/28300043
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/45200808
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28296855
has text: Sorry I've only just come across this comment, it doesnt really matter where you put the function, the point is that the store data is invalid until it has the parameters from the user. it doesnt really need to be a function, you only need a store, you can filter it later
type: AnswerComment

http://stackoverflow.com/a/28310792
has body: How about using data attributes?: &lt;%= link_to like_listing_path(@listing), method: :put, :remote =&gt; true, :class =&gt; "like-btn", :"data-id" =&gt; user.id do %&gt; &lt;i class="fa fa-heart-o"&gt;&lt;/i&gt; &lt;% end %&gt; Then on your like action def like @listing = Listing.find params[:"data-id"] @listing.like! end
type: Answer
answers question: http://stackoverflow.com/q/28310537
score: 0

http://stackoverflow.com/comment/45034614
comment on: http://stackoverflow.com/q/28345029
type: Comment
type: QuestionComment
score: 0
has text: You've told us a bunch of things that you've tried, but you haven't told us what the result was or how it differed from what you expected.

http://stackoverflow.com/q/28290067
type: Question
score: 1
tagged with: forms
has body: Here is my form &lt;form method="POST" action="adddriverprocess.php" enctype="multipart/form-data"&gt; &lt;...&gt; &lt;...&gt; &lt;/form&gt; It works good in the submit &lt;input type="submit" value="Submit"/&gt; I am trying to have the jquery popup in it, where by pressing the form should do the post action. So, i had this jquery button &lt;a href="javascript:;" id="&lt;?php echo url();?&gt;/adddriverprocess.php" class="btnActivation"&gt;&lt;button class="delete-btn btn-sm"&gt;&lt;span class="icon"&gt;&lt;/span&gt;&lt;/button&gt;&lt;/a&gt;&lt;/td&gt; With $('.btnActivation').click(fnActivation); function fnActivation() { var url =$(this).attr("id"); $("#dialog-confirms").html("Are you sure you want to submit this form ?"); var buttonsConfig = [ { text: "Yes", "class": "ok", click: function() { $(this).dialog('close'); window.location.href=url; } }, { text: "Cancel", "class": "cancel", click: function() { $(this).dialog('close'); } } ]; $("#dialog-confirms").dialog({ resizable: false, modal: true, title: "Ma$na Taxi", height: 250, width: 400, buttons: buttonsConfig, }); } The popup comes good, but when i press the ok button it takes me to the adddriverprocess but in get method but i want it to do in post method with the datas that is filled in the name. How can i do this ?
has answer: http://stackoverflow.com/a/28290285
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44934065
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28290285
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44933955
has title: jquery popup submit the form in post method
upvote count: 1
tagged with: php

http://stackoverflow.com/a/28407043
upvote count: 1
has comment: http://stackoverflow.com/comment/45148178
has comment: http://stackoverflow.com/comment/45148239
downvote count: 0
has body: With JavaScript it is not a static language like Java. It is dynamic. That means you can create the array without a need to preset the size of the array, but if you want you can procreate an array of the size you want. var items = [[1,2],[3,4],[5,6]]; alert(items[0][0]); // 1 If you need to add to it just do items.push([7,8]); That will add the next element. Code taken from old stack overflow post: How can I create a two dimensional array in JavaScript? Edited to properly make I in items same as variable declaration.
type: Answer
has comment: http://stackoverflow.com/comment/45148842
answers question: http://stackoverflow.com/q/28406967
score: 1

http://stackoverflow.com/comment/44977292
type: Comment
comment on: http://stackoverflow.com/q/28313524
type: QuestionComment
has text: it works fine in jsfiddle, but when i run the html file in browser it doesn't display the graph
score: 0

http://stackoverflow.com/a/28304045
accepted answer of: http://stackoverflow.com/q/28303855
has body: it doesn't work because your index random is saved into numberTwo object and not in rando variable. You need to refer to index saved into numberTwo object, like this: numberTwo[numberTwo.rando]; so, your code must be like this: var numberTwo = {}; numberTwo.rando = Math.random(); // numberTwo.rando contains some random number numberTwo[numberTwo.rando] = "another random number"; //now it is correct
answers question: http://stackoverflow.com/q/28303855
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/28388524
has comment: http://stackoverflow.com/comment/45114866
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45115091
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/45114719
has comment: http://stackoverflow.com/comment/45115218
tagged with: css
has comment: http://stackoverflow.com/comment/45114860
has answer: http://stackoverflow.com/a/28388677
possible better answer: http://stackoverflow.com/a/28388751
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28388751
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/28388839
accepted answer: http://stackoverflow.com/a/28388839
type: Question
has title: Bootstrap Modal not popping up
tagged with: javascript
answer count: 3
has body: I'm really new to bootstrap and I am trying to add a popup using Modals. I added the code and the scripts, but when you click on the button its not popping up. I can tell something is coming up because the background fades a little but a popup is not coming up. So I need a little bit of help figuring out why its not popping up. My JavaScript links: Code for Modals: × Modal header One fine body… Close Save changes Launch Modal
upvote count: 1

http://stackoverflow.com/a/28393051
has body: Assuming you may change your HTML too, there are much better ways to sync up the pairs of buttons. Decorating them with data- attributes is probably the easiest way to make the code data driven. Your JSFiddle has some odd code. document ready events only apply to the initial page load, whereas you seem to be using it to simulate a load using a loop (which will not work as it will complete on the same browser frame). Also document load does not return a promise so .then will just cause an error. I replaced the load simulation with a loadData function that does return a promise and completes after 3 seconds. I have reworked your code so that the various buttons have a data-target referring to their matching button (in the drop down, or the main buttons). e.g. No When a button is clicked, it creates a jQuery object referring to both the button clicked and the matching pair: // Add any matching button $el = $el.add($el.data('target')); It then does any button login ("loading..." etc) on both buttons. $el.button('loading'); loadData().then(function (result) { $el.toggleClass("css_unpublished css_published"); $el.button('reset'); }).fail(function (err, data) { $el.button('reset'); }); JSFiddle: http://jsfiddle.net/TrueBlueAussie/deC37/312/
accepted answer of: http://stackoverflow.com/q/28326853
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28326853

http://stackoverflow.com/comment/45199729
comment on: http://stackoverflow.com/q/28434790
type: Comment
has text: Express.io is very outdated. Your socket.io client version is `1.3.3`, whereas express.io still runs on `0.9.16`, which aren't backwards-compatible.
score: 0
type: QuestionComment

http://stackoverflow.com/a/28350162
has body: You are using a circular dependency - AppView requires LoginView, LoginView requires AppView. This is causing AppView to be null when referenced inside LoginView. There is a better explanation for this here : http://requirejs.org/docs/api.html#circular You should probably refactor your design to not have this circular reference. If you find it necessary, you can use "require" again in the second module (LoginView) and pull in AppView (as shown in that link). But I strongly advise you rethink the design instead.
score: 5
upvote count: 5
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28347334
answers question: http://stackoverflow.com/q/28347334
type: Answer

http://stackoverflow.com/comment/45118800
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28387058
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/70501/discussion-between-sajeetharan-and-wayne-ellery).

http://stackoverflow.com/comment/44999514
type: AnswerComment
type: Comment
has text: All of the properties of the object (id, parent, sport, etc...) are available at the same level - replace 'name' by whatever you need to use.
comment on: http://stackoverflow.com/a/28325834
score: 0

http://stackoverflow.com/a/28292814
upvote count: 1
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28292609
has comment: http://stackoverflow.com/comment/44938660
has comment: http://stackoverflow.com/comment/44938582
type: Answer
has comment: http://stackoverflow.com/comment/44938684
has body: This will help.. /^[ ]*([a-zA-Z]{2}\d{6}[a-zA-Z])[ ]*$/ [a-zA-Z]{2} matches two alphabetic character \d{6} matches subsequent 6 digits [a-zA-Z] matches one alphabetic character

http://stackoverflow.com/a/28411104
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28406168
has body: just use following code in onclick() action... :- For a New Window :- window.open("http://www.google.com/", "_blank"); For a System Window :- window.open("http://www.google.com/", "_system");
type: Answer
downvote count: 0

http://stackoverflow.com/comment/45140555
comment on: http://stackoverflow.com/a/28402617
type: Comment
has text: Since the `value` attribute isn't there, thre's no problem. The script does not reffer to the `option` but `select` element. Every browser will return what is between open-close option tags. It's the same as with `input`.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45169376
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28374218
has text: If all combo boxes should be in synch, you would use the setItems() command for each of the boxes, and instead of defining the variable f for those (subsequent) fields, access them directly with this.getField("place1").setItems(fitms) ; and so on.

http://stackoverflow.com/comment/45093243
type: Comment
has text: Can you please post the code that is using the functions that you posted above.
comment on: http://stackoverflow.com/q/28375505
score: 0
type: QuestionComment

http://stackoverflow.com/q/28414318
has comment: http://stackoverflow.com/comment/45162702
possible better answer: http://stackoverflow.com/a/28414362
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28414369
score: 0
has comment: http://stackoverflow.com/comment/45162132
has answer: http://stackoverflow.com/a/28414365
has comment: http://stackoverflow.com/comment/45163086
has comment: http://stackoverflow.com/comment/45189146
has comment: http://stackoverflow.com/comment/45186562
tagged with: jquery
has title: What is the difference of returning a promise() or a deferred in jQuery?
favorite count: 0
has comment: http://stackoverflow.com/comment/45162380
tagged with: ajax
tagged with: promise
has comment: http://stackoverflow.com/comment/45161967
has answer: http://stackoverflow.com/a/28414387
has body: Let's say I have an ajax method which doesn't has a promise to return, so I'd do something like this: promises.setPreferredService = function(id) { var deferred = $.Deferred(); nsAddressAjaxService.setPreferredAddress(id, { callback: function(data) { deferred.resolve(data); } }); return deferred.promise(); // I could also return only `deferred` }; In my method's return, I can return deferred.promise() or just return the deferred and both of them I can do this: promises.setPreferrredService.done(callback); So what's the difference of returning deferred.promise() or only return deferred ?
answer count: 4
has comment: http://stackoverflow.com/comment/45163035
upvote count: 2
has comment: http://stackoverflow.com/comment/45162469
downvote count: 2
has answer: http://stackoverflow.com/a/28414362
type: Question
has answer: http://stackoverflow.com/a/28414369
type: AnsweredQuestion

http://stackoverflow.com/comment/45115770
comment on: http://stackoverflow.com/a/28389005
type: AnswerComment
score: 0
type: Comment
has text: This is definitely the best answer, but change (direction == 'prev') to === and if you are using strings like the OP posted this will not work for those string values.

http://stackoverflow.com/q/28304220
score: 0
has comment: http://stackoverflow.com/comment/44959872
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I am using a jQuery plugin it has plugin.css and plugin.js as dependencies and code is in script.js. I cant have plugin.js and script.js merged because i am using plugin only on one webpage of my website. In order to make sure plugin.css is loaded before execution of plugin.js and script.js, normally I have no option but to have plugin.css in which causes render blocking(until all resources in head are loaded, browser doesnt render html). Normal Way: Having CSS in and JS before // content goes here Proposed Way: Load CSS and JS via ajax calls and inject them when all of them are loaded, using jQuery $.when promise // content goes here This improved my first render time from 3.4 secs to 2.4 secs and total page load time from 8.5secs to 8secs. But this has some limitations: Publicly hosted urls cant be used because the urls inside the plugin files like background-images inside css files if mentioned relative to their directory then the path changes after code is pasted into html. As the injected code is not part of the source files or external scripts they cant be debugged in developer tools. This way of lazyloading plugins has pros and equal amount of cons. Can anyone suggest is it worth it to do it this way or any better way to do things.
has comment: http://stackoverflow.com/comment/44959832
has comment: http://stackoverflow.com/comment/44959714
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28306586
tagged with: css
type: Question
tagged with: javascript
tagged with: jquery
has title: Avoid Render Blocking by plugins which have both css and js dependencies

http://stackoverflow.com/comment/45013406
score: 0
has text: Well, to use `line.defined()` you have to have some data in the array (e.g. value=null for some time_stamp) ... that is not this case. By pre-processing I mean necessity of data insertion into the original array.
comment on: http://stackoverflow.com/q/28331804
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28331269
has body: I can't help you much with angular.js, I've never used it, but the fact that you are accidentally replacing the array with the function probably doesn't help. ng-repeat is trying to loop through favoriteLeagues but fails because that's a function! Look at the comments I put in your code. $scope.favoriteLeague = []; // creates an array $scope.favoriteLeague = function(league) { // replaces the array with a function!!! $scope.favoriteLeagues.push(league); // suddenly leagues takes an S ? } To avoid this type of error, you should respect a naming convention for your functions. I like to use action words and verbs for functions. I only use plural forms on arrays and related functions. Here's what I'd do in your case: $scope.favoriteLeagues = []; $scope.addToFavoriteLeagues = function(league) { $scope.favoriteLeagues.push(league); }
score: 2
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/28330237
type: Answer

http://stackoverflow.com/comment/45232875
type: AnswerComment
score: 0
type: Comment
has text: I'm not sure how to extend loading times. I advise you look at the documentation: http://github.hubspot.com/pace/
comment on: http://stackoverflow.com/a/28385365

http://stackoverflow.com/comment/45121323
type: Comment
type: AnswerComment
has text: @lujcon What did you do there with passing the callback into the function? I need any solution to get the result of body back into my exports.startApiCall function so I can use it. All solutions that will do that are welcome and greatly appreciated!
comment on: http://stackoverflow.com/a/28391946
score: 0

http://stackoverflow.com/comment/44959234
score: 0
comment on: http://stackoverflow.com/q/28301486
type: QuestionComment
has text: The other solution is to use `FileReader` which is even less-well supported.
type: Comment

http://stackoverflow.com/a/28289195
accepted answer of: http://stackoverflow.com/q/28287870
has comment: http://stackoverflow.com/comment/44932269
answers question: http://stackoverflow.com/q/28287870
type: Answer
has body: This should be fairly trivial since your filter is properly using the right structure that it meant to filter. The bug is that your search filter should contain strings for myFilter.terms (notice the quotes): Advertising Branding Packaging Print Then the filtering is: {{select}}
score: 2
downvote count: 0
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/comment/45058482
type: AnswerComment
comment on: http://stackoverflow.com/a/28347037
score: 0
type: Comment
has text: Hi rba ,I had tried your code , its seem like not working ... can you help me to review ,am I wrote wrong ? thanks http://jsfiddle.net/Garfrey/vvhvhy36/5/

http://stackoverflow.com/a/28461514
type: Answer
upvote count: 3
score: 3
has body: Unfortunately, there do not appear to be any hooks for this functionality in Markdown.Editor.js. I was however able to find the section of code responsible for this, and create a patch for your desired functionality. Open Markdown.Editor.js in your editor of choice. Find this section of code: var linkDef = " [999]: " + properlyEncoded(link); var num = that.addLinkDef(chunk, linkDef); chunk.startTag = isImage ? "![" : "["; chunk.endTag = "][" + num + "]"; Replace with this code: chunk.startTag = isImage ? "![" : "["; chunk.endTag = "](" + properlyEncoded(link) + ")"; Profit!
has comment: http://stackoverflow.com/comment/45261596
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28414987
answers question: http://stackoverflow.com/q/28414987

http://stackoverflow.com/q/28352232
has answer: http://stackoverflow.com/a/28352356
has comment: http://stackoverflow.com/comment/45048324
tagged with: flexbox
has comment: http://stackoverflow.com/comment/45048357
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
has title: When is it better to have more or less html elements?
has answer: http://stackoverflow.com/a/28352374
upvote count: 1
has body: The title question sums my thoughts up quite well, but let me explain how i got to this question. I am working on a navigation bar for a content-heavy social networking site. I'm using flexbox to align the navigation items. First, i wrapped a div tag around all those items, but then I asked myself, why add more code here if i can do it without. Or more generally, is the overall performance getting worse if i have a lot of html elements, especially regarding javascript/jquery. I guess so.. But maybe sometimes, is it wiser to add more elements to have a clearer structure or even mandatory by w3c rules? The navigation bar HTML code looks like this using the minimum number of elements (i removed most of the ids classes and css here to keep it clear): CSS: .flexItem{ display: block; } .flexBox{ display:flex; flex-direction:row; } Is it legal to do it like this? Is it wise to do it like this? Is the performance better compared to wrapping divs around it (assuming theres a lot of js going on all over the page). I didn't find anything about the relation between number of html elements and performance on google. Hope someone here can help me out.
type: AnsweredQuestion
tagged with: performance
score: 1
has comment: http://stackoverflow.com/comment/45048553
accepted answer: http://stackoverflow.com/a/28352374
has comment: http://stackoverflow.com/comment/45048390
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45048346
possible better answer: http://stackoverflow.com/a/28352356
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/28389847
score: 0
has body: Try var items = [] , res = null , dfd = new $.Deferred() , processItems = function (item) { var index = $.inArray(item, items); console.log("random number: " + index); $("&lt;div /&gt;", { "class": "TitleText", "html": $(item).children().find("author_name")[0].innerHTML, "data-index": index }) .add("&lt;br /&gt;") .add( $("&lt;div /&gt;", { "class": "Image", "data-index": index, "html": $("&lt;img /&gt;", { "class": "Image", "data-index": index, "src": $(item).children() .filter("media\\:content") .children("media\\:thumbnail") .attr("url") + "?" + $.now(), "width": "145" }) }) ) .appendTo(".items") } , loadXML = function() { return $.post("/echo/xml/", {xml:xml}, "xml") .then(function(xml) { $(xml.documentElement) .find("item") .each(function(i, el) { items.push(el) }); return items }) }; loadXML() .then(function(data) { $.each(data, function(i, item) { setTimeout(function() { // select different randomly selected items, // without repetition processItems(item); ++res; if (res === data.length) { dfd.resolve(res + " items processed"); } }, 1 + Math.floor(Math.random() * 25)); }); return $.when(dfd, data) }, function(jqxhr, textStatus, errorThrown) { console.log(textStatus, errorThrown) }) .then(function(msg, data) { console.log(msg, data) }); jsfiddle http://jsfiddle.net/guest271314/o5tfs48r/
answers question: http://stackoverflow.com/q/28384459
type: Answer

http://stackoverflow.com/q/28385418
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: c#
tagged with: asp.net-mvc
tagged with: javascript
has title: Return the proper json
has answer: http://stackoverflow.com/a/28385498
accepted answer: http://stackoverflow.com/a/28385498
score: 0
answer count: 1
has body: I have the following code: [HttpGet] public JsonResult ReturnJson() { List&lt;Tuple&lt;string, int&gt;&gt; list = new List&lt;Tuple&lt;string,int&gt;&gt;(); list.Add(new Tuple&lt;string, int&gt;("Feb 2 to Feb 6", 1)); list.Add(new Tuple&lt;string, int&gt;("Feb 7 to Feb 15", 10)); list.Add(new Tuple&lt;string, int&gt;("Feb 16 to Feb 24", 4)); return Json(list, JsonRequestBehavior.AllowGet); } it returns the following string: [{"Item1":"Feb 2 to Feb 6","Item2":1},{"Item1":"Feb 7 to Feb 15","Item2":10},{"Item1":"Feb 16 to Feb 24","Item2":4}] on my View I should get this in format (javascript) var data = [["Jan 26 to Jun 30", 8], ["Feb 2 to Feb 6", 15], ["Feb 9 to Feb 13", 16], ["Feb 16 to Feb 20", 7], ["Feb 23 to Feb 27", 16], ["Mar 2 to Mar 6", 8], ["Mar 9 to Mar 13", 4], ["Mar 16 to Mar 20", 15]]; How to convert first string to second on server or client side? Thanks
tagged with: razor
has comment: http://stackoverflow.com/comment/45108510
type: AnsweredQuestion

http://stackoverflow.com/q/28299896
favorite count: 0
score: 0
tagged with: mvvm
downvote count: 1
has answer: http://stackoverflow.com/a/28314028
has body: I have a loading bar which shows the progress of the project that how much the project has been completed, the width of the bar is statically done with css styling and width property, here is the code: &lt;div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 10%;"&gt; I want to change the width, dynamically with data-bind attribute, How can I do this?
accepted answer: http://stackoverflow.com/a/28300078
tagged with: durandal
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28300078
tagged with: knockout.js
has title: How to change the value of a rule in css by data binding value in KNOCKOUT?
possible better answer: http://stackoverflow.com/a/28314028
type: Question
answer count: 2
upvote count: 1
tagged with: javascript

http://stackoverflow.com/q/28336338
type: UnansweredQuestion
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45018779
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: Completely removing loaded forms with jQuery -
has body: So I'm using .load() to load a view into an element - and when I'm done with it I do an .innerHTML = '' to get rid of it. But if I do it more than once (i.e. close and open the element) - the form is definitely gone in between and reloaded, but when I submit it submits duplicates. Here is the code: $('a.comments').click(function(e){ e.preventDefault(); // $('.overlaybackground').addClass('open'); Component.Overlay.toggleOverlay(); $('#commentcontainer').load($(this).attr('href'), function(){ Component.Forms.init(page, {}); }); }); $('.overlaybackground').click(function(e){ if(e.target.className == 'overlaybackground open'){ e.preventDefault(); Component.Overlay.toggleOverlay(); // $('.overlaybackground').remove('*:not(#commentcontainer)'); document.getElementById('commentcontainer').innerHTML = ''; } });
has comment: http://stackoverflow.com/comment/45018720
has answer: http://stackoverflow.com/a/28337367
has answer: http://stackoverflow.com/a/28336380

http://stackoverflow.com/comment/44995919
type: QuestionComment
has text: Are you sure you are getting the contectIdTD value on click with $(this).text()? In general, you shouldn't really mix jQuery with angular like that.
comment on: http://stackoverflow.com/q/28323956
score: 0
type: Comment

http://stackoverflow.com/comment/45191136
type: QuestionComment
comment on: http://stackoverflow.com/q/28416551
has text: There is no template cache used in this specific app and the template is not being loaded into the template cache either.
score: 0
type: Comment

http://stackoverflow.com/q/28409530
has answer: http://stackoverflow.com/a/28410032
has comment: http://stackoverflow.com/comment/45152913
has comment: http://stackoverflow.com/comment/45152895
tagged with: node.js
type: AnsweredQuestion
has title: Accessing JavaScript method from a batch file
accepted answer: http://stackoverflow.com/a/28411129
type: Question
has comment: http://stackoverflow.com/comment/45153104
tagged with: javascript
linked to: http://stackoverflow.com/q/4999395
score: 0
tagged with: batch-file
answer count: 2
tagged with: windows
possible better answer: http://stackoverflow.com/a/28410032
has answer: http://stackoverflow.com/a/28411129
has body: I have gone through multiple post like Embedded js in a batch file which suggest the possibility of combining batch file and javascript. My question here is-whether it is possible to use the method of a .js file in .bat file? For example-Define a js file with some methods as below - test.js add:function(a, b){ return a+b;} test.bat add(1, 2); ::Or something like add 1 2 Output C:\&gt;test 3

http://stackoverflow.com/a/28351019
answers question: http://stackoverflow.com/q/28343338
has body: Try removing the inline script and use the jQM pageinit method to bind the click events that launch the dialog: Test Alert Web-App Development Using jGFeed Try it $('#functions').on('pageinit', function (event) { $("#btnDialog, #testAlert").on("click", function (e) { testAlert(); }); }); Here is a working DEMO
type: Answer
score: 0

http://stackoverflow.com/a/28400505
score: 0
accepted answer of: http://stackoverflow.com/q/28400375
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28400375
has body: Your database is returning \n, the newline character. HTML will parse the newline character as a new line if it is within a &lt;p&gt;&lt;/p&gt;. You have two choices: 1) Put the output in a &lt;p&gt;. or 2) Search and replace all instances of \n with &lt;br /&gt;: someString.replace(/\n/g, "&lt;br /&gt;");
type: Answer

http://stackoverflow.com/q/28416802
upvote count: 2
has body: Trying to figure out an 'Angular specific' way to try and achieve this. I have a page with some views. When a user clicks an anchor, the views change, which I have working just fine. What I'm curious is, if when the user clicks, is it possible to store a variable (say the inner html) then pass it to the $routeProvider to load the view a bit more dynamically? So for anchor tag #name1, when that view is displayed, I can pass name1 into nameHolder as a variable to load some files with the same name. HTML this that JS var nameHolder= []; var app = angular.module( "myApp", ['ngRoute'] ); app.config(['$routeProvider', function($routeProvider) { $routeProvider. when('/' + nameHolder, { templateUrl: nameHolder + ".html", controller: 'individ', nameofuser: nameHolder }). when('/', { templateUrl: 'this.html' }); }]); app.controller('individ', function($scope, $route) { $scope.img = $route.current.nameofuser; }); $(document).ready(function(){ $('a').click(function(){ nameHolder.length = 0; var pushThis = $(this).text(); nameHolder.push(pushThis); console.log(nameHolder) }); }); Thanks for any info. Here's a JSFiddle
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28416882
score: 2
answer count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28416882
has title: AngularJS - Passing a variable into `$routeProvider`
type: AnsweredQuestion

http://stackoverflow.com/q/28333995
possible better answer: http://stackoverflow.com/a/28334047
has comment: http://stackoverflow.com/comment/45014960
downvote count: 2
has answer: http://stackoverflow.com/a/28334047
upvote count: 1
has body: In a for loop, the i is my loop counter. console.log($(f_images[i].DOM)); $(f_images[i].DOM).hover(function() { console.log($(f_images[i].DOM)); }, function() {}); Console showed me: [object Object] "Uncaught TypeError: Cannot read property 'DOM' of undefined". Same thing happened if I replace $(f_images[i].DOM) with whatever related to f_images. Why can't I access the object array itself in the hover function?
linked to: http://stackoverflow.com/q/750486
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45014772
tagged with: javascript
score: -1
answer count: 2
has answer: http://stackoverflow.com/a/28334072
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45014779
accepted answer: http://stackoverflow.com/a/28334072
has title: Couldn't access object in function
has comment: http://stackoverflow.com/comment/45014814

http://stackoverflow.com/comment/44945364
comment on: http://stackoverflow.com/q/28296427
score: 0
type: Comment
type: QuestionComment
has text: Please show the rest of the code on the page so that we can see the context of `old_pageid` and `pageid`

http://stackoverflow.com/a/28294050
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28287943
has body: Concat files and extend objects aren't equal operations. You can read the files via 'fs' module, parse objects, extend, and send.
upvote count: 1
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28287943

http://stackoverflow.com/comment/45306529
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28334988
has text: My last comment have a test in github with Get request as Post request is not allowed there.And with the test you can see the js codes are right.But i'm curious why your ajax get empty data.Could i have the link of your page?

http://stackoverflow.com/a/28348258
has body: I think Array.prototype.forEach may not be what you need here, may I suggest using Array.prototype.map instead? (Note that this would work on most browsers and IE9+) // this function would return a string of 4 digits function paswdGen() { var nums = [0, 0, 0, 0]; return nums.map(function () { return Math.floor((Math.random() * 9) + 1); }).join(''); }
downvote count: 0
score: 1
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28348082

http://stackoverflow.com/a/28378004
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 13
has comment: http://stackoverflow.com/comment/45180051
has body: That's the origin, file system and sandboxed iframes(maybe others) have null as their origin. If you set up a local sever it should say http%3A//localhost, that's http://localhost url encoded var arrayBuffer = new ArrayBuffer(100); var uint8Array = new Uint8Array(arrayBuffer); for (var i = 0; i &lt; 100; i++) { uint8Array[i] = i; } var blob = new Blob([uint8Array], { type: "image/png" }); var blobVal = URL.createObjectURL(blob); $('div').html(blobVal); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div&gt;&lt;/div&gt; This one sais http%3A//fiddle.jshell.net http://jsfiddle.net/thsn3ayp/
score: 13
has comment: http://stackoverflow.com/comment/45165904
accepted answer of: http://stackoverflow.com/q/28377733
has comment: http://stackoverflow.com/comment/45165644
answers question: http://stackoverflow.com/q/28377733

http://stackoverflow.com/a/44190532
downvote count: 0
has comment: http://stackoverflow.com/comment/136689646
score: 23
answers question: http://stackoverflow.com/q/28314368
type: Answer
has body: You can "persist" the state using local storage as Omar Suggest, but it should be done once the state has been set. For that you need to pass a callback to the setState function and you need to serialize and deserialize the objects put into local storage. constructor(props) { super(props); this.state = { allProjects: JSON.parse(localStorage.getItem('allProjects')) || [] } } addProject = (newProject) =&gt; { ... this.setState({ allProjects: this.state.allProjects.concat(newProject) },() =&gt; { localStorage.setItem('allProjects', JSON.stringify(this.state.allProjects)) }); }
upvote count: 23

http://stackoverflow.com/a/28375837
has comment: http://stackoverflow.com/comment/45093702
accepted answer of: http://stackoverflow.com/q/28375791
answers question: http://stackoverflow.com/q/28375791
type: AcceptedAnswer
downvote count: 0
has body: By default, XHR requests are asynchronous. That means that send starts them, but they complete later (which is why they have callbacks rather than return values). Just use obj within the callback. Side note: Your code is falling prey to The Horror of Implicit Globals (you never declare your xhr variable).
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45099469

http://stackoverflow.com/a/28322010
score: 0
has comment: http://stackoverflow.com/comment/44991918
answers question: http://stackoverflow.com/q/28321804
type: Answer
has body: You can use brilliant function of JavaScript - filter. For example let's imagine you have array of objects: var data = [{"date":"date1", "name":"tableA"}, {"date":"date2", "name":"tableB"}, {"date":"date3", "name":"tableA"}, {"date":"date4", "name":"tableB"}]; You can describe two functions. Like: function all_A(el) { if(el.name == 'tableA') { return true; } } function all_B(el) { if(el.name == 'tableB') { return true; } } Function all_A will return true for each element if name attribute of it element is "TableA". Something similar for all_B. Then you need just run filter function on your data array. Like that: var table_A = data.filter(all_A); var table_b = data.filter(all_B); Here is working example :) - http://jsfiddle.net/32a97n1b/
has comment: http://stackoverflow.com/comment/44991974

http://stackoverflow.com/comment/44932621
has text: You are right! I overlooked this.
comment on: http://stackoverflow.com/a/28289431
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28427540
type: UnansweredQuestion
has body: I'm importing data into the listview with jsoup. It's not working on different url . where as html page is same. @Override protected Void doInBackground(Void... params) { arraylist = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;(); try { Document doc = Jsoup.connect(url).get(); for (Element table : doc.select("table")) { for (Element row : table.select("tr:gt(0)")) { HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;(); Elements tds = row.select("td"); map.put("population", tds.get(1).text()); arraylist.add(map); } } } catch (IOException e) { e.printStackTrace(); } return null; }
type: Question
has comment: http://stackoverflow.com/comment/45187870
has comment: http://stackoverflow.com/comment/45187665
tagged with: javascript
score: 0
tagged with: android
has comment: http://stackoverflow.com/comment/45187978
has title: Error in importing data into the listview with Jsoup
has comment: http://stackoverflow.com/comment/45186873
answer count: 0

sequelize.js
type: Tag
tags question: http://stackoverflow.com/q/28418112
tags question: http://stackoverflow.com/q/28291747
tags question: http://stackoverflow.com/q/28418650
tag name: sequelize.js
tags question: http://stackoverflow.com/q/28401465

http://stackoverflow.com/q/28390381
has title: What is the purpose of using ~ in JavaScript?
linked to: http://stackoverflow.com/q/9316612
favorite count: 0
accepted answer: http://stackoverflow.com/a/28390502
has comment: http://stackoverflow.com/comment/45118190
tagged with: zepto
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45118403
has comment: http://stackoverflow.com/comment/45118406
upvote count: 3
linked to: http://stackoverflow.com/q/6260475
downvote count: 1
has comment: http://stackoverflow.com/comment/45118498
type: Question
has body: I am trying to read the source code of Zepto.js. And there is a place in function matches that I don't understand: zepto.matches = function(element, selector) { if (!selector || !element || element.nodeType !== 1) return false var matchesSelector = element.webkitMatchesSelector || element.mozMatchesSelector || element.oMatchesSelector || element.matchesSelector if (matchesSelector) return matchesSelector.call(element, selector) var match, parent = element.parentNode, temp = !parent if (temp) (parent = tempParent).appendChild(element) //Here is my question. This line used the `~` match = ~zepto.qsa(parent, selector).indexOf(element) temp &amp;&amp; tempParent.removeChild(element) return match } Function matches is used for determines whether an element matches the selector provided. It should return a Boolean. And the zepto.qsa() is Zepto's CSS selector implementation which uses document.querySelectorAll and some other optimizes. So. What is the purpose of the ~ in the following code ? match = ~zepto.qsa(parent, selector).indexOf(element) I know that ~ means Bitwise NOT. And (by my own tests): ~ -1 === 0 ~ 0 === -1 ~ 1 === -2 But I still don't understand what this design is for. Can someone explain?
has answer: http://stackoverflow.com/a/28390502
possible better answer: http://stackoverflow.com/a/28390448
has answer: http://stackoverflow.com/a/28390448
tagged with: javascript
answer count: 2
has comment: http://stackoverflow.com/comment/45118265

http://stackoverflow.com/q/28306186
accepted answer: http://stackoverflow.com/a/28306706
has body: How do i do this, W3Schools is not helpful here is my code document.cookie="krul=1"; var x = document.cookie; if(x == 1){ document.getElementById("krul").src="https://www.youtube.com/v/An9M93j2XUs?version=3&amp;loop=1&amp;playlist=An9M93j2XUs&amp;autoplay=1"; } I created a cookie kruuuul=1 then I try assingning it to x and comparing it in a if statement.
type: AnsweredQuestion
tagged with: cookies
score: 0
has title: how to call to a specific cookie in JS
type: Question
answer count: 2
tagged with: if-statement
tagged with: javascript
linked to: http://stackoverflow.com/q/10730362
possible better answer: http://stackoverflow.com/a/28306799
has answer: http://stackoverflow.com/a/28306706
has answer: http://stackoverflow.com/a/28306799
has comment: http://stackoverflow.com/comment/44963404

http://stackoverflow.com/q/28365391
has comment: http://stackoverflow.com/comment/45072034
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45071951
has body: I have to store the inner html of a table into a hidden input box. I am able to store it in a JavaScript variable but not been able to store it in the hidden input box. Here is the code I have written so far: in .JS file d = document.getElementById('address').innerHTML; document.getElementById('hid1').value = d; in .php file &lt;input type="hidden" id="hid1" name="hid1"/&gt; Please help me with this...am really clueless on what to do
tagged with: php
has answer: http://stackoverflow.com/a/28365501
has comment: http://stackoverflow.com/comment/45072024
score: 0
has comment: http://stackoverflow.com/comment/45072082
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28365684
has comment: http://stackoverflow.com/comment/45072051
has title: can I store an innerHTML of a div into a hidden text box in javascript and php

http://stackoverflow.com/comment/45176871
has text: What does the `forever` file look like? Specifically what does its shebang (`#!`) line look like?
comment on: http://stackoverflow.com/q/28420832
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28383505
score: 0
answer count: 2
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
possible better answer: http://stackoverflow.com/a/28383538
accepted answer: http://stackoverflow.com/a/28401044
has answer: http://stackoverflow.com/a/28383538
has comment: http://stackoverflow.com/comment/45108908
tagged with: php
has comment: http://stackoverflow.com/comment/45105033
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45105115
has comment: http://stackoverflow.com/comment/45105017
tagged with: wordpress
upvote count: 1
has body: Using wordpress for my new site, and I am putting together the content of my pages. But I'm struggling to come up with a way to detect a mobile browser, and then with the result, change the visibility of certain elements (text / images) on the page depending on whether it is being viewed from a mobile device or a computer. Eg. If onmobile=true, , else . Thanks in advance :)
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28401044
tagged with: javascript
tagged with: jquery
has title: How to detect Mobile Browser (PHP/Javascript) and then make image/text change?

http://stackoverflow.com/comment/45439546
score: 0
type: Comment
has text: Yes, I mean cache the full path to the image instead of getting it from the files system
comment on: http://stackoverflow.com/a/28472017
type: AnswerComment

http://stackoverflow.com/comment/45104216
score: 0
type: Comment
type: QuestionComment
has text: I did not say about pure html, I said about "as pure as possible". So, jQuery variant will be more pure, but it can have more potential problems. So, I want to find "the middle" and which variant is more preferred. My opinion, your variant with ClassName is not good, because: 1. Html depends on Controller (designer can't change design, need to recompile the application), 2. attribute "class" is unnecessary for some cases...
comment on: http://stackoverflow.com/q/28377924

http://stackoverflow.com/comment/45202267
type: QuestionComment
type: Comment
has text: You can try to inject `base` tag into head section of the string. Or simply `str = ' ' + str;`. But this is hack.
comment on: http://stackoverflow.com/q/28435626
score: 0

base64
tags question: http://stackoverflow.com/q/28293299
tag name: base64
tags question: http://stackoverflow.com/q/28301486
tags question: http://stackoverflow.com/q/28343098
type: Tag
tags question: http://stackoverflow.com/q/28296252

http://stackoverflow.com/a/28377775
has body: I've been looking for something similar a while ago, but I was not able to guess what classes I do not need (as they were appended dynamically). So, instead of excluding unwanted classes with not(), I made this to match elements with only classes I know of. var classes = ['a','c','b']; $('.'+classes.join('.')).each( function(){ var cl = $(this).attr('class'); for(var i in classes) { cl = cl.split(classes[i]).join(''); } if(cl.replace(/\s+/, '') === ''){ $(this).addClass('blah'); } }); .blah{ font-size:30px; color : red; } Foo Bar Hello World JSFiddle . As a method: function el(c){ var a = []; $('.'+c.join('.')).each(function(){ var k = $(this).attr('class'); for(var i in c) k=k.split(c[i]).join(''); if(k.replace(/\s+/,'')==='') a.push(this); }); return a; } // usage: $(el(['a','c','b'])).addClass('blah');
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28377207
score: 2
upvote count: 2

http://stackoverflow.com/comment/44928826
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28287040
has text: Ben, are sentence1 to 5 observable?

http://stackoverflow.com/comment/45154060
has text: What is "first thing", can you post the code?
comment on: http://stackoverflow.com/q/28410286
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28360403
possible better answer: http://stackoverflow.com/a/28360493
type: AnsweredQuestion
has body: I have a html structure for navigation like this. It is dynamically creating the navigation. Media Centre Vision And Mission Strategic Goals Task of the Department Contact Here in the first li having children as ul and li(sub menu). But the second li has no sub menu.but the div is showing in front end. The menu and sub menu is programatically coming so I can't remove the div cbp-hrsub.I need to change the div display none when the li has no children. I tried: Like this, but the div is showing no effect.
has answer: http://stackoverflow.com/a/28360493
tagged with: javascript
tagged with: jquery
has title: Hide a div inside the li using jquery
has answer: http://stackoverflow.com/a/28360520
has answer: http://stackoverflow.com/a/28360478
type: Question
score: 0
accepted answer: http://stackoverflow.com/a/28360478
has answer: http://stackoverflow.com/a/28360517
answer count: 4

http://stackoverflow.com/a/28392961
has comment: http://stackoverflow.com/comment/45124201
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/45122727
has comment: http://stackoverflow.com/comment/45123125
downvote count: 0
has comment: http://stackoverflow.com/comment/45122983
has body: Here's a pure HTML + CSS method. The trick is applying a negative z-index to the second word. That makes it unclickable: a { text-decoration: none; } a span:nth-child(1), a span:nth-child(3) { font-weight: bold; } a:hover span:nth-child(1), a:hover span:nth-child(3) { text-decoration: underline; } a span:nth-child(2) { position: relative; z-index: -1; } This does not need any open bladder surgeries . If you want the second word to have a different link, I think you need to duplicate the HTML, making the first instance position: absolute, and the second word of the second instance position: relative. You can then change formatting based on hover: a { text-decoration: none; font-weight: bold; } #a1 { position: absolute; } #a2 span:nth-child(2) { position: relative; } #a1:hover span:nth-child(1), #a1:hover span:nth-child(3) { text-decoration: underline; } #a2:hover span:nth-child(2) { text-decoration: underline; } This does not need any open bladder surgeries open bladder surgeries .
score: 1
has comment: http://stackoverflow.com/comment/45122683
answers question: http://stackoverflow.com/q/28392538

http://stackoverflow.com/q/28432589
has body: I'm making a chat using ActionController::live. stream in my ChatsController pushes posts. def stream response.headers['Content-Type'] = 'text/event-stream' start = Time.zone.now loop do Post.where('created_at &gt; ?', start).each do |post| response.stream.write("event:push\n") response.stream.write("data:#{post.to_json}\n\n") start = post.created_at end sleep 2 end rescue IOError ensure response.stream.close end Using javascript, I wrap gravatar and this json with &lt;li&gt; and append this to &lt;ul&gt;. Then, I want to use gravatar_for method I defined and render partial for post model. Would you teach me how to append ruby code (&lt;%...%>) to html elements( )? I tried to .append('&lt;%...%&gt;') once, it didn't work.
score: 2
accepted answer: http://stackoverflow.com/a/28432852
type: AnsweredQuestion
tagged with: ruby-on-rails
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45195506
has answer: http://stackoverflow.com/a/28432852
downvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: ruby
upvote count: 2
has title: How to append ruby code to html element

http://stackoverflow.com/comment/45033453
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28339246
has text: @MichalHainc: I have recieved the stream correctly in browser but somehow it gets corrupted while downloading. When I am passing the url as SRC in IFrame it is downloading correctly but the file corrupts if I am using ajax request.

http://stackoverflow.com/a/28426310
upvote count: 1
has body: You can use each() function: $('.document-content').find('h2').each(function() { var that = $(this); that.addClass('custom-class'); // more code here.. // that.find('.another-element').addClass('test'); }); .custom-class { color: red; } Heading 1 Content Heading 2 Content
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45184620
has comment: http://stackoverflow.com/comment/45184577
answers question: http://stackoverflow.com/q/28426290

http://stackoverflow.com/a/28539870
answers question: http://stackoverflow.com/q/28349679
score: 0
type: AcceptedAnswer
type: Answer
has body: It appears that it is not possible to share local storage values between HTTP and HTTPS.
accepted answer of: http://stackoverflow.com/q/28349679

selectors-api
tag name: selectors-api
type: Tag
tags question: http://stackoverflow.com/q/28432763

http://stackoverflow.com/comment/45017333
has text: Why do you need the name of the function?
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28335109

http://stackoverflow.com/a/28288039
has comment: http://stackoverflow.com/comment/44930118
has body: OK, let's expand the code I gave you in the last question by grouping it into functions and introducing callbacks: function buildBar(id, callback) { var currentAdb = 0; var imgCtb = 25; function cycleb() { var output = '['; for (var i = 0; i &lt; imgCtb; i++) { output += i &gt; currentAdb ? '&amp;nbsp;' : '/'; } output += ']'; document.getElementById(id).innerHTML = output; ++currentAdb; if (currentAdb == imgCtb) { window.clearInterval(myInterval); if (typeof callback == 'function') { callback(); } } } var myInterval = window.setInterval(cycleb, 500); } function callback1() { buildBar('adLinkb2', callback2); } function callback2() { //window.location... stuff here alert('redirect should go here'); } buildBar('adLinkb', callback1); #adLinkb, #adLinkb2 { font-size: 12px; color: #000; font-family: monospace; } &lt;div id="adLinkb"&gt;&lt;/div&gt; &lt;div id="adLinkb2"&gt;&lt;/div&gt;
has comment: http://stackoverflow.com/comment/44930691
has comment: http://stackoverflow.com/comment/44930716
has comment: http://stackoverflow.com/comment/44930457
score: 0
has comment: http://stackoverflow.com/comment/44931502
has comment: http://stackoverflow.com/comment/44929965
type: Answer
has comment: http://stackoverflow.com/comment/44932294
has comment: http://stackoverflow.com/comment/44930330
answers question: http://stackoverflow.com/q/28287901

http://stackoverflow.com/q/28295632
has comment: http://stackoverflow.com/comment/55378365
favorite count: 0
type: Question
score: 5
linked to: http://stackoverflow.com/q/17594855
has comment: http://stackoverflow.com/comment/44983649
has comment: http://stackoverflow.com/comment/55371683
tagged with: twitter-bootstrap
upvote count: 5
type: UnansweredQuestion
tagged with: bootstrap-notify
has body: I've been using bootstrap-growl for some time (v1.0.6) and today I updated it to current v2.0.0. Now growl call throws an exception from jQuery (v1.11 - it's matching bootstrap-growl dependencies) Uncaught TypeError: Cannot read property 'ownerDocument' of undefined Exactly in this block of jQuery Sizzle.contains = function( context, elem ) { // Set document vars if needed if ( ( context.ownerDocument || context ) !== document ) { setDocument( context ); } return contains( context, elem ); }; Which is quite fair - context is undefined, but I don't know why. For now, I revert this update but how I can rid out of exception? Whan can cause the problem? PS it's not an issue described here Below my default options setting and call. Default settings: $.growl.default_options = { ele: "body", type: "info", allow_dismiss: true, position: { from: "top", align: "center" }, offset: 20, spacing: 10, z_index: 1031, fade_in: 400, delay: 0, //delay of auto-closing pause_on_mouseover: true, onGrowlShow: null, onGrowlShown: null, onGrowlClose: null, onGrowlClosed: null, template: { icon_type: 'class', container: '&lt;div class="col-xs-10 col-sm-10 col-md-5 alert growl-animated"&gt;', dismiss: '&lt;button type="button" class="close" data-dismiss="alert" aria-hidden="true"&gt;&amp;times;&lt;/button&gt;', title: '&lt;strong&gt;', title_divider: '&lt;br /&gt;', message: '' } }; Growl call $.growl({ title: "some message" }, { type: 'success', template: { container: '&lt;div class="col-xs-10 col-sm-10 col-md-5 alert growl-animated growl-icon-bg growl-success"&gt;' }); Stack trace: Uncaught TypeError: Cannot read property 'ownerDocument' of undefined jquery-1.11.0.js:1443 Sizzle.contains jquery-1.11.0.js:5615 jQuery.extend.buildFragment jquery-1.11.0.js:5885 jQuery.fn.extend.domManip jquery-1.11.0.js:5704 jQuery.fn.extend.append bootstrap-growl.min.js:2 p bootstrap-growl.min.js:2 l bootstrap-growl.min.js:2 f bootstrap-growl.min.js:2 e.growl Competences:578 showGrowlWithDelay
has title: "Cannot read property 'ownerDocument' of undefined" when call bootstrap-growl
answer count: 0
downvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/45125047
has text: Yes, it works with `document.write` because you aren't assigning to the `name` element (as mentioned in my comment, this might be getting overwritten). Also, check the console for any errors.
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28393498

http://stackoverflow.com/comment/45046865
has text: Can I place a variable inside this function? Thank you.
type: Comment
comment on: http://stackoverflow.com/a/28351550
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45136434
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/28400354
has text: http://jsfiddle.net/0bg7bq5t/ working fine!
type: Comment

http://stackoverflow.com/comment/101232231
has text: Also, extending the prototype *is* abuse, unless it's a polyfill. `some()` and other functions were added because people were looking for the functionality and these functions are generic enough to add to the standard. Whether people were modifying the prototype, using plain old functions or using methods on some helper object had nothing to do with it.
comment on: http://stackoverflow.com/a/34588812
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44995779
score: 0
has text: What do you mean when you say "no luck"?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28323977

http://stackoverflow.com/comment/45136499
type: Comment
comment on: http://stackoverflow.com/q/28400354
has text: http://jsfiddle.net/0bg7bq5t/1/ seems to work fine when duplicating ID's as well, not sure what your issue is...
score: 0
type: QuestionComment

http://stackoverflow.com/a/28421585
has comment: http://stackoverflow.com/comment/91943610
downvote count: 0
answers question: http://stackoverflow.com/q/28415318
type: Answer
upvote count: 3
has body: The problem is likely that your tests are running before the browser page is completely loaded. The angular global variable has not been created yet. You can ensure that all has been loaded before tests start by putting the following line in your protractor.conf.js file's onPrepare method: browser.driver.get(browser.baseUrl); This will navigate to the page before any tests start and ensure that all is loaded.
score: 3

http://stackoverflow.com/comment/44942471
type: Comment
has text: Of course, if there is out there something similar to what I'm trying to do, please send a link so I can check it out and learn from that! ;)
type: QuestionComment
comment on: http://stackoverflow.com/q/28294892
score: 0

http://stackoverflow.com/comment/45108978
has text: and??? what is you criteria???
comment on: http://stackoverflow.com/q/28382065
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28388530
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28431346
accepted answer: http://stackoverflow.com/a/28431346
downvote count: 0
linked to: http://stackoverflow.com/q/5326300
has answer: http://stackoverflow.com/a/68256608
tagged with: google-chrome-devtools
has title: Why does Chrome debugger think closed local variable is undefined?
possible better answer: http://stackoverflow.com/a/40551954
has comment: http://stackoverflow.com/comment/109756030
answer count: 6
has comment: http://stackoverflow.com/comment/45179366
type: Question
has comment: http://stackoverflow.com/comment/45114688
tagged with: javascript
has answer: http://stackoverflow.com/a/28420359
has comment: http://stackoverflow.com/comment/64347120
has comment: http://stackoverflow.com/comment/77020218
favorite count: 0
score: 195
has body: With this code: function baz() { var x = "foo"; function bar() { debugger; }; bar(); } baz(); I get this unexpected result: When I change the code: function baz() { var x = "foo"; function bar() { x; debugger; }; bar(); } I get the expected result: Also, if there is any call to eval within the inner function, I can access my variable as I want to do (doesn't matter what I pass to eval). Meanwhile, Firefox dev tools give the expected behavior in both circumstances. What's up with Chrome that the debugger behaves less conveniently than Firefox? I have observed this behavior for some time, up to and including Version 41.0.2272.43 beta (64-bit). Is it that Chrome's javascript engine "flattens" the functions when it can? Interestingly if I add a second variable that is referenced in the inner function, the x variable is still undefined. I understand that there are often quirks with scope and variable definition when using an interactive debugger, but it seems to me that based on the language specification there ought to be a "best" solution to these quirks. So I am very curious if this is due to Chrome optimizing further than Firefox. And also whether or not these optimizations can easily be disabled during development (maybe they ought to be disabled when dev tools are open?). Also, I can reproduce this with breakpoints as well as the debugger statement.
has answer: http://stackoverflow.com/a/40551954
linked to: http://stackoverflow.com/q/5368048
upvote count: 195
has comment: http://stackoverflow.com/comment/45176940
has comment: http://stackoverflow.com/comment/76253347
has answer: http://stackoverflow.com/a/28388973
has comment: http://stackoverflow.com/comment/77659585
tagged with: google-chrome
linked to: http://stackoverflow.com/q/8665781
has answer: http://stackoverflow.com/a/28423576

http://stackoverflow.com/comment/45115503
score: 2
comment on: http://stackoverflow.com/q/28388885
has text: @JonathanLonowski interesting, it is odd that I can't find an issue/PR regarding Node 0.12. **edit:** filed an [issue](https://github.com/kangax/compat-table/issues/427).
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44954011
comment on: http://stackoverflow.com/a/28300409
has text: i previously checked and called the function inside if (jsonData[i].children.length >0 ) { } but still was getting error. Any how thanks mate solved the issue.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28286789
accepted answer: http://stackoverflow.com/a/28287120
has title: Prevent duplication in result list when comparing and matching two lists of objects
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28287120
has comment: http://stackoverflow.com/comment/44927604
has comment: http://stackoverflow.com/comment/44928232
has comment: http://stackoverflow.com/comment/44927834
downvote count: 1
has comment: http://stackoverflow.com/comment/44927590
has comment: http://stackoverflow.com/comment/44927879
type: AnsweredQuestion
score: 2
upvote count: 3
has comment: http://stackoverflow.com/comment/44927627
type: Question
has body: I am comparing two object in javascript, if that matches then make the color red, if not keep it black. However, it returns two lines of information rather than one. In the following result, I expect to see first two element red the last one black. However it returns and writes two rows, rather than one row. $.each(aut.AssociatedwellList, function(k,mano) { $.each(aut.WellList, function(j,mango) { if(mano.WellName === mango.WellName) { wellNameList += '&lt;li style="color:red;"&gt;&lt;div&gt;'+ mango.WellName+'&lt;/div&gt;&lt;/li&gt;'; } else { wellNameList += '&lt;li &gt;&lt;div&gt;'+ mango.WellName+'&lt;/div&gt;&lt;/li&gt;'; } }); });
has comment: http://stackoverflow.com/comment/44927700
has comment: http://stackoverflow.com/comment/44927568
has comment: http://stackoverflow.com/comment/44927551
has comment: http://stackoverflow.com/comment/44928191
has comment: http://stackoverflow.com/comment/44928098
tagged with: javascript
has comment: http://stackoverflow.com/comment/44927663

http://stackoverflow.com/comment/45082377
score: 0
type: QuestionComment
has text: Post a complete script... your script is missing data source..
type: Comment
comment on: http://stackoverflow.com/q/28348339

http://stackoverflow.com/comment/69037132
type: AnswerComment
type: Comment
has text: @NevilleKatila Happy coding :)
comment on: http://stackoverflow.com/a/38670573
score: 0

http://stackoverflow.com/a/28385480
upvote count: 4
accepted answer of: http://stackoverflow.com/q/28385426
has comment: http://stackoverflow.com/comment/45111781
has comment: http://stackoverflow.com/comment/45108723
has comment: http://stackoverflow.com/comment/45121457
has comment: http://stackoverflow.com/comment/45108599
has comment: http://stackoverflow.com/comment/45109792
score: 4
type: AcceptedAnswer
downvote count: 0
has body: Change from this: setTimeout(hide(this),2000); to this: var self = this; setTimeout(function() { hide(self); },2000); You were calling the function immediately and passing its return value to setTimeout rather than passing a function reference to setTimeout that can be called later. Keep in mind that (xx) means execute now. So hide(this) means to execute it now, not later. On the other hand, function() { hide(this); } is a function reference that can be called later. Or, if you aren't using the hide function anywhere else, then you can integrate it in like this: $(".addtimer div").click(function(){ $(this).toggleClass("remove"); var self = this; setTimeout(function() { $(self).remove(); },2000); }); A useful language feature is .bind() which can be used to "hardwire" the value of this or of arguments to callback functions. For example, you could do this: $(".addtimer div").click(function(){ $(this).toggleClass("remove"); setTimeout(function() { $(this).remove(); }.bind(this),2000); }); The .bind(this) sets the current value of this to be the value of this when the callback function is called. Or, if you still have the function hide(item), then you could use .bind to set the argument to hide() like this: $(".addtimer div").click(function(){ $(this).toggleClass("remove"); setTimeout(hide.bind(null, this)), 2000); }); Or, you could use an animation and let it provide the timing for you: $(".addtimer div").click(function(){ $(this).toggleClass("remove").delay(1000).slideUp(1000, function() { $(this).remove(); }); }); As you can see, there are lots of options and which to use depends a bit on the situation, what you think makes the clearest code in your situation and what you are most comfortable in using.
answers question: http://stackoverflow.com/q/28385426
type: Answer

http://stackoverflow.com/comment/45008926
type: QuestionComment
comment on: http://stackoverflow.com/q/28330337
has text: this is the full Javascript code, in my HTML page I got example this next button
score: 0
type: Comment

http://stackoverflow.com/a/28330046
score: 2
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28329978
has body: Use .delay(). i*500 is going to add a 500ms delay to each item. To fade them, use .fadeIn() instead of .show(). $.each(divs, function(i,element){ $("#id").append($(element).hide().delay(i*500).fadeIn()); }); Demo: var divs = $('#hidden > div'); $.each(divs, function(i,element){ $("#id").append($(element).hide().delay(i*500).fadeIn()); }); #hidden { display: none } #id > div { width: 15px; height: 15px; margin: 0 5px 5px 0; padding: 10px; } #id > div:nth-child(even) { background-color: #efefef; } #id > div:nth-child(odd) { background-color: #fff; } A B C D E F G
answers question: http://stackoverflow.com/q/28329978

http://stackoverflow.com/a/28296558
has comment: http://stackoverflow.com/comment/47104530
has comment: http://stackoverflow.com/comment/45432160
has body: The meteor core packages are included by the 'meteor-platform' packaage. You can edit your .meteor/packages file ( or use meteor add and meteor remove to remove the 'meteor-platform' package and then add back whichever meteor packages you want. The packages in 'meteor-platform' are listed here with brief explanations'. I don't think removing Blaze and Spacebars will lead to your index.html file remaining unchanged but don't really know. You could always just move it to the 'public' folder and then it will be served at '/index.html'.
answers question: http://stackoverflow.com/q/28296013
has comment: http://stackoverflow.com/comment/47126942
has comment: http://stackoverflow.com/comment/45431887
score: 0
has comment: http://stackoverflow.com/comment/44960487
type: Answer
has comment: http://stackoverflow.com/comment/44951717

http://stackoverflow.com/a/28316181
upvote count: 1
has comment: http://stackoverflow.com/comment/44983405
type: Answer
has body: Enabling CORS in Angular side var myApp = angular.module('myApp', [ 'myAppApiService']); myApp.config(['$httpProvider', function($httpProvider) { $httpProvider.defaults.useXDomain = true; delete $httpProvider.defaults.headers.common['X-Requested-With']; } ]);
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28306953
has comment: http://stackoverflow.com/comment/44983498
has comment: http://stackoverflow.com/comment/44983471
has comment: http://stackoverflow.com/comment/44983581
has comment: http://stackoverflow.com/comment/44983420

http://stackoverflow.com/comment/45077027
comment on: http://stackoverflow.com/q/28368039
score: 0
has text: Remove "if you need more specific information i'm online the whole day" line .. and post what have you done till now ..
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44996263
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28301685
has text: @Aaron, just to clarify, because - forgive me if I'm mistaken - I think you misunderstood my question. I am not talking about *setting* HTML element display / behaviour, I am talking about *modifying* HTML element display / behaviour consequent to user interaction, after the page has already loaded with all element styles declared in the stylesheet etc.

http://stackoverflow.com/comment/45057792
type: Comment
comment on: http://stackoverflow.com/q/28357126
score: 0
type: QuestionComment
has text: MSDN says that `outerHTML` is read-only for some types of elements.

http://stackoverflow.com/comment/44983319
has text: I am using Cordova 4.1.2 version. I got the issue with my code . the `appview` in my case is null hence not able to bind loadUrl to it.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28314391

http://stackoverflow.com/a/28335958
type: Answer
answers question: http://stackoverflow.com/q/28335916
has comment: http://stackoverflow.com/comment/45018146
score: 0
has body: You can bind to any event that the browser supports on DOM elements. The page you linked to contains all the standard DOM events, but browsers might supply their own implementation-dependent events as well. For instance, that page also has a section titled Mozilla-specific events. For other browsers, you would have to find their developer documentation. If you can bind the event using the native addEventListener method in Javascript, you can bind it using .on() in jQuery.

http://stackoverflow.com/comment/45193647
comment on: http://stackoverflow.com/q/28431036
score: 0
type: Comment
has text: Your fiddle just shows a 0.15s fadeIn and fadeOut...
type: QuestionComment

http://stackoverflow.com/a/28333805
type: Answer
has comment: http://stackoverflow.com/comment/101000273
score: 3
has comment: http://stackoverflow.com/comment/45014444
downvote count: 2
has comment: http://stackoverflow.com/comment/45014525
accepted answer of: http://stackoverflow.com/q/28333613
has body: To put it simply, you can't. The best you can do is to collect the form field values yourself, or using jQuery's .serialize() function, which returns those values exactly as you'd expect: name=value&amp;name2=value2
answers question: http://stackoverflow.com/q/28333613
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/101121939
upvote count: 5

http://stackoverflow.com/comment/45058788
type: Comment
score: 1
type: AnswerComment
has text: To be technically accurate, the `console.log(res.send(user))` is probably the first send because the other one comes later when `user.save()` finishes. Removing the `console.log(res.send(user))` is the correct fix though.
comment on: http://stackoverflow.com/a/28357750

http://stackoverflow.com/comment/45128736
has text: Why don't you use just one and use CSS to display wherever you want, instead of two html structures? You will have just once the ids, and your submit will not shout.
comment on: http://stackoverflow.com/q/28396244
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/36131064
upvote count: 4
has body: ES6 features trickle down to Node in phases. Node uses Google's V8 as the JavaScript engine. A feature being supported in Node means it first has to be implemented in V8 and then Node team has to incorporate it in Node.js. The team at Google releases a new version of V8 roughly every six weeks, and then it's up to the Node team to take it into use. Manually curated lists of language features are nice but can become outdated quickly. Node 0.12 is not that in flux anymore, but typically manually curated list becomse obsolete as soon as a new version of Node is rolled out. Here are two alternate ways to check what features a Node version supports, without relying on a static list. For further reading and more detailed examples of using these, you can check "How to check if Node.js supports ES 6 language feature" #1 Easy - compatibility table A dynamically generated list that relies on small tests to confirm the presence of a language feature stays better up to date. One such popular list is kangax.github.io/compat-table/es6/. We are interested only in Node features, so you can use http://node.green that leverages the same data as the kangax site. #2 Hard - backtrack V8 version Node uses V8 engine, so determining which version of V8 is included in Node tells us what ES6 language features are supported. You can find out which version of V8 was bundled in Node with node -p process.versions.v8. $ node -p process.versions.v8 4.6.85.31 Then using Google's V8 project resources you can find which features are implemented in each version. The V8 project keeps an issue tracker where you can find ES6+beyond features marked with the harmony label.
answers question: http://stackoverflow.com/q/28388885
downvote count: 0
score: 4
type: Answer

http://stackoverflow.com/comment/44968832
type: Comment
comment on: http://stackoverflow.com/a/28290144
has text: @FelixKling "So of course if that object is mutated, both locations will "contain" the mutated data because there only is a single object. Is that what you were confused about?". Yes, that's it. I was struggling to get my head around it. hassassin, Thanks for the explanation.
type: AnswerComment
score: 0

http://stackoverflow.com/a/28394066
type: Answer
answers question: http://stackoverflow.com/q/28385573
score: 2
has comment: http://stackoverflow.com/comment/57192238
has comment: http://stackoverflow.com/comment/57202238
upvote count: 2
has body: I have got it... it has taken me a few days and in desperation, came here, but didn't give up. Posting the answer in case anyone else needs it, though if anyone has a better way, it would be appreciated. In the destination grid... Basically, in the onMouseEnter, record the details of the cell into a global var, in my case, I wanted to record the RoleName. In the onMouseLeave, set the global var to null. This way, while the mouse is over the cell, I know where I am dropping. However, bear in mind, that if I have a div that I am dragging, the mouse cannot actually be over the div, it has to be outside of it. The destination grid placeholder div is bound... $("#RoleTable-") .bind("drop", function (e, dd) { if (dd.mode != "DragUser") { return; } console.log("Drop in " + dropRow); console.log('Working with ' + dd.grid.getDataItem(dd.row).Username); grid.invalidate(); grid.setSelectedRows([]); }); and through dd.grid.getDataItem(dd.row).Username I get the username from the source grid. (I'm not sure if I need grid.invalidate and grid.setSelectedRows... they are probably just leftovers from the sample I used to get close to what I want). Now, I can get on with the saving... but that is smallfry compared to my frustration with the drop.
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28385573

http://stackoverflow.com/a/28392868
score: 0
type: Answer
has body: var myvar = { F: function(x) { if (x) { this.x = x; // if you are setting the value of x } else { return this.x; // if you want the value of x } } } myvar.F("foo"); // Setter myvar.F(); // "foo" (Getter)
answers question: http://stackoverflow.com/q/28392726

http://stackoverflow.com/comment/45004370
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28312430
type: Comment
has text: Fantastic, that worked. Thank you for your help, really appreciative of your precise and quick answer.

http://stackoverflow.com/comment/45070706
type: QuestionComment
has text: what's your css for the concerning divs?
comment on: http://stackoverflow.com/q/28364655
score: 0
type: Comment

http://stackoverflow.com/comment/45145857
has text: yes that's right but i want to get json data
comment on: http://stackoverflow.com/q/28405677
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44915684
type: QuestionComment
has text: If you Google JavaScript negative zero you'll find lots of posts.
comment on: http://stackoverflow.com/q/28280759
score: 0
type: Comment

http://stackoverflow.com/comment/45129431
score: 0
has text: @Saki A simple config of `Ext.ux` of items can be taken.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28375681

http://stackoverflow.com/comment/45034174
score: 0
has text: that's not an event, it's a readyState. and at the point where scripts are executing you will at least be in domInteractive state anyway
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28344542

http://stackoverflow.com/a/28334542
has comment: http://stackoverflow.com/comment/45221624
score: 4
upvote count: 4
downvote count: 0
answers question: http://stackoverflow.com/q/28325645
type: Answer
has body: You should be calling gapi.auth.signOut() to sign out the user. Disconnect, as you are implementing here, will disconnect the user from your application and de-authorize your application to make API calls on behalf of the user. An example would be: Sign out See Signing out the user for more information on how to correctly sign out a user. Also worth noting: If you are running from localhost, logout may not work. The Sign in callback is also called on failure: make sure to check that the error message is absent to check, i.e: function signinCallback(authResult) { if (authResult['status']['signed_in']) { // Signed in } else { console.log('Sign-in failed: ' + authResult['error']); } }

http://stackoverflow.com/comment/44922273
has text: The whole loop overwrites $supplier each time so **d**, being the last in the loop before carrying on with the rest of the page, is what $supplier is.
score: 3
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28284115

http://stackoverflow.com/a/28412999
has comment: http://stackoverflow.com/comment/45161762
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28412958
type: Answer
has comment: http://stackoverflow.com/comment/45161879
score: 2
type: AcceptedAnswer
has body: Joe Zim's blog explains what it is Tilde(~) is a unary operator that takes the expression to its right performs this small algorithm on it (where N is the expression to the right of the tilde): -(N+1) All numbers except 0 are considered truthy String.indexOf or String.search returns -1 if not found and ~-1 is 0 which is falsey
has comment: http://stackoverflow.com/comment/45161603
downvote count: 0
has comment: http://stackoverflow.com/comment/45161930
answers question: http://stackoverflow.com/q/28412958

http://stackoverflow.com/comment/45169599
comment on: http://stackoverflow.com/a/28417798
score: 1
type: AnswerComment
has text: and I add this enqueue script into the functions.php right? because when I do and change the link to my file it comes up with an error
type: Comment

http://stackoverflow.com/q/28305460
answer count: 1
downvote count: 0
favorite count: 0
has title: Node.js - Nginx 502
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/14044659
tagged with: node.js
has answer: http://stackoverflow.com/a/28306350
score: 1
upvote count: 1
type: Question
tagged with: mongodb
tagged with: nginx
has body: I'm getting a 502 error in my production environment, but not on my local install of my app, for a certain route. I've narrowed the problem down to the callback of the .aggregate() method that I'm querying the database with. This is the callback: function(err,f){ var f = f[0].forms; if(err) console.log(err); if (callback) { res.setHeader('Content-Type', 'text/javascript'); res.send(callback + '(' + JSON.stringify(f) + ')'); } else { res.end("Callback not set"); } } It works for my local install. I'm using this callback to send the object to another source using jsonp. Is there something I'm not doing correctly?
tagged with: javascript

http://stackoverflow.com/comment/44991120
comment on: http://stackoverflow.com/q/28320483
has text: \n/g ?? how should I type it to tmpStyle += "\n"; ?
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/28412765
accepted answer: http://stackoverflow.com/a/28413042
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28412981
has answer: http://stackoverflow.com/a/28412981
score: 0
answer count: 2
has body: I have a very simple app which consists of an input form to POST some data, and a table with a list of items that have already been submitted on the same page. I'm trying to populate this table with the items that have already been added using a $http request upon page load. Currently my index.html is as follows: //input fields //ng-repeat rows As you can see I am currently preloading the data into the table using ng-init, which works, although I believe this is the incorrect way of doing it after reading the documentation. I've looked into loading the data into blacklistTableController using a resolve through routeProvider, although from my understanding (please correct me if I'm wrong) this can't be used to inject data into a controller already on the page, plus there will only be a single route for the whole app at / which seems to defeat the point of using routeProvider.
tagged with: angularjs
has title: Angular: Loading HTTP request data into a controller without ng-init
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28413042
type: Question

http://stackoverflow.com/q/28431366
has answer: http://stackoverflow.com/a/28433763
tagged with: telerik
has body: I was hoping to detect when a Kendo grid's row changes, by navigation as opposed to selecting. By this I mean I would have a grid with selectable: false, in batch edit mode, and I would like to update the data source (in code) when the user tabs to a new row (just as Access does). I have looked at this example and changed the following properties.. selectable: false, navigatable: true, editable: true, Unfortunately the changed event does not when seem to fire for tabs or arrow keys (when in navigation mode). Would anyone know any other way I can do as described above (ie know when we have changed row via navigation) Thanks in advance for any help!
has answer: http://stackoverflow.com/a/28433084
accepted answer: http://stackoverflow.com/a/28433084
score: 2
type: AnsweredQuestion
downvote count: 0
type: Question
has title: Kendo Grid Is there an event for when a row changes (not selected)?
tagged with: kendo-grid
possible better answer: http://stackoverflow.com/a/28433763
tagged with: javascript
upvote count: 2
answer count: 2
favorite count: 0
tagged with: kendo-ui

http://stackoverflow.com/q/28335731
has body: its showing some error in createjs file. its showing the following error console-log:Uncaught TypeError: Failed to execute 'createPattern' on 'CanvasRenderingContext2D': No function was found that matched the signature provided.
type: AnsweredQuestion
score: 0
type: Question
has answer: http://stackoverflow.com/a/28385890
tagged with: javascript
tagged with: easeljs
tagged with: createjs
answer count: 1
has comment: http://stackoverflow.com/comment/45045238
has title: Showing uncaught type error in CreateJS. Not showing any output..my code is given below
accepted answer: http://stackoverflow.com/a/28385890
has comment: http://stackoverflow.com/comment/45045272

http://stackoverflow.com/comment/45006537
type: Comment
has text: @Ben can't you set a global flag on the `errorHandler`, then you execute your js function when the flag is not set inside the 'js' task.
comment on: http://stackoverflow.com/a/28283164
score: 0
type: AnswerComment

http://stackoverflow.com/a/28390661
has comment: http://stackoverflow.com/comment/45118826
upvote count: 1
answers question: http://stackoverflow.com/q/28390357
downvote count: 0
has body: You need to JSON.stringify newSong so that it will be encoded as a JSON body. You also need to declare the right contentType so the service knows to interpret it as JSON. $.ajax({ type: 'POST', data: JSON.stringify(newSong), url: '/songs/addsong', contentType: 'application/json', dataType: 'JSON' }).done(function( response ) { ...checking for errors... });
score: 1
type: Answer

http://stackoverflow.com/comment/44977348
comment on: http://stackoverflow.com/a/28313662
has text: dragging on editor just opens the file in new window
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28436282
has comment: http://stackoverflow.com/comment/45203463
has comment: http://stackoverflow.com/comment/45202881
has comment: http://stackoverflow.com/comment/45202750
type: AnsweredQuestion
upvote count: 0
has body: I am looking to get the results of the number of each number that shows in the results. So if they request for 10 random numbers they can see their numbers and how many of each number there is. Somehow I need the [1, 2, 3, 4, 5, 2, 3, ] to pull in the results.. https://jsfiddle.net/by62764z/6/ function addFields() { var number = document.getElementById("Rando").value; var container = document.getElementById("container"); while (container.hasChildNodes()) { container.removeChild(container.lastChild); } for (i = 0; i &lt; number; i++) { //move arr here var Numbro = Math.floor((Math.random() * 10) + 1); container.appendChild(document.createTextNode(" " + (Numbro))); var input = document.createElement("input"); input.type = "number"; container.appendChild(document.createElement("br")); } } var dataset = [1, 2, 3, 4, 5, 2, 3, ]; function findOccurrences(arr, val) { var i, j, count = 0; for (i = 0, j = arr.length; i &lt; j; i++) { (arr[i] === val) &amp;&amp; count++; } return count; } document.write("one " + findOccurrences(dataset, 1) + "&lt;br&gt;"); document.write("Two " + findOccurrences(dataset, 2) + "&lt;br&gt;"); document.write("Three " + findOccurrences(dataset, 3) + "&lt;br&gt;"); document.write("Four " + findOccurrences(dataset, 4) + "&lt;br&gt;"); document.write("Five " + findOccurrences(dataset, 5) + "&lt;br&gt;"); document.write("Six " + findOccurrences(dataset, 6) + "&lt;br&gt;"); document.write("Seven " + findOccurrences(dataset, 7) + "&lt;br&gt;"); document.write("Eight " + findOccurrences(dataset, 8) + "&lt;br&gt;"); document.write("Nine " + findOccurrences(dataset, 9) + "&lt;br&gt;"); document.write("Ten " + findOccurrences(dataset, 10) + "&lt;br&gt;");
has title: Count the Number of diffrent numbers in results Javascript
linked to: http://stackoverflow.com/q/10541068
has comment: http://stackoverflow.com/comment/45202865
type: Question
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/45207030
has comment: http://stackoverflow.com/comment/45203380
answer count: 1
downvote count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45202662
has answer: http://stackoverflow.com/a/28436750
accepted answer: http://stackoverflow.com/a/28436750
has comment: http://stackoverflow.com/comment/45205088
has comment: http://stackoverflow.com/comment/45202981

http://stackoverflow.com/comment/44990234
type: AnswerComment
has text: This is it. I just did something like this, but I added a class to header, and then checked if header has class `opened` and then reversed the toggle, but your way is more efficient! Thanks! :)
type: Comment
comment on: http://stackoverflow.com/a/28321008
score: 0

http://stackoverflow.com/comment/45155944
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28410898
score: 0
has text: Ah, when I changed from true, to false as you said, the page stopped loading on forever, so I see the need of that. Will read more about addeventlistener, and the javascript basic structure. But Could I ask, is the way I am looking at the popstate, push state, replace state correct? What I asked in the last part of my question? :)

http://stackoverflow.com/q/28350005
tagged with: javascript
favorite count: 0
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/45048362
has body: I want to call a Modal of bootstrap that I have in a partial view in a controller, I use JQuery-Ajax and the JavaScript of Bootgrid enter code here var grid = $("#grid").bootgrid( { ajax: true, url: "/Currency/listCurrencyJson", formatters: { "commands": function(column, row) { return " Star " + " " + " "; } } }).on("loaded.rs.jquery.bootgrid", function () { /* Executes after data is loaded and rendered */ grid.find(".command-edit").on("click", function (e) { alert("You pressed edit on row: " + $(this).data("row-id")); }).end().find(".delete").on("click", function deleteCurrency(id) { $.ajax( { url: '/Currency/createCurrency', type: "POST", data: { "row-id": "row-id" }, success: function() { //alert("Done"); } }); }); });
has answer: http://stackoverflow.com/a/28358182
has title: Call action of Controller in javascript bootgrid
type: UnansweredQuestion
upvote count: 1
downvote count: 1
tagged with: asp.net-mvc-4
type: Question
answer count: 1

http://stackoverflow.com/comment/45012698
has text: When the index of slide change, the $EVT_PARK will fire.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28318106
type: Comment

http://stackoverflow.com/q/28411420
upvote count: 1
has title: javascript - Handling redirect from http response
tagged with: javascript
has answer: http://stackoverflow.com/a/28411575
tagged with: httprequest
type: Question
answer count: 1
downvote count: 0
favorite count: 0
tagged with: httpresponse
has body: I am trying to build a html page that when I enter it, it will redirect me to another page, depending on an attribute in the session. If there is an attribute named "username" in the session, it will not redirect me, and otherwise it will. In order to do so, I wrote a javascript function that calles a java servlet that checks whether or not the attribute exists. &lt;script type="text/javascript"&gt; var req = new XMLHttpRequest(); req.onreadystatechange = function() { if (req.readyState == 4) { var data = req.responseText; } document.write(req.readyState); } req.open('POST','sessionCheck',true); req.send(null); &lt;/script&gt; The code in the servlet is: protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { HttpSession hs = request.getSession(); String username = (String) hs.getAttribute("username"); if (username == null) response.sendRedirect("/login.html"); } I know that the resonse did send the redirect but the webpage was not redirected. *Note: I am using Eclipse Java EE for Web Developers. Thanks!
has comment: http://stackoverflow.com/comment/45156548
type: UnansweredQuestion
score: 1
tagged with: http-redirect

http://stackoverflow.com/q/28305417
favorite count: 0
has comment: http://stackoverflow.com/comment/44962016
has comment: http://stackoverflow.com/comment/44962089
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44962111
has title: Iterate with JQuery to a table except the first column
score: 1
has answer: http://stackoverflow.com/a/28305453
accepted answer: http://stackoverflow.com/a/28305453
upvote count: 1
type: Question
has body: I want to call a function for every cell in a table except the first column. Until now, I have the following code: &lt;script type="text/javascript"&gt; $("#resultstable tr").each(function () { $('td', this).each(function () { ....do my staff... }) }) &lt;/script&gt; This apply the function to every cell in my table. If I change the code to this, I thought that it will work, but it doesn't. &lt;script type="text/javascript"&gt; $("#resultstable tr").each(function () { $('td :not(:first-child)', this).each(function () { ....do my staff... }) }) &lt;/script&gt;
tagged with: javascript
has comment: http://stackoverflow.com/comment/44962066
answer count: 1
downvote count: 0
tagged with: jquery

http://stackoverflow.com/a/28332180
type: Answer
accepted answer of: http://stackoverflow.com/q/28332050
has body: removeEventListener takes a second parameter, the specific callback Function you want to remove. So in your case you can do what you want by passing someFunction in to the call, it will not remove other handlers. window.addEventListener('scroll', someFunction, false); window.removeEventListener('scroll', someFunction, false);
answers question: http://stackoverflow.com/q/28332050
upvote count: 4
type: AcceptedAnswer
downvote count: 0
score: 4

http://stackoverflow.com/a/40308987
type: Answer
has body: It won't work since you specified "async: false", signalling the browser to use the same ui thread. ajaxStart/ajaxStop methods will never have a chance to run. You should most likely remote the sync option to achieve what you need.
answers question: http://stackoverflow.com/q/28351151
score: 0

http://stackoverflow.com/q/28412000
answer count: 4
type: AnsweredQuestion
downvote count: 0
has title: javascript text field counter display
score: 1
has answer: http://stackoverflow.com/a/28412063
type: Question
has answer: http://stackoverflow.com/a/28412111
accepted answer: http://stackoverflow.com/a/28412111
tagged with: javascript
has answer: http://stackoverflow.com/a/28412190
has body: I'm using an answer given here Count textarea characters but need to modify it to count down characters in a text field input AND change colour as it hits certain count down numerical limits, to give the user some form of warning they are approaching the field limitation. This is what I have put together so far, on my own. It actually works! (Amazingly). First, this is what I started with: $(window).load(function() { $("#input_4_1").keyup(function() { $("#count_4_1").text("Characters remaining: " + (2550 - $(this).val().length)); }); }); And this is what I have re-invented it as: $(window).load(function() { $("#input_4_1").keyup(function() { if (2550 - $(this).val().length >= 501) { $("#count_4_1").text("Characters remaining: " + (2550 - $(this).val().length)); } else if ((2550 - $(this).val().length <= 500) && (2550 - $(this).val().length >= 101)) { $("#count_4_1").text("Characters remaining: " + (2550 - $(this).val().length) + ""); } else if (2550 - $(this).val().length <= 100) { $("#count_4_1").text("Characters remaining: " + (2550 - $(this).val().length) + ""); } }); }); And this is what amazingly works. With one exception - and here comes the question. I know next to nothing about JS. When the character number read-out is between 2550 and 500 the display if fine. When the character read-out becomes 500 to 100 the read-out shows: Characters remaining: 499 So how do I get the JS to actually kick the css into proper display effect, instead of simply echoing out on the page?? If relevant, jQuery is in use.
possible better answer: http://stackoverflow.com/a/28414750
upvote count: 1
linked to: http://stackoverflow.com/q/14086398
has answer: http://stackoverflow.com/a/28414750
tagged with: jquery
favorite count: 0

http://stackoverflow.com/q/28357898
has title: How to get number of day between two text box in javascript?
type: UnansweredQuestion
score: -4
has answer: http://stackoverflow.com/a/28357966
has body: I want to get number of day between two text boxes but how do I convert from date to integer by using JavaScript? &lt;script type="text/javascript"&gt; function calc(a,b,sub) { var one = parseInt(a); if (isNaN(one)) { alert('Invalid entry: '+a); one=0; } var two = parseInt(document.getElementById(b).value); if (isNaN(two)) { alert('Invalid entry: '+b); two=0; } document.getElementById(sub).value =two-one; } &lt;/script&gt; HTML &lt;input type="text" name="Itm_1" id="datepicker1" onchange="calc(Date.parse(this.value),'datepicker1','result')" required="" style="width:205px;" placeholder="&lt;?php echo Date(" d/m/Y ");?&gt;"/&gt; &lt;input type="text" name="Itm_2" id="datepicker2" onchange="calc(Date.parse(this.value),'datepicker2','result')" required="" style="width:205px;" placeholder="&lt;?php echo Date(" d/m/Y ");?&gt;"/&gt; &lt;textarea name="Itm_3" id="result" id="result" cols="30" rows="5" style="height:50px;" value="" readonly=""&gt;&lt;/textarea&gt;
has comment: http://stackoverflow.com/comment/45059022
has comment: http://stackoverflow.com/comment/45059381
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45059056
has comment: http://stackoverflow.com/comment/45059078
downvote count: 4
upvote count: 0
answer count: 1
favorite count: 0

http://stackoverflow.com/q/28362806
has answer: http://stackoverflow.com/a/28363409
accepted answer: http://stackoverflow.com/a/28363409
score: 0
tagged with: google-visualization
tagged with: javascript
has comment: http://stackoverflow.com/comment/45068634
has comment: http://stackoverflow.com/comment/45068444
has comment: http://stackoverflow.com/comment/45067804
has body: Hey stackoverflow community, I'm trying to render a Column Chart using google.visualizations.ChartWrapper but I am unable to get the following javascript code to work: google.load('visualization', '1', {packages: ['corechart','controls']}); google.setOnLoadCallback(drawDashboard); function drawDashboard() { var data = google.visualization.DataTable(); data.addColumn('string', 'Element'); data.addColumn('number', 'FillRate'); data.addRows([['Tank11Chocolate', 100.0],['Tank20Gold', 50.0]]); var chart = new google.visualization.ChartWrapper({'chartType': 'ColumnChart','containerId': 'colChart','dataTable': data}); chart.draw(); } Could someone with perhaps more knowledge of Google Visualizations or javascript help me out please?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45068557
has title: Can't render Google Visualizations ChartWrapper
type: Question
answer count: 1

http://stackoverflow.com/q/28348220
type: AnsweredQuestion
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45040673
type: Question
tagged with: slideshow
tagged with: javascript
has body: I'm working on a simple sort of slideshow with next and previous buttons to navigate. The way I set this up is having a container with 7 slides in it that all have the same size as the container and with with left are positioned 100%, 200%, etc. The buttons animate the marginLeft to go to the next or previous slide. $('#slideArrowRight').click(function(){ var allSlides = $(this).siblings('.slideContainer'); var slideWidth = allSlides.width(); var maxSlides = $('.slideContainer').length - 1; var maxWidth = maxSlides * slideWidth; var negative = 0 - maxWidth; if (parseFloat($(allSlides).css('marginLeft')) &lt;= negative) {} else { $(allSlides).animate({marginLeft: "-=" + (slideWidth) + "px"}, {duration:200}); } }); I'm using an if statement to check if the maximum amount of marginLeft is reached so it can't go further. That's what I came up with. and gues what the thing actually works xD (pretty new to javascript and jQuery so yeah i get exited if stuff starts working) But if I click the buttons really fast, it gets pased the last slide as the function stacks in the queue. and the maximum marginLeft is not reached at the moment of the click. So my question is how can i get it so that the function can not run except if the function is finished? I try'd .finish() but that instantly cancels the animation and is not what I'm looking for. i mainly want it so that the function can not execute unless the function is not in the queue.
tagged with: jquery
has title: click needs to finish before activating again
has comment: http://stackoverflow.com/comment/45041187
has comment: http://stackoverflow.com/comment/45041309
upvote count: 1
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45040771
has answer: http://stackoverflow.com/a/28348809
accepted answer: http://stackoverflow.com/a/28348809

http://stackoverflow.com/comment/53462326
type: AnswerComment
comment on: http://stackoverflow.com/a/31817074
type: Comment
score: 2
has text: Are you kidding me? This is absolutely awesome. it never ceases to amaze me how kind some people are! I would mark this as the answer if I could. Thank you, kind stranger!

http://stackoverflow.com/q/28304836
has body: I have an existing SPA that I'm migrating to angular 1 view at time. I can't change the router. I'm loading a view like this then boot strapping it: loadView("views/view1.htm", function(view) { myDiv.innerHTML = view; angular.bootstrap(myDiv, [‘MyApp']); }); Obviously because this is a single page app this only works once. This need to integrate the the rest of the SPA so myDiv.innerHTML is constantly replaced. Should I destroy my App each time I switch views? If so how it this done? Many Thanks
score: 0
tagged with: angularjs
has title: AngularJS with own custom router
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/44962134
has comment: http://stackoverflow.com/comment/44969848
type: Question
tagged with: javascript

http://stackoverflow.com/comment/45012600
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28332800
score: 0
has text: how bout removing the other buttons on clicking the register button? OR have the register button in a different formset?

http://stackoverflow.com/comment/44956312
type: AnswerComment
has text: @ Elgringorrible updated answer with extremly crude code but it doesn't show it extended straight away, if it's been set to display none, whether thats by jquery or css then it would need to be set to display block or inline or whatever to be shown extended again
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28301675

http://stackoverflow.com/comment/45047115
type: QuestionComment
has text: the real question is, why are your trying to achieve this.. what's the real issue you're having? and by `body`.. are you referring to `document.body`. or do you mean the container of whatever 'popup' the about button invokes?
comment on: http://stackoverflow.com/q/28351258
score: 0
type: Comment

http://stackoverflow.com/q/28323176
has comment: http://stackoverflow.com/comment/44997983
has comment: http://stackoverflow.com/comment/45013130
has comment: http://stackoverflow.com/comment/44997990
has comment: http://stackoverflow.com/comment/44995177
has comment: http://stackoverflow.com/comment/44994237
has comment: http://stackoverflow.com/comment/44994870
type: Question
has comment: http://stackoverflow.com/comment/44995693
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45007420
has comment: http://stackoverflow.com/comment/45004340
has comment: http://stackoverflow.com/comment/44995357
has title: Get value before/after submit from javascript
answer count: 0
type: UnansweredQuestion
tagged with: asp.net-mvc-4
tagged with: model-view-controller
tagged with: asp.net-mvc
has body: I've a simple form. The form includes a javascript rich editor. All my input-controls use a model except the javascript editor. @using (Html.BeginForm("Edit", "Account", FormMethod.Post)) { @Html.TextBoxFor(x => x.Username) @Html.ValidationMessageFor(x => x.Username) @Html.TextBoxFor(x => x.Firstname) @Html.ValidationMessageFor(x => x.Firstname) } After the user writes something into the editor it contains it's content. HALLO WORLD There is also an jQuery function $(".rich-text-editor").code I'm looking for a way to get the content into the controller without a separated ajax call. Is there any possibility.

http://stackoverflow.com/q/28340449
has comment: http://stackoverflow.com/comment/45025910
has comment: http://stackoverflow.com/comment/45026295
has answer: http://stackoverflow.com/a/28341220
score: 2
has comment: http://stackoverflow.com/comment/45026812
downvote count: 0
tagged with: forms
has comment: http://stackoverflow.com/comment/45026057
has comment: http://stackoverflow.com/comment/45028277
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/45027373
has comment: http://stackoverflow.com/comment/45026030
has title: Send Javascript array when submitting form with Javascript
tagged with: javascript
has answer: http://stackoverflow.com/a/28340627
has comment: http://stackoverflow.com/comment/45026245
tagged with: http://stackoverflow.com/tag/html
has body: So I would like to submit the form using Javascript, and with the form I would like to send also one Javascript array. So far I have this which is not working (I don't get the modified URL and I get the one specified in the action property of the form): &lt;script&gt; function submit_form() { var unique_id_to_delete = []; if (confirm('Remove records ID: ' + unique_id_to_delete.toString() + '?')) { document.getElementById("submit_form").submit(function(event) { event.preventDefault(); var url = 'submit.php?id_delete='+unique_id_to_delete.toString(); window.location.href = url; }); } else { alert('Ok, next time!'); } } &lt;/script&gt; Form: &lt;form id="submit_form" method="post" action="submit.php" enctype="multipart/form-data"&gt; &lt;input type="button" onclick="submit_form();" value="Submit"/&gt; &lt;/form&gt;
answer count: 4
favorite count: 0
has answer: http://stackoverflow.com/a/28341323
type: UnansweredQuestion
tagged with: php
has answer: http://stackoverflow.com/a/28343093

http://stackoverflow.com/a/28325888
type: Answer
accepted answer of: http://stackoverflow.com/q/28325453
score: 2
answers question: http://stackoverflow.com/q/28325453
downvote count: 0
upvote count: 2
has body: Just accumulate the probabilities and return an item for which current_sum &gt;= random_number: probs = [0.41, 0.29, 0.25, 0.05]; function item() { var r = Math.random(), s = 0; for(var i = 0; i &lt; probs.length; i++) { s += probs[i]; if(r &lt;= s) return i; } } // generate 100000 randoms a = []; c = 0; while(c++ &lt; 100000) { a.push(item()); } // test actual distibution c = {} a.forEach(function(x) { c[x] = (c[x] || 0) + 1; }); probs.forEach(function(_, x) { document.write(x + "=" + c[x] / a.length + "&lt;br&gt;") });
type: AcceptedAnswer

titanium-alloy
tags question: http://stackoverflow.com/q/28422362
tag name: titanium-alloy
tags question: http://stackoverflow.com/q/28399311
type: Tag

http://stackoverflow.com/comment/44957137
has text: Just as a side, is there a reason you aren't using the ember-cli?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28300302

http://stackoverflow.com/q/28303918
has body: Yesterday I posted a question about getting highcharts.JS to handle an issue when XML data was pushed to it. I didn't go very in depth so I think the answer I got was a bit off so I am going to try and re-post it today and see if I can get an answer more suited to my issue I have a Quickbase application that is being graphed to a highchart.js graph using XML data from an API call. The XML data is a table query bringing back record data from 14 fields. In those fields the data can range from .001 to 99.99, HOWEVER some of them will be blank from time to time producing an array of {NaN,NaN,NaN}, When that series is pushed into the graph it makes the whole graph blank until you de-select that option It was suggested yesterday that Highcharts has a built in "nodata" function, however the only way I could find it explained was when there was an instance that there was absolutely no data being provided to the graph (in which case it showed on the graph "No Data", but that is not what I am looking for as there will always be at least one (usually at least five, but for simplicity sake I will say one) field having data. Here is the code I am currently using Graph and here is the XML output from the API call API_DoQuery 0 No error RESULT <desc/> Carbon Dioxide methane <sample_date>1386892800000</sample_date> 0.002 0.114 <oxygen/> <hydrogen_sulfide/> 1.926 0.454 82.163 6.353 4.760 <iso_butane>0.618</iso_butane> <n_butane>1.819</n_butane> <iso_pentane>0.491</iso_pentane> <n_pentane>0.544</n_pentane> <hexanes_>0.756</hexanes_> <update_id>1408654196361</update_id> <sample_date>1383782400000</sample_date> 0.006 0.038 <oxygen/> <hydrogen_sulfide/> 0.512 0.844 83.178 8.678 3.631 <iso_butane>0.493</iso_butane> <n_butane>1.097</n_butane> <iso_pentane>0.342</iso_pentane> <n_pentane>0.371</n_pentane> <hexanes_>0.810</hexanes_> <update_id>1408981434690</update_id> <sample_date>1369699200000</sample_date> 0.004 0.060 <oxygen/> <hydrogen_sulfide/> 1.684 0.443 77.742 10.430 6.842 <iso_buta…
has comment: http://stackoverflow.com/comment/44959126
tagged with: highcharts
tagged with: javascript
tagged with: jquery
type: Question
has answer: http://stackoverflow.com/a/28304088
tagged with: http://stackoverflow.com/tag/xml
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/44959334
accepted answer: http://stackoverflow.com/a/28304088
has comment: http://stackoverflow.com/comment/44959183
has comment: http://stackoverflow.com/comment/44959433
has title: Testing for NaN in a JS array?
type: AnsweredQuestion

http://stackoverflow.com/comment/45050046
type: Comment
has text: I saw that, but to me it doesn't appear to be the source of the problem. I'm not sure why it occurs though. If `exporting` was in fact `false` I guess the export menu shouldn't be showing?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28332912

http://stackoverflow.com/comment/44999266
comment on: http://stackoverflow.com/q/28325699
type: Comment
type: QuestionComment
score: 0
has text: can you set a breakpoint in the debugger and use the console in devoloper tools to explore the collection?

http://stackoverflow.com/q/28386310
upvote count: 2
type: UnansweredQuestion
has title: Pure JavaScript add listener to new element loaded
has comment: http://stackoverflow.com/comment/45110456
has comment: http://stackoverflow.com/comment/45110425
has comment: http://stackoverflow.com/comment/45110287
has comment: http://stackoverflow.com/comment/45110592
linked to: http://stackoverflow.com/q/11179841
downvote count: 2
type: Question
has comment: http://stackoverflow.com/comment/45111057
tagged with: javascript
has body: I want idea about add listener to new element via AJAX: For example, now I have hello world I added a listener to every , but when I load new element via AJAX, it didn't have the listener; I'm not entirely sure what the problem could be. Is it that it doesn't call the function when a new element is loaded and add listener for all of the elements? I know that in jQuery, we can use $("class").on(), but how do I use pure JavaScript?
score: 0
has comment: http://stackoverflow.com/comment/45110549
answer count: 1
has comment: http://stackoverflow.com/comment/45110638
has answer: http://stackoverflow.com/a/28386706
favorite count: 0

http://stackoverflow.com/a/65599037
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28349539
has body: I was able to reset my non-multi selectpicker to the noneSelectedText with the following. It even works if you change the noneSelectedText. $('.selectpicker').selectpicker('val', 'Nothing Selected').selectpicker("refresh");

http://stackoverflow.com/q/28414185
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45161720
has answer: http://stackoverflow.com/a/28414853
has comment: http://stackoverflow.com/comment/45162511
type: AnsweredQuestion
score: -5
has comment: http://stackoverflow.com/comment/45161760
has comment: http://stackoverflow.com/comment/45161959
tagged with: image
accepted answer: http://stackoverflow.com/a/28414853
has body: I'm creating a website for fun, one of the pages is a feedback page. On here I have many containers, inside each other and with different things in them. I wanted to create a star-based feedback rating, I have two images, one is an empty star and the other is a filled star. On first look the star is empty and I want it to change to the filled star, which I have done! Now, when trying to change multiple images, I can't seem to find a way to do it. For example, is someone is leaving a four star rating, I want the all the stars to the left and including the clicked star to change to the other image. Here is my HTML for the images: &lt;img src="star.png" width="20px" height="20px" id="1" onclick="change();"&gt; &lt;img src="star.png" width="20px" height="20px" id="2" onclick="change();"&gt; &lt;img src="star.png" width="20px" height="20px" id="3" onclick="change();"&gt; &lt;img src="star.png" width="20px" height="20px" id="4" onclick="change();"&gt; &lt;img src="star.png" width="20px" height="20px" id="5" onclick="change();"&gt; And here is my JavaScript to change one image only: &lt;script type="text/javascript"&gt; function change() { var image1 = document.getElementById('1'); image1.src = "filledStar.png"; } So if I click on the fifth image I want all of the images to change, and if I click on the fourth most right image I want that image and all of the images to the left to change etc etc.
type: Question
upvote count: 0
downvote count: 5
tagged with: javascript
tagged with: jquery
has title: How can I create a star based feedback system for a website?
linked to: http://stackoverflow.com/q/2921157

http://stackoverflow.com/q/28359909
has answer: http://stackoverflow.com/a/28359954
has body: When I declare JS. var test = $("#test").val(); Then the "number validaion" is not working on the browser side. &lt;input type="number" id="test" name="test" required&gt; Is there any chance to declare $("#test") and use HTML5 in input validation as well (such as required, number validation etc.)? Or I have to to do it on JS side. It have to be declared to use it later in my AJAX post scipt. Thanks :)
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45062774
possible better answer: http://stackoverflow.com/a/28359954
has title: HTML5 + JavaScript, type of input
type: Question
accepted answer: http://stackoverflow.com/a/28359926
tagged with: javascript
has comment: http://stackoverflow.com/comment/45062738
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28359926
has comment: http://stackoverflow.com/comment/45062612
has answer: http://stackoverflow.com/a/28359996

http://stackoverflow.com/comment/45094459
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28377073
score: 0
has text: forgot add function EventTarget

http://stackoverflow.com/a/28377564
score: 41
type: Answer
has body: Use indexOf() to get the position of each element in the reference array, and use that in your comparison function. var reference_array = ["ryan", "corbin", "dan", "steven", "bob"]; var array = ["bob", "dan", "steven", "corbin"]; array.sort(function(a, b) { return reference_array.indexOf(a) - reference_array.indexOf(b); }); console.log(array); // ["corbin", "dan", "steven", "bob"] Searching the reference array every time will be inefficient for large arrays. If this is a problem, you can convert it into an object that maps names to positions: var reference_array = ["ryan", "corbin", "dan", "steven", "bob"]; reference_object = {}; for (var i = 0; i &lt; reference_array.length; i++) { reference_object[reference_array[i]] = i; } var array = ["bob", "dan", "steven", "corbin"]; array.sort(function(a, b) { return reference_object[a] - reference_object[b]; }); console.log(array);
downvote count: 0
upvote count: 41
has comment: http://stackoverflow.com/comment/45166563
has comment: http://stackoverflow.com/comment/45163294
answers question: http://stackoverflow.com/q/28377495
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28377495

http://stackoverflow.com/a/28394990
answers question: http://stackoverflow.com/q/28394934
score: 0
has body: getElementsByClassName returns a node list (which is like an array) not an element. If you want to do something to every element in the node list, then you have to loop over it and do the thing on each item in the list. var node_list = document.getElementsByClassName('Button'); for (var i = 0; i &lt; node_list.length; i++) { node_list[i].checked = false; }
type: Answer

http://stackoverflow.com/a/28368217
type: Answer
accepted answer of: http://stackoverflow.com/q/28368157
answers question: http://stackoverflow.com/q/28368157
upvote count: 1
score: 1
has body: The parent labels add another branch, causing nextAll to not find it. nextAll() only looks at sibling elements under the same parent. try this: $('#Email').closest('label').next().find('input').first().focus(); As focus() will only target the first element in a set anyway, the first() is not required: $('#Email').closest('label').next().find('input').focus();
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/28336613
score: 1
type: Answer
upvote count: 2
has body: Add this to your element, as seen in this answer: .ClassName, .ClassName:focus { -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; outline-style:none;/*IE*/ }
downvote count: 1
answers question: http://stackoverflow.com/q/28336581
has comment: http://stackoverflow.com/comment/45019529

http://stackoverflow.com/comment/55958838
score: 0
has text: Your answer gets bumped up in the "active" queue after an edit, just saying.
type: AnswerComment
comment on: http://stackoverflow.com/a/33730390
type: Comment

http://stackoverflow.com/a/61963394
has body: Writing this answer for anyone who might get stuck on this recently. There are basically three parts of this problem:- What is your action method returning in case the code breaks on the server. This is what I returned for the Kendo ui to recognize that there was an error on the server:- return Json(new { error = String.Format("Error message.") }); Please note that if your JSON is not returned in the correct format from the server, kendo will not recognize that code broke. How are you handling the error on the front end. If you are using new kendo.data.DataSource In that case you use the error property and assign that to a function like below:- var cloudStore = new kendo.data.DataSource({ //other properties here //error property below error: function (e) { //since an error has occured, we are below removing the object we added to the grid $("#cloudGrid").each(function (item) { var grid = $(this).data("kendoGrid"); if (e.sender === grid.dataSource) { grid.cancelChanges(); } }); //opening a popup to show the error message alert(e.errors); } )}; Kendo updates the grid on the frontend even before the object is actually updated on the backend, so in case an error occurs on the server, we have the update the grid accordingly. For that, notice my code above and see the each loop. That is where the grid is being reverted to its previous stage.
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28317620

http://stackoverflow.com/a/28400124
has body: You can try to do a infinity loop incrementally appending a string as the app starts: onDeviceReady: function() { var test = "test"; while (true) { test += "--------------------"; console.log(test); } }, This will do the trick.
type: Answer
has comment: http://stackoverflow.com/comment/45182466
has comment: http://stackoverflow.com/comment/47671133
upvote count: 3
score: -1
downvote count: 4
answers question: http://stackoverflow.com/q/28340920

http://stackoverflow.com/a/28410210
has body: Instead of: document.logform.store.options[document.logform.store.selectedIndex].name Use: document.logform.store.options[document.logform.store.selectedIndex].text Notice that just .name at the end was replaced by .text. Working Code Snippet: Philadelphia Source
accepted answer of: http://stackoverflow.com/q/28410088
has comment: http://stackoverflow.com/comment/45154105
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45153896
downvote count: 0
answers question: http://stackoverflow.com/q/28410088
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/a/28370576
has comment: http://stackoverflow.com/comment/45098857
type: Answer
score: 4
has comment: http://stackoverflow.com/comment/45161523
has body: In this response I created a data array for test since aData array is unknown for us, so array initialization: var aData =[]; // Just for test purpose, you can provide your own data function initTestData(max){ var i = 0, emp = []; for(i; i < max; i++){ emp[0] = "https://t1.gstatic.com/images?q=tbn:ANd9GcTGBDXFOEElnYoEZkYStOBIT_sogGr6zUG44opA4mq7Pf0SgevkGIMjSKmw6oktM4HK5NaKcWuQLA"; emp[1] = "Emp-"+i; aData[i] = emp; emp = []; } } and I modified your generateIDCardForPrint function to fit with what you asked: function generateIDCardForPrint() { // Card model holder var idCardElement = $("#idCard"); // Data rows count var tablerows = aData.length;//$('#tblPrintCards tr').size(); /** Finding how many rows */ var tblTr = (tablerows / 2); var t = $(' '); t.css("width", "100%"); for(var i= 0; i < tblTr; i++){ var row = $(' '); for( var j=0; j < 2; j++){ if(i * 2 + j < tablerows){ var td = $(' '); var ImageID = aData[i * 2 + j][0]; var images = new Image(); var empImages = $('.photoBox', idCardElement); var empName = $('.detailBox > label > strong', idCardElement); images.src = ImageID; images.id = "EmpImage"; empImages.html(images); empImages.find('img').each(function(a){$(this).css({height: "80px", width: "80px"})}); empName.text(aData[i * 2 + j][1]);//Hello HTML var HtmlContent = idCardElement.html(), Card = $(' ').attr("id","idCard").html(HtmlContent); td.html(Card); td.css("align", "left"); row.append(td); } } t.append(row); } var cssStyle= "*,body,html{box-sizing:border-box}body{margin:50px}.clear{clear:both}#idCard{width:310px;padding:10px;border:2px solid #000;box-sizing:border-box;font-family:Arial,Helvetica,sans-serif}#idCard label{display:block;font-size:13px;margin:0 0 5px}#idCard .photoBox{width:80px;height:60px;background:#306;float:right;border:0 solid red}#idCard .detailBox{width:150px;height:60px;margin:0;border:0 solid red;float:right;padding:15px 0 0}"; var myWindow = window.open("", "MsgWindow", "width=1256, height=300"); myWindow.document.write(' Print …
answers question: http://stackoverflow.com/q/28367172
upvote count: 4
accepted answer of: http://stackoverflow.com/q/28367172
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/28292962
has comment: http://stackoverflow.com/comment/44987127
has comment: http://stackoverflow.com/comment/44987087
has comment: http://stackoverflow.com/comment/44951085
has comment: http://stackoverflow.com/comment/44978453
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/44987462
upvote count: 2
answers question: http://stackoverflow.com/q/28285190
has comment: http://stackoverflow.com/comment/44969214
score: 2
has body: You can use formatter in tooltip and plotOptions.series.dataLabels and use this.point.high and this.point.low to get the high and low of the serie and calculate the average: formatter : function() { var res = ""; if(this.point.high == this.y) res += "Average: " + (this.point.high + this.point.low)/2 + "&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;"; res += this.y; return res; } Here's the DEMO EDIT: You cannot add another dataLabel in your chart. But, I managed to add the Average to one of your dataLabels and then using jQuery I changed it's position considering the amount of each average: $.each($( "tspan:contains('Average')" ), function(i, t) { t.setAttribute('dy', parseInt(t.textContent.slice(9))/135); }); Please see this DEMO

http://stackoverflow.com/comment/45120526
type: QuestionComment
type: Comment
has text: Personally I suggest you use `ui-route` which can inject $http into template loading by default.
comment on: http://stackoverflow.com/q/28390546
score: 0

http://stackoverflow.com/q/28282906
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
has title: select options are not being shown using d3.js?
type: AnsweredQuestion
score: 1
has body: I am trying to show the names of few detectors in a combobox using d3.js. I used the following code to show the data. d3.csv("Results_New.txt", function(data) { //var data = d3.csv.parseRows(datatext); d3.select("#road").selectAll("option") .data(data).enter().append("option").text(function(d){return d.detector-id;}).attr("value",function(d){return d.detector-id;}); But the values are not being shown in the output combobox. Rather the combox options are showing blank space. Can anyone give me the idea how can the values be shown? Is it mandatory to put the combobox within a SVG?
accepted answer: http://stackoverflow.com/a/28283463
upvote count: 1
type: Question
downvote count: 0
tagged with: javascript
answer count: 1
has answer: http://stackoverflow.com/a/28283463
tagged with: combobox

http://stackoverflow.com/comment/45018701
has text: What is the problem with using `ng-include`
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28336153

http://stackoverflow.com/a/28389034
accepted answer of: http://stackoverflow.com/q/28388980
has body: Try this: $('#submitButton').click(function() { var userSpeed = +$('#inputBox').val(); if (!userSpeed) {userSpeed == 500}; $("#ball").circulate({ speed: userSpeed, height: 500, width: 200, loop: true, zIndexValues: [1, 1, 1, 1] }); }); Then, when the user clicks on the submit button, your code gets the new value and sets the speed for the function. If the user clicks the button without having entered a number, a default speed is used.
has comment: http://stackoverflow.com/comment/45136975
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45136659
answers question: http://stackoverflow.com/q/28388980
score: 0
type: Answer

http://stackoverflow.com/q/28399590
has body: I just want to go to a URL in my noty object is clicked (not when it's closed, only when the user clicks the notification). I tried this: var n = noty({ text: 'Nuevo Comentario: &lt;br&gt;' + data.contenido + ' de ' + data.usuario, layout: 'bottomRight', type: 'information', timeout: 3500, callback: { onClose: function() { /* Go to the URL i want to go */ }}, animation: { open: {height: 'toggle'}, // jQuery animate function property object close: {height: 'toggle'}, // jQuery animate function property object easing: 'swing', // easing speed: 500 // opening &amp; closing animation speed } }); but the event is triggered even when it closes by itself. How can I check for when the user clicks on the notification?
upvote count: 1
type: Question
tagged with: javascript
tagged with: jquery
has title: How to add event onClick in noty for notifications in jQuery?
has answer: http://stackoverflow.com/a/57770014
answer count: 1
downvote count: 0
score: 1
favorite count: 0
type: UnansweredQuestion
tagged with: noty
has comment: http://stackoverflow.com/comment/45134981

http://stackoverflow.com/comment/44948552
comment on: http://stackoverflow.com/a/28297650
type: Comment
has text: -- The format separator does not match The format separator does not match -- if i convert eloquent ->toArray()
type: AnswerComment
score: 0

http://stackoverflow.com/a/28317114
has body: If anyone need this i figured out to achieve what i would like to do using requireJS, doing something like this : in /script/controllers/HeaderCtrl.coffee define [], () -&gt; class HeaderCtrl constructor: (@ref) -&gt; I declare a module with no dependencies in /scripts/main.coffee requirejs.config baseUrl: 'scripts' paths: HeaderCtrl: 'controllers/HeaderCtrl require ['HeaderCtrl'], (HeaderCtrl) -&gt; instance = new HeaderCtrl() I pass it in requiresjsconfig and call it just after. P.S Care when you include requirejs lib it must be the last file that you include in dom
type: Answer
answers question: http://stackoverflow.com/q/28309871
score: 0

http://stackoverflow.com/comment/45074837
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28366798
has text: You're calling `next()` right after `res.send(data)`. After calling `send` you already sent the response, so there's no need to call `next`.

cryptography
tag name: cryptography
tags question: http://stackoverflow.com/q/28364430
type: Tag
tags question: http://stackoverflow.com/q/28293008

http://stackoverflow.com/q/28371835
has title: Passing file through ajax in laravel
tagged with: ajax
has comment: http://stackoverflow.com/comment/45084408
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45092117
tagged with: php
tagged with: laravel
has comment: http://stackoverflow.com/comment/45084704
linked to: http://stackoverflow.com/q/27584527
answer count: 0
has body: I'm trying to upload an image through ajax in laravel. I have this code for the ajax. $("#stepbutton2").focus(function(){ var formData = new FormData($("#form1")); $.ajax({ url: '/nominations/upload/image', data: formData, processData: false, contentType: false, type: 'POST', success: function(data){ alert(data.url); }, error: function(err){ alert(err); } }); }); and php file: public function image(){ $file = Input::file('largeImage'); $ext = $file-&gt;getClientOriginalExtension(); $newName = md5(time()).".$ext"; $path= "uploads/{$this-&gt;getDate()}"; $file-&gt;move($path, $newName); $imageUrl = $path.'/'.$newName; return Response::json(["success"=&gt;"true", "url"=&gt;$imageUrl]); } #stepbutton2 is a button type and not submit. I'm getting the alert [Object object] but it should be the uploaded URL. The markup is something like: &lt;form id='form1'&gt; &lt;input type='file' id='largeImage' name='largeImage'&gt; &lt;input type='button' id='stepbutton2'&gt; &lt;/form&gt; where did I go wrong? I need to use this url to populate another field in the same form and continue filling the form to the next steps.
has comment: http://stackoverflow.com/comment/45084568
has comment: http://stackoverflow.com/comment/45084439
type: Question
has comment: http://stackoverflow.com/comment/45084224
has comment: http://stackoverflow.com/comment/45084795
has comment: http://stackoverflow.com/comment/45084357
tagged with: javascript
has comment: http://stackoverflow.com/comment/45086565
tagged with: jquery
score: 0
linked to: http://stackoverflow.com/q/14495296

http://stackoverflow.com/q/28360386
upvote count: 2
has title: OrientDB: Accessing query result data in Server side function
accepted answer: http://stackoverflow.com/a/28371513
has body: OrientDB allowes to create server side javascript functions. Is there any way to access intermediate query results inside server side javascript function. Eg. If I return query results, I get json response array as expected. But if I try to access query result inbetween function like: var comps = db.query("SELECT code from Company"); db.begin(); for(var i=0; i&lt;comps.length; i++){ var c = comps[i]; db.save({ "@class":"Temp", col: c.code }); } db.commit(); return comps; For above function I get blank values stored in column "col". As per my observation, OrientDb returns context instead of actual results inside the function. Thanks in advance.
tagged with: javascript
has answer: http://stackoverflow.com/a/28360746
score: 2
type: AnsweredQuestion
downvote count: 0
possible better answer: http://stackoverflow.com/a/28360746
favorite count: 0
has answer: http://stackoverflow.com/a/28371513
type: Question
answer count: 2
tagged with: orientdb

http://stackoverflow.com/a/45267239
answers question: http://stackoverflow.com/q/28420080
has comment: http://stackoverflow.com/comment/77498789
score: 2
downvote count: 0
has body: I worked this out: Partially. I'm working on a client update, and didn't want to go down the route of full API registration and integration for them (small budget), so I wanted to understand the Google embed?pb command more to see what I could change. No luck changing the map centre, this remained on the pin in question, but I did change the default zoom. Using the '!' as a separator, the 14th element was 4f13.1 - changing the 13 part changed the zoom... Bigger number, wider zoom... &lt;iframe src="https://www.google.com/maps/embed?pb=! 1m18! 1m12! 1m3! 1d2478.740851360751! 2d-0.04087238408799207! 3d51.59131277964901! 2m3! f0! 2f0! 3f0! 3m2! 1i1024! 2i768! 4f13.1! &lt;- this one!! 3m3! 1m2! 1s0x48761dce1151aaab%3A0xba9569f9da72e2c6! 2sBespokea! 5e0! 3m2! 1sen! 2suk! 4v1500822710038" width="800" height="516" frameborder="0" style="border:0" allowfullscreen&gt;&lt;/iframe&gt;
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/112263126

http://stackoverflow.com/comment/45137619
has text: Show your attempts..
score: 0
comment on: http://stackoverflow.com/q/28400993
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45099652
comment on: http://stackoverflow.com/q/28380195
score: 0
type: Comment
has text: You need to use `!important` on the min width query. JavaScript code setting inline styling wins from CSS styling. Or better said always takes priority to CSS rules except when that CSS rule has `!important`.
type: QuestionComment

http://stackoverflow.com/comment/44943993
type: AnswerComment
score: 0
type: Comment
has text: I discovered another problem and I have fixed it though, What do you think about the call stack after I called ch() in the compare function, seems like the call stack was on line one where I called ch() but in ch(), I returned it back to the beginning of compare(). is that possible?
comment on: http://stackoverflow.com/a/28294433

http://stackoverflow.com/comment/44945145
has text: Works fine for me: [Plunkr](http://plnkr.co/edit/Ird3GyRnVmQF4rTqi6F6?p=preview)
comment on: http://stackoverflow.com/q/28296340
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/comment/107789582
has text: I know this is old thread, I'm also trying something similar. Difference is, trying share activity (share on fb/whatsapp), where I can share custom url on social n/w. Can you please assist.. I've tried different ways, but I'm facing issue shared on https://stackoverflow.com/questions/60809383/how-to-share-link-on-facebook-from-own-application-kai-os-feature-phone
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28439341
type: Comment

http://stackoverflow.com/comment/45016569
type: QuestionComment
comment on: http://stackoverflow.com/q/28335084
has text: That's where reality diverges from your expectations. `logging` is set to `false` every time you call `logger()`. It pretty plainly says so in your code. ;-P
score: 0
type: Comment

http://stackoverflow.com/a/28295604
accepted answer of: http://stackoverflow.com/q/28294696
has comment: http://stackoverflow.com/comment/44960729
has comment: http://stackoverflow.com/comment/44946496
type: AcceptedAnswer
upvote count: 3
type: Answer
answers question: http://stackoverflow.com/q/28294696
score: 3
has comment: http://stackoverflow.com/comment/45017383
has body: You can skip using accounts-ui package and build the login page however you want, with your UI design. You can use can have buttons in whatever postiion you want with HTML and CSS. But onclick event of those buttons just call loginWith&lt;Service&gt; methods (link to doc) For login with facebook button, use Template.myLogin.events({ 'click .facebook-login': function(){ Meteor.loginWithFacebook( requestPermissions: ['email', 'user_about_me'] }, function(err){ if !err console.log("Facebook login successful") } ) }, "click .twitter-login": function(){ Meteor.loginWithTwitter( requestPermissions: ['email'] }, function(err){ if !err console.log("Twitter login successful") } ) } }) For above to work, you need to add the first packages of concerned services like for facebook accounts-facebook, for twiter accounts-twitter
downvote count: 0

http://stackoverflow.com/q/28349895
type: AnsweredQuestion
score: 0
has answer: http://stackoverflow.com/a/28350042
type: Question
possible better answer: http://stackoverflow.com/a/28349992
has answer: http://stackoverflow.com/a/28349992
has answer: http://stackoverflow.com/a/28350026
has body: I have the following 2 string which I supposed to split according to delimiter: '/' or "/*" my code: var move = "1/2/13/14"; var results = move.split(new RegExp("[/\*?]")); results are GOOD: ["1","2","13","14"] BUT, for the next example: var move = "1/*2/13/*14"; var results = move.split(new RegExp("[/\*?]")); I get BAD results: ["1","","2","13","","14"] Why?? How can I modify it to work correctly? Thank you!
has comment: http://stackoverflow.com/comment/45044245
accepted answer: http://stackoverflow.com/a/28350026
has answer: http://stackoverflow.com/a/28350044
tagged with: javascript
has title: javascript Split string with regex
tagged with: regex
answer count: 4

http://stackoverflow.com/q/28390643
score: 2
tagged with: http://stackoverflow.com/tag/json
type: Question
has answer: http://stackoverflow.com/a/28390676
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/45118758
tagged with: jquery
has title: Place json into modal
downvote count: 0
has comment: http://stackoverflow.com/comment/45118663
favorite count: 0
upvote count: 2
tagged with: twitter-bootstrap
type: UnansweredQuestion
has body: I have a JSON returned data from a pho function that looks as follows: [{"id":"15","activity_type":"call","activity_title":"Call to check "}] Here the script that initiates the request (actvitiy.js)(Edited) $(document).on("click", ".view_contact_activity", function () { var this_activity_id = $(this).closest('.feeds').find('#this_activity_id').val(); $('#view-contact-activity').modal('show'); $.ajax({ url: '../includes/functions/contact-functions.php', data: {view_activity_id:this_activity_id}, dataType:'json', Success: function(response){ $('#activity_id').val(response[0].id); $('#activity_type').val(response[0].activity_type); } }); }); The modal where i need the values to show: Activity Title Activity Type Edit Activity The modal shows but no data is passed into the modal. Any ideas what i might be doing wrong here. EDIT: Adding PHP function that returns the JSON function view_activity(){ global $connection; $activity_id = $_POST['view_activity_id']; $get = "SELECT * FROM contact_activities WHERE activity_id = '$activity_id' " or die("Error: ".mysqli_error($connection)); $query = mysqli_query($connection, $get); $activitiy_field = array(); while ($activity_array = mysqli_fetch_array($query)){ $activity = array( 'id' => $activity_array['activity_id'], 'activity_type' => $activity_array['activity_type'], 'activity_title'=>$activity_array['activity_title'], 'activity_details'=>$activity_array['activity_details'], 'activity_status'=>$activity_array['activity_status'], 'activity_details'=>$activity_array['activity_details'], 'activity_details'=>$activity_array['activity_details'], ); $activitiy_field[] = $activity; } echo json_encode($activitiy_field); } if (isset($_POST['view_activity_id'])) { view_activity(); } Thank you.
has answer: http://stackoverflow.com/a/28491692

http://stackoverflow.com/comment/45128167
type: QuestionComment
comment on: http://stackoverflow.com/q/28395956
has text: vol7ron - Corrected - it was a mistake.
score: 0
type: Comment

http://stackoverflow.com/a/28340555
downvote count: 0
has comment: http://stackoverflow.com/comment/45026522
type: Answer
score: 2
has body: You could try something like this, using jquery: // This represents an Attribute. function Attribute(name, value){ this.name = name; this.value = value; } // This is the array of element's attributes var attributes = []; $("#elementsId").each(function() { $.each(this.attributes, function() { if(this.specified) { attributes.push(new Attribute(this.name, this.value)) } }); }); In the following snippet, I apply this for the first option. $(function(){ // This represents an Attribute. function Attribute(name, value){ this.name = name; this.value = value; } // This is the array of element's attributes var attributes = []; $("#1").each(function() { $.each(this.attributes, function() { if(this.specified) { attributes.push(new Attribute(this.name, this.value)) } }); }); for(var i=0; i<attributes.length; i++) document.write("name: "+attributes[i].name+" value: "+attributes[i].value+" "); }); Abc def xyz
upvote count: 2
has comment: http://stackoverflow.com/comment/45026566
has comment: http://stackoverflow.com/comment/45026637
answers question: http://stackoverflow.com/q/28340503
has comment: http://stackoverflow.com/comment/45026471

http://stackoverflow.com/comment/45117502
score: 0
has text: This works for resetting the list but it only displays one item. For example, if I enter 3 it only displays "ping" instead of "1, 2, ping"
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28376369

http://stackoverflow.com/q/28416776
has comment: http://stackoverflow.com/comment/45166720
has body: so I made an SVG loader. It runs perfectly while the request to the server is taking place, but when data comes and the DOM is getting filled my SVG stops, is this an issue with the browser itself or is it something im missing? //Getting data from the server and start spinner svgSpinner.open(); $.ajax({ url: "http://anyUrl", }).done(function(data) { //create DOM elements and close spinner createElements(data); svgSpinner.close(); }); Thanks
type: Question
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45167327
tagged with: http://stackoverflow.com/tag/svg
tagged with: angularjs
answer count: 0
type: UnansweredQuestion
has title: SVG stops animation when DOM is getting modified
tagged with: css
has comment: http://stackoverflow.com/comment/45168300
has comment: http://stackoverflow.com/comment/45167785
has comment: http://stackoverflow.com/comment/45168109

http://stackoverflow.com/comment/45201059
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28435176
has text: @charlietfl, thanks for the reply I just shared the code

http://stackoverflow.com/comment/45096756
type: Comment
has text: Thank you, I will test tomorrow and come back to say the result !
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28378399

http://stackoverflow.com/comment/47664095
has text: @Daniel, while(true){} is enough to make the app to stop respond to user input, but it will make a phonegap app to crash. 'out of memory' will not trigger the crash reporter as the crash reporter is also part of the app & no more memory is available for the app for its execution.
comment on: http://stackoverflow.com/q/28340920
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45161762
comment on: http://stackoverflow.com/a/28412999
type: AnswerComment
score: 0
type: Comment
has text: @AmirJalilifard it won't work. It is comparing a number and true, which will be casted to `1` so it will become `-4 == 1` which is false. They are *considered* truthy. Like `if(-4){alert("Success");}`

http://stackoverflow.com/comment/45125341
has text: Couple things, I'd try getting JSON values by var eventData = localStorage.getItem("event"); JSON.parse(eventData); Also I'm not 100% sure if thisCell.getElementsByClassName("spanEvent")[0].value works as intended inside of an object declaration;
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28394341
score: 0

http://stackoverflow.com/q/28427001
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/66825888
tagged with: ajax
tagged with: jquery-plugins
linked to: http://stackoverflow.com/q/35620499
has title: smoothState.js stops other plugins from working ie. wow.js
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has body: Smooth State conflicts with other js plugins I'm having issues when trying to add smoothState.js to my site it stops wow.js from working. No errors are logged in the console. When using animsition, wow.js works as a callback; var wow = new WOW({ boxClass: 'wow', // animated element css class (default is wow) animateClass: 'animated', // animation css class (default is animated) offset: 0, // distance to the element when triggering the animation (default is 0) mobile: true, // trigger animations on mobile devices (default is true) live: true, // act on asynchronously loaded content (default is true) callback: function(box) { // jshint ignore:line // the callback is fired every time an animation is started // the argument that is passed in is the DOM node being animated } }); var wowInit = function() {return wow.init();}; var animsitionInit = function(callback) { $('.animsition').animsition({ inClass: 'zoom-in-sm', outClass: 'zoom-out-sm', inDuration: 1500, outDuration: 800, linkElement: '.animsition-link', loading: true, loadingParentElement: 'body', //animsition wrapper element loadingClass: 'animsition-loading', unSupportCss: ['animation-duration', '-webkit-animation-duration', '-o-animation-duration' ], overlay: false, overlayClass: 'animsition-overlay-slide', overlayParentElement: 'body' }); return callback; }; animsitionInit(wowInit());
tagged with: plugins
answer count: 0
type: Question
score: 2

http://stackoverflow.com/comment/59931213
type: Comment
has text: I'm here for the exact same reason lol. RegEx is super confusing to me right now.
comment on: http://stackoverflow.com/q/28384718
score: 0
type: QuestionComment

http://stackoverflow.com/a/28395023
has body: you must iterate over the class elements ! var elements=document.getElementsByClassName('Button'); Array.prototype.forEach.call(elements, function(element) { element.checked = false; });
answers question: http://stackoverflow.com/q/28394934
downvote count: 0
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/q/28285898
type: Question
has comment: http://stackoverflow.com/comment/44926259
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/44926036
tagged with: javascript
tagged with: jquery
has body: I'm trying to make a virtual keyboard with jQuery. When I press 'a' in the given textarea, suppose that 'z' should be written instead. In textarea, I found the whole steps of typing a letter is given by keyDown event → keyPress event → letter typed in textarea → keyUp event In my code, I detected the letter in keyPress event and in that event, if the letter was 'a', I added 'z' in textarea using .val() method. If we have the initial string hello in textarea, after keyPress event, we have helloz. Then, before keyUp event occurs, textarea became helloza. So I deleted the last letter, 'a' in keyUp event. This looks great, and also works well. But, the problem is TIME DELAY. Since steps I wrote above takes a second, 'a' appears quite a while in the textarea. But the virtual keyboard in Google Translator does not show the original letter. How can I do this?
has comment: http://stackoverflow.com/comment/44925907
has answer: http://stackoverflow.com/a/28286159
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has answer: http://stackoverflow.com/a/28286197
has title: Javascript - Change input letter before written down textarea
upvote count: 1
possible better answer: http://stackoverflow.com/a/28286197
accepted answer: http://stackoverflow.com/a/28286159
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/44926157

http://stackoverflow.com/comment/45132878
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28398257
type: Comment
has text: ok, this is apparently a well know Firefox bug, here's the fix http://jsfiddle.net/jg51h5c5/

http://stackoverflow.com/comment/45056246
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/28356415
has text: No no, a constructor function does not "create a prototype". A constructor **has** a prototype. Ruby inheritance and JavaScript inheritance are **much** different.

http://stackoverflow.com/a/28305964
score: 0
accepted answer of: http://stackoverflow.com/q/28305510
type: Answer
has body: The setInterval behaves asynchronously. When you provide this.function2 as parameter to setInterval, you're basically providing a callback method. When setInterval has reached 5000 it calls your callback method. The "this" keyword changes depending on the context. The callback context is very different from your object's "ClassA" context. It's not the same "this". The trick is to do this: var ClassA = function(){ var that = this; //And then everywhere else use that instead of this. that.function1 = function() { ... that.function2 = function() { ... that.function1 that.function3 = function .... } Good luck.
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28305510

http://stackoverflow.com/q/28434755
has answer: http://stackoverflow.com/a/28434801
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: Selectors- How do I select the first input in a div?
upvote count: 3
has answer: http://stackoverflow.com/a/28435185
downvote count: 1
has comment: http://stackoverflow.com/comment/45199553
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28435042
score: 2
has answer: http://stackoverflow.com/a/28434849
has comment: http://stackoverflow.com/comment/45199651
has answer: http://stackoverflow.com/a/28434860
answer count: 6
has answer: http://stackoverflow.com/a/28434898
type: Question
tagged with: jquery-selectors
has comment: http://stackoverflow.com/comment/45199946
has body: I have to get to the first input in the a div (class=form-group) to make the first input required. How can I select the first input (firstName) on click the third element (email)?

http://stackoverflow.com/comment/45084945
comment on: http://stackoverflow.com/q/28369572
type: QuestionComment
type: Comment
has text: @entropic: people is an array of persons, so I think I'm storing more or less what you're referring to/
score: 0

http://stackoverflow.com/q/28432439
upvote count: 2
downvote count: 1
accepted answer: http://stackoverflow.com/a/28433797
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/45195048
type: Question
has title: Anchor not working in div
answer count: 1
linked to: http://stackoverflow.com/q/4537789
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28433797
has body: <source src="<%=request.getContextPath()%>/Files/images/sample.mp4" type="video/mp4"> <a href="<%=request.getContextPath() %>/Files/jsp/Home.jsp"> <img src="<%=request.getContextPath() %>/Files/images/play.png" height="50" width="50" onmouseover="this.src='<%=request.getContextPath()%>/Files/images/Koala.jpg'"> The anchor tag here is not working. The image play.png should change to Koala.jpg on mouse over and when clicked Home.jsp should be displayed. But the code is working without div. Using anchor in div neither image is gettig changed using mouseover nor linking to Home.jsp.
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/a/28321787
type: Answer
answers question: http://stackoverflow.com/q/28321290
score: 0
has comment: http://stackoverflow.com/comment/44992249
has body: I have made function to fulfil your need, but you have to use "jQuery" for this : core function : (function($){ $.scrollTo = function(target, speed, style){ if(typeof target === 'string'){ var pos = $(target).offset().top; }else if(typeof target === 'object'){ var pos = target.offset().top; } var userSetting = { speed: speed, style: style } var setting = $.extend({ speed: 300, style: 'swing' }, userSetting); if(typeof pos !== 'undefined'){ $('html, body').animate({ scrollTop: pos },setting.speed, setting.style); } } })(jQuery) Execute funtion like this : jQuery(document).ready(function($){ $.scrollTo('.active',800, 'swing'); }); Hope, This will help you...

http://stackoverflow.com/comment/44955929
type: AnswerComment
comment on: http://stackoverflow.com/a/28301548
has text: You see my changes? try that
type: Comment
score: 0

http://stackoverflow.com/a/28290638
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28290278
accepted answer of: http://stackoverflow.com/q/28290278
type: Answer
has body: It's a good question which shows you've gaining some intuition for what is good/bad programming. There is nothing wrong with doing what you describe: I mean it will work, and work well for some people. But, in my experience, whilst it's easy for trivial stuff, once the application gets long and busy things get tricky to maintain. I think the programming principle violated is called something like maintaining a separation of concerns. The problem is you are writing code which must respect two scopes at once: the server and the client; it's always easier to focus on one at a time. One way to quickly simplify the problem is to write a pure javascript routine which is then called with server generated data. That might go something like: // a pure js function function render_rating(elid, rating){ $elid.raty({readOnly: true, score: rating/100 * 5}) } And list all the invocations neatly someplace else: &lt;script type="text/javascript"&gt; // server generates a list of function calls which render the ratings client side {% for review in reviews %} render_rating('#{{review.id}}-starrating', {{review.rating}}); {% endfor %} &lt;/script&gt; The idea is to separate the code into two distinct fragments so it is clear "this is stuff that happens on the client", and "this is stuff that happens on the server". When the javascript routines get long and complex (like ajax applications) this kind of thinking makes it much easier to create static (cachable) javascripts which can be called by serverside generated data embedded into html and, as things get even more advanced, invoked by other js routines which are acting on data returned by ajax api calls.

http://stackoverflow.com/a/28485093
score: 2
has body: There are quite a few different ways depending on your exact situation but I would recommend the :after pseudo element: #target:after { content: ''; display: block; height: 100% } There is no extra markup and it forces there to be the gap at the bottom that you mentioned in your question.
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28405366
answers question: http://stackoverflow.com/q/28405366

http://stackoverflow.com/q/28384432
type: Question
score: 0
answer count: 2
tagged with: css-selectors
accepted answer: http://stackoverflow.com/a/28384705
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45106800
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I am doing responsive website. My HTML code is as given below: Title ... ... ... ... ... ... Title ... ... ... ... ... ... ... ... ... ... ... ... CSS is like this: .column-5{width:18.4%; margin-right:2%;} .column-5:last-child{margin-right:0;} and my JS like $('.column_5:nth-of-type(5n+5)').addClass('last-child') The output the above code currently produces is as follows: Title ... ... ... ... ... ... Title ... ... ... ... ... ... ... ... ... ... ... ... However, what I am expecting/need is the below. Effectively, I need the last-child class to be added to every 5th consecutive element with the column-5 class. Title ... ... ... ... ... ... Title ... ... ... ... ... ... ... ... ... ... ... ... How can I achieve this?
upvote count: 1
downvote count: 1
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28384876
has answer: http://stackoverflow.com/a/28384705
has title: nth-of-type not working as needed
has answer: http://stackoverflow.com/a/28384876

http://stackoverflow.com/q/28305031
possible better answer: http://stackoverflow.com/a/28305393
type: Question
has answer: http://stackoverflow.com/a/28305393
upvote count: 9
tagged with: javascript
answer count: 2
accepted answer: http://stackoverflow.com/a/28305587
downvote count: 0
favorite count: 0
has title: Inherit outer controller's scope from within ng-include without a service?
tagged with: angularjs
score: 9
linked to: http://stackoverflow.com/q/14049480
has body: In AngularJS is it possible to inherit the parent controller's scope from within an included partial instead of passing the data through an injected service? Example case: Let's say ParentCtrl's scope looks like: { testData: 'testing stuff' } Here we're defined: {{testData}} And inside partial.html: Inherited: {{testData}} So the partial doesn't even need it's own controller for this. If this is impossible though and you can only pass injected data between controllers via a service why has Angular done things this way?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28305587
tagged with: angularjs-scope

http://stackoverflow.com/q/28408664
type: AnsweredQuestion
has body: Chart code: My problem is do: if the checkbox mans_00 is checked then put '2000' in categories.I tryed in this form: PS:mans_00 contain mans_ins_area_00 if(mans_00==mans_ins_area_00) {'2000',} '2005', '2010' This code don't work
type: Question
has title: Conditional in categories and series
score: 0
answer count: 1
tagged with: highcharts
tagged with: javascript
has answer: http://stackoverflow.com/a/28413342
accepted answer: http://stackoverflow.com/a/28413342

http://stackoverflow.com/comment/45034406
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28344839
has text: You may want to refer to " http://www.cs.tut.fi/~jkorpela/forms/textarea.html " for more information about How to limit the number of characters entered in a textarea. Also do note that most browsers calculate the carriage returns as two characters.

http://stackoverflow.com/comment/45072517
type: AnswerComment
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28364262
has text: Of course you can do that in knockout. If you want a filtered group, simply add another computed value that filters the group.

http://stackoverflow.com/q/28379344
has comment: http://stackoverflow.com/comment/45098228
score: 1
type: Question
has title: print one line on one page with javascript or jquery
has answer: http://stackoverflow.com/a/28379422
has answer: http://stackoverflow.com/a/28379627
tagged with: javascript
has answer: http://stackoverflow.com/a/28379650
upvote count: 1
has answer: http://stackoverflow.com/a/28383277
has comment: http://stackoverflow.com/comment/45098300
has body: I had a code which runs in a loop and it should 5 tickets on one page when I try to print it.. I want to print one ticket on one page I am lost how to do, I am trying the following code: function Printticket() { $('#print .ticket_new').each(function() { $(this).hide(); }); $('#print .ticket_new').each(function() { $(this).show(); window.print(); }); } code is like this ticket1 ticket2 ticket3 ticket4
downvote count: 0
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: css
answer count: 4

http://stackoverflow.com/comment/44932593
has text: So I worked around it by setting fixed offsets from the left of the page in pixels. It's not ideal and doesn't look as nice, but I'll figure out how to do something fancier with document.getelementbyid() and set the values dynamically later.
comment on: http://stackoverflow.com/q/28285896
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28306832
answers question: http://stackoverflow.com/q/28306632
has comment: http://stackoverflow.com/comment/44964629
accepted answer of: http://stackoverflow.com/q/28306632
type: AcceptedAnswer
downvote count: 0
has body: This is your Javascript: This is when inside a PHP variable: $ch = ' '; Demo: http://3v4l.org/fH0Vi
upvote count: 3
type: Answer
score: 3

http://stackoverflow.com/a/28352857
type: AcceptedAnswer
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/28345027
score: 2
accepted answer of: http://stackoverflow.com/q/28345027
has body: Okay, as suggested in the comments, here is an example of what you can do just with jQuery-UI Amsterdam Berlin London New York Paris Brisbane Melbourne Perth Sydney Wollongong
downvote count: 0

http://stackoverflow.com/a/28390887
has body: The changer click handler is bound before the element exists. Try using the $.on method instead. http://api.jquery.com/on/ $('body').on('click', '.changer', function() {...}) This works because the event handler is bound to the document body, which already exists on the page. When there is a click anywhere in the body, jQuery will check if the clicked element matches the selector .changer and execute the callback if so. Alternatively, you could just bind the $('.changer').click event within the first callback.
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/45119254
answers question: http://stackoverflow.com/q/28390868
has comment: http://stackoverflow.com/comment/45119092
has comment: http://stackoverflow.com/comment/45119185
downvote count: 0

http://stackoverflow.com/q/28306953
tagged with: api
upvote count: 0
answer count: 1
linked to: http://stackoverflow.com/q/23823010
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/44978932
has body: i have implemented AngularJS application that is using https://developers.google.com/+/web/signin/server-side-flow The problem is that my AngularJS is on one server and Rest Api is at the other server. When I tried to login everything goes ok until my callback function calls rest api. This is the error: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://liveboard-dev.locastic.com/api/v1/login. This can be fixed by moving the resource to the same domain or enabling CORS. There is no problem with server as I can call this method from any part of code except when i am sending auth response directly from google which I got after popup window is closed. My angularjs code for calling api is: $http.post(applicationSettings.authenticationAPIUrl, authResult['code'], {headers: {'Content-Type': 'application/octet-stream; charset=utf-8'}}).success(function (response) { identityService.setIdentity(response); deferred.resolve(response); }).error(function (error) { deferred.reject(error); });
has comment: http://stackoverflow.com/comment/44981261
tagged with: oauth
tagged with: angularjs
type: UnansweredQuestion
downvote count: 1
has answer: http://stackoverflow.com/a/28316181
score: -1
has title: Google plus CORS error
has comment: http://stackoverflow.com/comment/44981404
has comment: http://stackoverflow.com/comment/44965409
type: Question
has comment: http://stackoverflow.com/comment/44965681
tagged with: cors

http://stackoverflow.com/comment/45159292
comment on: http://stackoverflow.com/a/28413002
has text: dont answer on obvious dublicates
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28292577
has comment: http://stackoverflow.com/comment/44939818
has comment: http://stackoverflow.com/comment/44940174
has title: Highchart spider web more categories
has answer: http://stackoverflow.com/a/28302067
type: Question
has body: I have problem with highchart - spider web. Chart works great but i have problem when i want add more categories. Now i have 8 categories, but i want more, maybe even 100 - 150. Is it possible to achieve this with this chart? Below is my chart $(function () { $('#genrechart').highcharts({ chart: { polar: true, type: 'line', margin: 0 }, exporting: { enabled: false, buttons: { enabled: false } }, title: { text: '&amp;nbsp', x: -80, useHTML: true }, pane: { size: '70%' }, xAxis: { categories: ['Sales', 'Marketing', 'Development', 'Customer Support', 'Information Technology', 'Administration', 'bororo', 'text-center', 'fere'], tickmarkPlacement: 'on', lineWidth: 0, labels: { align: 'center', distance: 2 } }, yAxis: { gridLineInterpolation: 'polygon', lineWidth: 0, min: 0, endOnTick: true, showLastLabel: true, tickPositions: [0, 5, 6, 7, 8] }, tooltip: { shared: true, headerFormat: '&lt;span style="font-size: 12px"&gt;{point.key}:&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;b&gt;{point.y:,.2f}&lt;/b&gt;', pointFormat: '', useHTML: true }, legend: { enabled: false, align: 'right', verticalAlign: 'top', y: 70, layout: 'vertical' }, series: [{ name: '', data: [1, 2, 3, 4, 5, 6, 7], pointPlacement: 'on' }] }); }); http://jsfiddle.net/sanczopan/qybn6m2u/ Thx for help.
has comment: http://stackoverflow.com/comment/44940707
score: 0
tagged with: highcharts
answer count: 1
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion

http://stackoverflow.com/q/28332800
type: Question
has comment: http://stackoverflow.com/comment/45012958
has comment: http://stackoverflow.com/comment/45012657
has body: Similar to the following question (note the following question is related to symfony 2.3 - I don't know what that is, I'm just using HTML) : How to disable html5-validation for specific buttons in symfony 2.3 Is it possible to bypass HTML5 validation (required) for a specific button in HTML? Register Log in Menu I don't need validation if register button is clicked. if(isset($_POST['register'])) { header("Location: register.php"); } Edit: A way of doing this without changing the structure of the form or changing the button :).
has comment: http://stackoverflow.com/comment/45012839
score: 0
answer count: 2
linked to: http://stackoverflow.com/q/17068778
tagged with: validation
linked to: http://stackoverflow.com/q/18725078
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28332859
favorite count: 0
has title: Is it possible to ignore HTML5 validation a specific button?
has comment: http://stackoverflow.com/comment/45013948
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has answer: http://stackoverflow.com/a/28333084
accepted answer: http://stackoverflow.com/a/28333084
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45013093
upvote count: 1
has comment: http://stackoverflow.com/comment/45012600
downvote count: 1
has answer: http://stackoverflow.com/a/28332859

http://stackoverflow.com/comment/45002149
score: 0
type: Comment
has text: May I ask why this one works though? If I put that before my DIV elements, it does return an index.
comment on: http://stackoverflow.com/a/28327251
type: AnswerComment

http://stackoverflow.com/comment/45141171
comment on: http://stackoverflow.com/a/28397970
score: 1
type: AnswerComment
type: Comment
has text: @Moezalez Not that I know of, no. According to the docs, the primary utility of `util.inspect` is for use in debugging, so this use of it is as intended.

http://stackoverflow.com/a/28333646
answers question: http://stackoverflow.com/q/28328404
type: Answer
has body: I'm a little late to the party on this one (and the answers posted already are quite excellent), but if you just want to determine if the localStorage object contains any keys that start with "event-", you could always try something simple like the code below. So you'd basically call it like this: if (localStorageContains('event-')){ console.log('You have event keys! Hooray!'); } else { console.log('No keys yet - time to add some.'); } Obviously, there are some shortcomings with this - it doesn't check if the passed argument is a string or not, for example - but since you know what you're looking for, it might be adequate for your needs. function localStorageContains(searchText){ var valueToReturn = false; for (var i in localStorage){ if (i.indexOf(searchText) &gt; -1){ valueToReturn = true; } } return valueToReturn; }
score: 0

http://stackoverflow.com/comment/45176539
type: QuestionComment
type: Comment
has text: Hi @Bricktop, I am new to Angular. So can you advise what's the best practice to achieve it?
comment on: http://stackoverflow.com/q/28421198
score: 0

google-plus-signin
tags question: http://stackoverflow.com/q/28322478
type: Tag
tag name: google-plus-signin

http://stackoverflow.com/comment/45008540
type: AnswerComment
type: Comment
has text: moment.js is my go to library for anything date related
comment on: http://stackoverflow.com/a/28330520
score: 0

http://stackoverflow.com/comment/44960624
has text: So, in the end, did you have to use my `.attr` method? Or did it work with `.class`?
comment on: http://stackoverflow.com/a/28282936
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/44969006
has text: Thanks Bergi, that seems to work. I will need async later on for more complex matters but I wanted to use with something more simple first.
comment on: http://stackoverflow.com/a/28308941
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45162166
comment on: http://stackoverflow.com/a/28413576
score: 0
type: AnswerComment
type: Comment
has text: I'll give a check on the rest of my code. Anyway it is the right answer for me.

http://stackoverflow.com/q/28317197
downvote count: 0
has body: I have been trying to figure out how I could resize the canvas contents to get roughly a 100x100 thumbnail and upload it to the server. I would like to keep my existing canvas in its current size, because all these actions have to be invisible to the user. I know I can get the contents in the current size of the canvas by using toDataURL, but how could I resize it and then upload to the server? var image = canvas.toDataURL("image/png");
type: Question
possible better answer: http://stackoverflow.com/a/28317628
linked to: http://stackoverflow.com/q/2303690
has title: How to resize canvas contents and upload image to server?
score: 1
accepted answer: http://stackoverflow.com/a/28320855
tagged with: resize-image
answer count: 2
has answer: http://stackoverflow.com/a/28317628
tagged with: canvas
upvote count: 1
tagged with: html5-canvas
tagged with: javascript
has answer: http://stackoverflow.com/a/28320855
favorite count: 0
type: AnsweredQuestion

http://stackoverflow.com/q/28365753
score: -1
type: Question
has answer: http://stackoverflow.com/a/28365815
tagged with: javascript
answer count: 1
downvote count: 1
favorite count: 0
has title: How to create a custom facebook like button?
upvote count: 0
tagged with: php
has body: I need to create facebook like button in product list page in prestashop. I created the face book like button in below . But I need to create facebook like using tag. How to create facebook like button in custom button. Please help me .
type: AnsweredQuestion
tagged with: smarty
tagged with: prestashop
accepted answer: http://stackoverflow.com/a/28365815

http://stackoverflow.com/comment/45194414
type: QuestionComment
score: 0
has text: It will only show if subject is "All"
comment on: http://stackoverflow.com/q/28431860
type: Comment

http://stackoverflow.com/comment/45020612
type: Comment
comment on: http://stackoverflow.com/a/28337285
has text: what axis would you like to rotate around? you can do a 3dtransform just as easily http://www.w3schools.com/css/css3_3dtransforms.asp
type: AnswerComment
score: 0

axes
tag name: axes
type: Tag
tags question: http://stackoverflow.com/q/28287378

http://stackoverflow.com/a/28399713
type: Answer
downvote count: 1
score: -1
upvote count: 0
has body: You can't do this with the normal confirm. With confirm, the program execution waits until the user selects OK or Cancel. Instead, you will have to generate that confirmation box yourself (or with a JS library).
answers question: http://stackoverflow.com/q/28399688

http://stackoverflow.com/q/28419754
tagged with: jquery-validate
has body: I have a validation rule that I want to add using a variable varFunctionID, which represents a custom validation method. Rather than looking for the value of the variable, it searches for a function called varFunctionID, which does not exist. How can I ensure that the value, not the name, of the variable is used? Also, I cannot use the name in place of the variable. var varFunctionID = "nameOfMyCustomValidationFunction"; $('#myField').rules('add', { varFunctionID: true }, messages: { varFunctionID: "My message." } }); * EDIT * There is no way to make the name dynamic. The way to handle such a need is to pass in a parameter to the validation method, like so: $('#myField').rules('add', { myFunction: { myParm: "parm" } }, messages: { myFunction: "My message." } }); jQuery.validator.addMethod("myFunction", function (value, element, options) { var passParm= options.myParm; });
type: Question
has comment: http://stackoverflow.com/comment/45181520
has title: jQuery validation custom method rule and message with dynamic name?
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/45173799
has comment: http://stackoverflow.com/comment/45173850
answer count: 1
has answer: http://stackoverflow.com/a/28420406
has comment: http://stackoverflow.com/comment/45181596
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28420406

required
tag name: required
tags question: http://stackoverflow.com/q/28365129
tags question: http://stackoverflow.com/q/28434330
type: Tag

http://stackoverflow.com/a/28386728
answers question: http://stackoverflow.com/q/28386621
downvote count: 0
type: Answer
upvote count: 2
has body: You don't need any JavaScript at all actually, and it is quite simple to do with CSS3. Just need to set up keyframes and animation like so: (obviously including the necessary browser compatibility) #box { height: 100px; width: 100px; background: red; position: relative; animation: waver 2s infinite; -webkit-animation: waver 2s infinite; } @keyframes waver { 0% {left: 0px;} 50% {left: 100px;} 100% {left: 0px;} } @-webkit-keyframes waver { 0% {left: 0px;} 50% {left: 100px;} 100% {left: 0px;} } See this fiddle for an example: http://jsfiddle.net/bwsd3eoy/
has comment: http://stackoverflow.com/comment/65367776
score: 2

http://stackoverflow.com/q/28301561
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28302960
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: Question
score: 0
has body: Here's my code: HTML: Responsive Menu Some title Home Work Contact Me Home Work Contact Me Lorem ipsum dolor set amet... CSS: body { font-family: "Ludica Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif; } p { margin: 0; padding: 0; display: inline-block; } header { margin: 0; padding: 0; display: inline-block; position: absolute; top: 0; left: 0; background-color: azure; border: 1px solid black; width: 100%; } /* Begin Menu Code */ .menu { display: inline-block; float: right; } .menu ul { list-style: none; margin: 5px 0; } .menu ul:last-child { margin-right: 10px; } .menu ul li { display: inline-block; margin: 0 2px; padding: 0; border: 1px solid black; } .menu ul li a { text-decoration: none; color: black; padding: 3px; } .menu ul li>:hover { background-color:black; color: white; } /* End Menu Code */ /* Mobile Menu Begin */ .mobile-menu-enabler { display: none; background-color: aqua; } .mobile-menu { display: none; position: relative; top: 38px; width: 100%; border-top: 1px solid black; } .mobile-menu ul { list-style: none; margin: 0; padding: 0; } .mobile-menu ul li { margin: 0; padding: 0; border: 1px solid black; border-top: 1px solid transparent; text-align: center; } .mobile-menu ul li a { margin: 0; padding: 0; text-decoration: none; color: black; } .mobile-menu ul li:hover { background-color: darkkhaki; } /* Mobile Menu End */ /* Mobile Trigger Button */ .nav-trigger { display: none; text-transform: uppercase; color: black; background-color: transparent; margin-right: 10px; padding: 0; text-align: center; } .nav-trigger:hover { color: red; background-color: transparent; } /* End Mobile Trigger Button */ /* Dummy wrapper stuff */ #wrapper { clear: both; display: inline-block; position: relative; } /* End Dummy wrapper stuff */ @media screen and (max-width: 900px) { .menu { display: none; } .mobile-menu-enabler { display: block; } .nav-trigger { display: inline-block; float: right; } /*.mobile-menu {*/ /*display: block;*/ /*}*/ } JavaSc…
has title: Responsive menu doesn't close even after browser resize
has comment: http://stackoverflow.com/comment/44955025
has comment: http://stackoverflow.com/comment/44954484
has comment: http://stackoverflow.com/comment/44954509
tagged with: responsive-design
accepted answer: http://stackoverflow.com/a/28302960
possible better answer: http://stackoverflow.com/a/28301675
answer count: 3
has answer: http://stackoverflow.com/a/28301675
has answer: http://stackoverflow.com/a/28301810
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/44981044
has text: [WebRTC](http://www.webrtc.org/) might be helpful if you want to communicate between two separate browsers without a server.
comment on: http://stackoverflow.com/q/28315879
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/30502679
answers question: http://stackoverflow.com/q/28359220
has body: i might be wrong because i have not run your code but i notice is you have not included a jquery library into the script tag and you are using a jquery function. Try including Jquery and retry hope that solves your problem..
type: Answer
score: 0

http://stackoverflow.com/a/28331071
downvote count: 0
has body: You syntax seems wrong. It should be like this: dojo.byId("order_list").copyState = function( keyPressed, self ){return false;}; Hope that this helps.
score: 1
accepted answer of: http://stackoverflow.com/q/28330160
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28330160
type: Answer

http://stackoverflow.com/comment/44941049
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28294164
has text: I set breakpoints at onclick method and Index method of GoalsController. The first fires but the second doesn't

http://stackoverflow.com/a/28311928
has body: The controller specified with your route is only scoped to the content located in the ng-view. You can read about this in the Experiments section of this tutorial. You could create a new controller for your header, say headerController and add this controller to your header with ng-controller="headerController". On a side note, I suggest to use the controller as syntax. It will allow you to manage different controllers and remember what's where easily. It also enable you to avoid most, if not all, prototypal inheritance masking primitives issues.
upvote count: 2
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28311778
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/28311778

http://stackoverflow.com/a/28351251
type: Answer
accepted answer of: http://stackoverflow.com/q/28350939
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/28350939
has body: on button click, you also call a function like Remove And then create the setItemID(itemID) function into the angularjs controller and put the itemID into a scope variable. When user will click on the remove button, the setItemID function will be called and the itemId will be assigned into the scope. Now at the time when user click "Yes i want to remove this item", then use that defined itemID. Hope you get your solution. If still have any problem then lets comment.
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/45135988
type: QuestionComment
has text: I am not getting any error messages now that I changed it to: `var express=require('express'); var app=express();` I have managed to make sound happen using a src=url for the audio - shown here: https://imgur.com/6yWa2zW, however, the sound does not play when the spacebar is pressed, it simply continuously loops it (even though `loop="false"`)
comment on: http://stackoverflow.com/q/28394340
score: 0
type: Comment

http://stackoverflow.com/q/28305795
has title: How to flush AngularJS $httpBackend responses in different order
tagged with: httpbackend
has comment: http://stackoverflow.com/comment/44986656
upvote count: 7
answer count: 1
tagged with: angularjs
has answer: http://stackoverflow.com/a/28764842
has body: I have an AngularJS service which performs an $http GET request and caches the response locally. It is designed to handle the multiple calls happening simultaneously, such that only the data from the final call is cached. Specifically, if the following happens: Request A Started Request B Started Request B Completed Request A Completed The result is that the response of request B is cached, because it was initiated last. However I'm having trouble unit testing this in Jasmine. I can set-up two $httpBackend.expectGET() expectations, but I can only flush them in the order they are requested. Essentially I need to be able to so something like this: $httpBackend.expectGET('/one').respond(200, data1); $httpBackend.expectGET('/two').respond(200, data2); myService.doSomething('/one'); myService.doSomething('/two'); $httpBackend.flush('/two'); $httpBackend.flush('/one'); expect(myService.data).toBe(data2); Can anyone suggest a neat way to achieve this?
accepted answer: http://stackoverflow.com/a/28764842
tagged with: unit-testing
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/44986506
score: 7
type: Question
tagged with: javascript
tagged with: jasmine
favorite count: 0

ruby
tags question: http://stackoverflow.com/q/28427637
tag name: ruby
tags question: http://stackoverflow.com/q/28362067
tags question: http://stackoverflow.com/q/28316650
tags question: http://stackoverflow.com/q/28347414
tags question: http://stackoverflow.com/q/28432589
tags question: http://stackoverflow.com/q/28356415
tags question: http://stackoverflow.com/q/28364958
tags question: http://stackoverflow.com/q/28423674
tags question: http://stackoverflow.com/q/28404547
tags question: http://stackoverflow.com/q/28420261
tags question: http://stackoverflow.com/q/28359048
tags question: http://stackoverflow.com/q/28288816
tags question: http://stackoverflow.com/q/28381790
tags question: http://stackoverflow.com/q/28396146
type: Tag

http://stackoverflow.com/q/28381836
type: UnansweredQuestion
tagged with: javascript
type: Question
has title: How to stop Background scrolling when modal box is in view in the mobile , just using CSS or Javascript?
score: 0
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/28381946
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I am working on a responsive website where when the user is in the mobile, he/she gets to view a modal box. To achieve that I am not using Bootstrap, just plain CSS and bit of Javascript. Now, the issue is that I cannot figure out how to stop the background ,or rather the main body to be specific, to scroll while the modal box is in view. I tried to manipulate the overflow-y from scroll to hidden using JS however, it does not work or may be thats not the right way, i just tried it. Anyhow, I checked out some answers in Stackoverflow, they are using bootstrap 3. I want a solution for this problem without using bootstrap 3, just using pure CSS or Javascript, I would really appreciate it if its possible. Thanks for your response. PS: Just a note I am not avoiding bootstrap, I just want to know if there is a possible solution using simple CSS and JS.

http://stackoverflow.com/comment/44993302
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28322058
score: 0
has text: Yes! Thanks for the great writing, really clear. Now I understand what I did wrong.

http://stackoverflow.com/q/28342549
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
upvote count: 2
has body: For a small web app I need to get the screen size of multiple displays. First I tried it with simple javascript via screen.height but that only works for the primary display, no matter where the window was. I was going to do a fallback with inputs anyways but i wanted an automatic way, too. I was looking for a way via actionscript but couldn't find anything. I don't want something where the user has to click accept or anything like that. Just something that works without asking the user or when it doesn't using the fallback method (in this case just do nothing and let the user fill in the size himself) Do you know any method? Greetings
type: UnansweredQuestion
tagged with: screen
tagged with: size
score: 2
has comment: http://stackoverflow.com/comment/61467640
answer count: 0
type: Question
has title: Get screen size of multiple displays
downvote count: 0
tagged with: javascript
tagged with: actionscript

http://stackoverflow.com/a/28288355
has body: Use .return(): function createNewCourse(courseInfo, teacherName) { var newCourse = new courseModel({ cn: courseInfo.courseName, cid: courseInfo.courseId }); return newCourse.saveAsync().then(function (savedCourse) { var newTeacher = new newTeacherModel({ na: teacherName, _co: savedCourse._id // This would be an array }); return newTeacher.saveAsync(); }).return(newCourse); } Remember how chaining works? .then(function() { return somethingAsync().then(function(val) { ... }) }) Is equivalent to (disregarding any closure variables): .then(function() { return somethingAsync() }) .then(function(val) { ... }) return(x) is simply equivalent to .then(function(){return x;})
type: AcceptedAnswer
downvote count: 0
score: 4
type: Answer
accepted answer of: http://stackoverflow.com/q/28286894
answers question: http://stackoverflow.com/q/28286894
upvote count: 4

http://stackoverflow.com/a/68741499
has comment: http://stackoverflow.com/comment/122446985
type: Answer
has comment: http://stackoverflow.com/comment/122474628
score: 3
upvote count: 3
has body: With hooks: const MyComponent = () => { const [selectedOption, setSelectedOption] = useState(1) useEffect(() => { const storedSelectedOption = parseInt(sessionStorage.getItem('selectedOption') || '1') setSelectedOption(storedSelectedOption) }, []) const handleOnChange = (e: React.ChangeEvent<HTMLSelectElement>) => { setSelectedOption(parseInt(e.target.value)) sessionStorage.setItem('selectedOption', e.target.value) } return ( Five Three ) } Apparently this also works: const MyComponent = () => { const [selectedOption, setSelectedOption] = useState<number>(() => { return parseInt(sessionStorage.getItem('selectedOption') || '1') }) const handleOnChange = (e: React.ChangeEvent<HTMLSelectElement>) => { setSelectedOption(parseInt(e.target.value)) sessionStorage.setItem('selectedOption', e.target.value) } return ( Five Three ) } In modern browsers: return ( Five Three ) For input something like this should work: (In reply to question in comment from @TanviAgarwal) const MyInput = React.forwardRef((props, ref) => { const { name, value, onChange } = props const [inputValue, setInputValue] = React.useState(() => { return sessionStorage.getItem(name) || value || '' }) const handleOnChange = (e) => { onChange && onChange(e) setInputValue(e.target.value) sessionStorage.setItem(name, e.target.value) } return }) (With typescript it's a bit more complicated, but not horribly so) This will store the value "forever", so you have to somehow handle resetting the form.
has comment: http://stackoverflow.com/comment/122395183
has comment: http://stackoverflow.com/comment/122423521
has comment: http://stackoverflow.com/comment/122456632
answers question: http://stackoverflow.com/q/28314368
has comment: http://stackoverflow.com/comment/122446958
downvote count: 0

http://stackoverflow.com/q/28401339
tagged with: nav
type: Question
has body: I've been getting this error when trying to hide my mobile nav when a link is clicked. It seems like a pretty simple issue, and I've looked through some similar questions but I can't seem to figure it out. My HTML &lt;div id=mobilenav class=mobilenav onclick="HideNav();"&gt; &lt;nav id=nav&gt; &lt;/nav&gt; &lt;/div&gt; mobilenav is hidden on default, and when the screen shrinks I show it. The CSS .mobilenav { display:none } @media screen and (max-width: 900px) { .mobilenav { display: block; } } When a link in mobilenav is clicked I run this JavaScript function: function HideNav () { var nav = document.getElementById(nav); nav.style.display='none'; } But the console is giving me the "Cannot read property style of null" error. I'm not sure how nav is null.
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28401552
answer count: 2
tagged with: mobile
upvote count: 1
has title: Cannot Read Property Style Of Null
favorite count: 0
has comment: http://stackoverflow.com/comment/45138139
has answer: http://stackoverflow.com/a/28401353
accepted answer: http://stackoverflow.com/a/28401353
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28401552
type: AnsweredQuestion
downvote count: 0
score: 1

http://stackoverflow.com/comment/44930610
type: AnswerComment
type: Comment
has text: Since the page is blank it makes sense.
score: 0
comment on: http://stackoverflow.com/a/28287793

http://stackoverflow.com/comment/45150109
type: QuestionComment
comment on: http://stackoverflow.com/q/28407641
has text: First of all `JSON.stringify` is supposed to call `toJSON` on `canvas`, so calling `JSON.stringify` again is wrong. But `canvas.JSON` should _work_. If it does not work for you then you have: encountered a bug _or_ use an incompatible browser _or_ are doing something wrong in your own code.
score: 0
type: Comment

http://stackoverflow.com/comment/45187637
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28411799
has text: @aus_lacy : The problem is that I can't use django on the templates because we want to use PhoneGap to make a mobile app with the templates, that being said the front-end can only connect with the Django server via http requests. However I didn't used FormData yet would it solve the problem, Musa?
score: 0

http://stackoverflow.com/q/28371982
has answer: http://stackoverflow.com/a/46366555
type: Question
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/34208195
has comment: http://stackoverflow.com/comment/45084491
possible better answer: http://stackoverflow.com/a/39727623
has comment: http://stackoverflow.com/comment/45084787
has answer: http://stackoverflow.com/a/39727623
tagged with: ecmascript-6
tagged with: this
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28372106
has title: What does "this" refer to in arrow functions in ES6?
favorite count: 0
has answer: http://stackoverflow.com/a/56321471
upvote count: 81
has answer: http://stackoverflow.com/a/57286154
has comment: http://stackoverflow.com/comment/45084458
tagged with: arrow-functions
has answer: http://stackoverflow.com/a/43364585
answer count: 10
has answer: http://stackoverflow.com/a/68248076
has answer: http://stackoverflow.com/a/37979892
score: 81
has answer: http://stackoverflow.com/a/62741113
has body: I've read in several places that the key difference is that this is lexically bound in arrow functions. That's all well and good, but I don't actually know what that means. I know it means it's unique within the confines of the braces defining the function's body, but I couldn't actually tell you the output of the following code, because I have no idea what this is referring to, unless it's referring to the fat arrow function itself....which doesn't seem useful. var testFunction = () =&gt; { console.log(this) }; testFunction();
accepted answer: http://stackoverflow.com/a/28372106
has answer: http://stackoverflow.com/a/70343700

http://stackoverflow.com/q/28360672
has answer: http://stackoverflow.com/a/28360791
tagged with: css
has title: Click event doesn't trigger in my case
tagged with: iframe
type: Question
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/28360778
has answer: http://stackoverflow.com/a/28360868
answer count: 3
type: UnansweredQuestion
has body: My demo http://plnkr.co/edit/7FQ4ftbhcy2RCpz9hDIv?p=preview I try to remove play button when the video is played but the click trigger didn't get trigger.

http://stackoverflow.com/q/28317212
type: AnsweredQuestion
type: Question
tagged with: javascript
has title: how to upload image file in http.post with other paramters in AngularJS
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28361723
accepted answer: http://stackoverflow.com/a/28361723
tagged with: angularjs
linked to: http://stackoverflow.com/q/16483873
tagged with: django
has body: i am new angularjs, i m posting successfully multiple parameters in http.post but when i try to add a file in that parameter django returns Invalid boundary in multipart: None from web service which is django based, browsable api page work fine so there is nothing wrong on web service side on localhost. my html code is Title: Banner: 0% Description: {{OKans}} {{NAans}} Status: {{res.statusText}} my angularjs controller code is eventsApp.controller('addEventController', function($scope, $http) { var reader; var progress = document.querySelector('.percent'); function errorHandler(evt) { switch(evt.target.error.code) { case evt.target.error.NOT_FOUND_ERR: alert('File Not Found!'); break; case evt.target.error.NOT_READABLE_ERR: alert('File is not readable'); break; case evt.target.error.ABORT_ERR: break; // noop default: alert('An error occurred reading this file.'); }; } function updateProgress(evt) { // evt is an ProgressEvent. if (evt.lengthComputable) { var percentLoaded = Math.round((evt.loaded / evt.total) * 100); // Increase the progress bar length. if (percentLoaded < 100) { progress.style.width = percentLoaded + '%'; progress.textContent = percentLoaded + '%'; } } } function handleFileSelect(evt) { // Reset progress indicator on new file selection. progress.style.width = '0%'; progress.textContent = '0%'; reader = new FileReader(); reader.onerror = errorHandler; reader.onprogress = updateProgress; reader.onabort = function(e) { alert('File read cancelled'); }; reader.onloadstart = function(e) { document.getElementById('progress_bar').className = 'loading'; }; reader.onload = function(e) { // Ensure that the progress bar displays 100% at the end. progress.style.width = '100%'; progress.textContent = '100%'; setTimeout("document.getElementById('progress_bar').className='';", 2000); //$scope.eventbanner = { filename: evt.target.files[0].name, data: evt.target.files[0] } $scope.eventbanner = evt.target.files[0]; //$scope.jsonFILES = ("file", $scope.eventbanner) } /…

http://stackoverflow.com/comment/45123496
has text: After getting your code to run after several fixes, I do understand your downvotes. Still wanted to share the result, as it was already on my screen.
type: Comment
comment on: http://stackoverflow.com/a/28392715
score: 0
type: AnswerComment

file-upload
tags question: http://stackoverflow.com/q/28312079
tags question: http://stackoverflow.com/q/28429068
type: Tag
tags question: http://stackoverflow.com/q/28401944
tags question: http://stackoverflow.com/q/28352617
tags question: http://stackoverflow.com/q/28299593
tags question: http://stackoverflow.com/q/28336358
tag name: file-upload
tags question: http://stackoverflow.com/q/28309068
tags question: http://stackoverflow.com/q/28296289
tags question: http://stackoverflow.com/q/28340619
tags question: http://stackoverflow.com/q/28343061
tags question: http://stackoverflow.com/q/28305349
tags question: http://stackoverflow.com/q/28292816

http://stackoverflow.com/comment/45175731
type: QuestionComment
comment on: http://stackoverflow.com/q/28420920
score: 0
has text: @AvivCohn, yeah Jade is good. Do some research and see which template engine will work best for you. There is Jade, Handlebars, EJS. Jade also runs hand in hand with Stylus, which is a CSS precomplier. If you want to go crazy you could use Less as well and make your whole app server side. Whatever pops your toast
type: Comment

http://stackoverflow.com/comment/44995700
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28322478
has text: Lol ! i mean see update of my question @DaImTo

http://stackoverflow.com/comment/44972505
type: Comment
comment on: http://stackoverflow.com/a/28309845
type: AnswerComment
has text: I always leave room for improvement as it's the point of learning from the answer, i'm glad you're happy with this and it's good to hear helps. I wish you the very best with your project/website.
score: 0

http://stackoverflow.com/comment/45143031
has text: Please post your regex here. I understand you are developing on regexr.com, but it will also help here if you say what language / regex style you are targeting specifically (presuming you want to use it outside of regexr.com).
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28404210

http://stackoverflow.com/q/28297982
has answer: http://stackoverflow.com/a/28307035
has body: The code below does work most of the time, but sometimes it produces zero byte images. I suspect it's the part of the stream where the image is scaled .sample(...). Thanks for any help! function scaleToTargetByInt (width) { var maxWidth = 216 * 2; // 2x thumbnail size optimized for Retina display var originalWidth = width; var scaleInt = Math.floor(maxWidth/originalWidth); var scaleSize = scaleInt * originalWidth; return scaleSize; } var OriginalsStore = new FS.Store.FileSystem("OriginalPix", { path: pathToOriginalsFolder, transformWrite: function (fileObj, readStream, writeStream) { // read image dimensions and write to metadata gm(readStream) .size({bufferStream: true}, FS.Utility.safeCallback(function (err, size) { if (err) { // handle the error } else { fileObj.update({$set: {'metadata.width': size.width, 'metadata.height': size.height}}); } })) // read metadata.width and scale acordingly .sample(scaleToTargetByInt(fileObj.metadata.width)) .stream() .pipe(writeStream); } });
type: UnansweredQuestion
has title: FS.Store unreliable gm image conversion
type: Question
tagged with: javascript
score: 0
tagged with: imagemagick
answer count: 1
tagged with: meteor

jquery-ui-sortable
tags question: http://stackoverflow.com/q/28300583
tag name: jquery-ui-sortable
type: Tag
tags question: http://stackoverflow.com/q/28314306
tags question: http://stackoverflow.com/q/28370225
tags question: http://stackoverflow.com/q/28350165

http://stackoverflow.com/q/28357405
tagged with: javascript
has comment: http://stackoverflow.com/comment/45058180
has comment: http://stackoverflow.com/comment/45058124
has comment: http://stackoverflow.com/comment/45058097
has answer: http://stackoverflow.com/a/28357455
answer count: 1
downvote count: 0
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I am trying to make a website that can be turned to 'dark mode' when a checkbox is selected. I have styled the checkbox to look like a switch. I have it working with some javascript to load an alternate stylesheet 'onChange'. This works fine, the problem is, when you uncheck the box, I would like it to load the original stylesheet again. Any help would be greatly appreciated. I am new to javascript and would like to learn more. The following is my HTML, CSS & Javascript code: Dark Mode /* This is for the dark mode switch */ input.switch:empty { margin-left: -999px; } input.switch:empty ~ label { position: relative; float: left; line-height: 1.6em; text-indent: 4em; margin: 0.2em 0; cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } input.switch:empty ~ label:before, input.switch:empty ~ label:after { position: absolute; display: block; top: 0; bottom: 0; left: 0; content: ' '; width: 3.6em; background-color: #c33; border-radius: 0.3em; box-shadow: inset 0 0.2em 0 rgba(0,0,0,0.3); -webkit-transition: all 100ms ease-in; transition: all 100ms ease-in; } input.switch:empty ~ label:after { width: 1.4em; top: 0.1em; bottom: 0.1em; margin-left: 0.1em; background-color: #fff; border-radius: 0.15em; box-shadow: inset 0 -0.2em 0 rgba(0,0,0,0.2); } input.switch:checked ~ label:before { background-color: #393; } input.switch:checked ~ label:after { margin-left: 2em; } // *** TO BE CUSTOMISED *** var style_cookie_name = "style" ; var style_cookie_duration = 30 ; // *** END OF CUSTOMISABLE SECTION *** // You do not need to customise anything below this line function switch_style ( css_title ) { // You may use this script on your site free of charge provided // you do not remove this notice or the URL below. Script from // http://www.thesitewizard.com/javascripts/change-style-sheets.shtml var i, link_tag ; for (i = 0, link_tag = document.getElementsByTagName("link") ; i < link_tag.length ; i++ ) { if ((link_tag[i].rel.in…
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45058135
accepted answer: http://stackoverflow.com/a/28357455
score: 1
has title: Dark mode switch
upvote count: 1
type: Question

http://stackoverflow.com/a/28295202
has body: Try adding this to your javascript file and it should work fine. $( document ).ready(function() { $("#checkBox_id").click(function() { var isDisabled = $(#checkBox_id).prop('checked') if(isDisabled) { $("#endDate_id").removeAttr("disabled"); } else { $("#endDate_id").prop('disabled', true) } }); });
answers question: http://stackoverflow.com/q/28288816
downvote count: 0
has comment: http://stackoverflow.com/comment/44942900
score: 6
type: Answer
upvote count: 6

http://stackoverflow.com/comment/45071261
comment on: http://stackoverflow.com/a/28364972
score: 0
type: AnswerComment
has text: Thank you, that helps a lot. I'm confused as to the "display the no of remaining characters in the remaining count field". i.e. how does this code link specific to the <input...> area
type: Comment

http://stackoverflow.com/a/28376318
type: Answer
answers question: http://stackoverflow.com/q/28375619
score: 4
upvote count: 4
downvote count: 0
has body: What you have now What you have now is actually pretty nice. Since you're caching the result of asyncInit in a promise and everyone waits for the same promise - it's impossible for any of the code in those functions to run before the promise has finished. function publicMethod_One() { promise // the fact you're starting with `promise.` means it'll wait .then( doStuff ) .catch( reportInitFailure ); } So rather than forcing people to wait in order to use publicMethod_One they already can call it right away and the methods like doStuff will only execute the promise has resolved. A fluid interface Well, like you noticed your code has a major issue, there is no way for a given method to know when to run or a way to sequence methods - you can solve this in two ways: Create a fluid interface that returns this on every action and queues the promise. Return the promise from each async call. Let's look at the two approaches: Fluid interface This means that all your methods return the instance, they must also queue so things don't happen 'at once'. We can accomplish this by modifying promise on each call: function publicMethod_One() { promise = promise // note we're changing it .then( doStuff ) .catch( reportInitFailure ); return this; // and returning `this` } You might also want to expose a .ready method that returns the current promise so the sequence of operations can be waited for from the outside: function ready(){ return this.promise; } This can enable things like: var ready = new WhizBang().publicMethod_One().publicMethod_One().ready(); ready.then(function(){ // whizbang finished all operations }); // can also add error handler Returning thenables In my opinion this is the simpler approach, all your methods return the promise they create so they can individually be waited for: function publicMethod_One() { return promise // note we're returning and not changing it .then( doStuff ) .catch( reportInitFailure ); } This is nice because the async operation is exposed outsid…

http://stackoverflow.com/comment/44932167
comment on: http://stackoverflow.com/q/28287040
has text: Hi Nathan. I am really only interested in the conglomeration of all 5 of them into a paragraph. I would like to take that paragraph object and have it populate the textarea.
score: 0
type: Comment
type: QuestionComment

xsockets.net
type: Tag
tags question: http://stackoverflow.com/q/28416113
tag name: xsockets.net

http://stackoverflow.com/a/28430239
has comment: http://stackoverflow.com/comment/45204168
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/62454735
upvote count: 3
has body: The best way is to use tickPositioner, for example this way: http://jsfiddle.net/t3nr0kgt/2/ tickPositioner: function (min, max) { var axis = this, options = axis.options, // get normalized tick interval normalizedTickInterval = axis.normalizeTimeTickInterval( axis.tickInterval, options.units ), // get default ticks ticks = axis.getTimeTicks( normalizedTickInterval, min, max, options.startOfWeek, axis.ordinalPositions, axis.closestPointRange, true ); // register information for label formatter ticks.info = { higherRanks: normalizedTickInterval.higherRanks, unitName: normalizedTickInterval.unitName }; // replace first label with 2004 year. // When labels overlap, remove for example first two elements (1 change to 2): ticks.splice(0, 1, min); return ticks; } As you can see, that won't preventing labels overlapping so be cautious using this. Another solution is to set min option like you did, but with startOnTick option. But that will create some gap: http://jsfiddle.net/t3nr0kgt/5/
score: 3
has comment: http://stackoverflow.com/comment/45207833
has comment: http://stackoverflow.com/comment/62532596
answers question: http://stackoverflow.com/q/28418999

http://stackoverflow.com/a/28435508
type: Answer
has body: Assuming you meant source... var lastImg = $('.main-img img:last-child').attr('src');
score: 0
answers question: http://stackoverflow.com/q/28435439

http://stackoverflow.com/a/28291831
score: 0
has body: You can try something like this one: fiddle $('.expandable').each(function(){ var s = $(this).width(); $(this).click(function(){ $(this).animate({ 'width' : ($(this).width()==s?s/2:s) }); }); });
type: Answer
answers question: http://stackoverflow.com/q/28291731

http://stackoverflow.com/a/28399870
type: Answer
has body: The messy code I pulled together that is now working: HTML: JavaScript: window.setTimeout(function () { var parent = document.getElementById("really"); var child = document.getElementById("yeah"); parent.removeChild(child); //Do some things... }, 3400);
answers question: http://stackoverflow.com/q/28391800
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28391800

auto-increment
type: Tag
tag name: auto-increment
tags question: http://stackoverflow.com/q/28357965

http://stackoverflow.com/comment/44975652
has text: So why not use CSS, where does that fail for you? (Incidentally, `bgcolor` would be best replaced though the use of CSS, now) And why is there a ` ` element nested inside the single ` ` of another ` `?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28312664
type: QuestionComment

http://stackoverflow.com/a/28371410
has comment: http://stackoverflow.com/comment/45083329
has comment: http://stackoverflow.com/comment/45083439
has body: Why not just set mySecondArray whenever you set myFirstArray? A good tip for setting variables quickly is this syntax: var mySecondArray, myFirstArray; mySecondArray = myFirstArray = ["somevalue"]; In JavaScript, when you set myFirstArray to something like [], and then mySecondArray to myFirstArray, it won't reference the first variable, but both variables will reference the same actual array.
score: 1
has comment: http://stackoverflow.com/comment/45083628
downvote count: 0
has comment: http://stackoverflow.com/comment/45085351
type: Answer
has comment: http://stackoverflow.com/comment/45083412
has comment: http://stackoverflow.com/comment/45085169
answers question: http://stackoverflow.com/q/28371320
upvote count: 1

http://stackoverflow.com/q/28421089
type: Question
type: AnsweredQuestion
tagged with: prototype
has body: If I have a class declared in prototype.js var ClassFoo = Class.create(); ClassFoo.prototype = { initialize: function() { }, type: 'ClassFoo' }; If I declare a method ClassFoo.doBar = function() { log("foobar") } Is it the same as/equivalent to creating a static method in java ? Can an object of classfoo access doBar() ?
has title: Static methods in JavaScript
answer count: 1
tagged with: javascript
tagged with: static
score: 0
accepted answer: http://stackoverflow.com/a/28421163
has answer: http://stackoverflow.com/a/28421163

http://stackoverflow.com/q/28397783
linked to: http://stackoverflow.com/q/13266616
tagged with: javascript
has comment: http://stackoverflow.com/comment/45131353
has answer: http://stackoverflow.com/a/28397950
answer count: 3
upvote count: 1
accepted answer: http://stackoverflow.com/a/28397955
has title: Javascript Path object path into a function and update object
favorite count: 0
has answer: http://stackoverflow.com/a/28397941
linked to: http://stackoverflow.com/q/9179680
has answer: http://stackoverflow.com/a/28397955
type: AnsweredQuestion
has body: I'm working on Javascript and want to pass a object path to the function and update the object. Why would the object not be updated? and is there a slick way of getting it to work besides returning, or besides passing the entire object to the function and specify the path inside? thx var stock={ basket:{ apple:3, orange:2 }, table:{ apple:5, orange:5 } }; function change(path, amount){ path+=amount; } // calling function change (stock.table.apple,-2); console.log(stock.table.apple);
downvote count: 0
score: 1
type: Question
possible better answer: http://stackoverflow.com/a/28397941

http://stackoverflow.com/comment/44978668
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28314391
has text: Also refer:http://docs.phonegap.com/en/2.1.0/guide_plugin-development_index.md.html#Plugin%20Development%20Guide
type: Comment

http://stackoverflow.com/comment/44954948
type: Comment
has text: is this what you want http://jsfiddle.net/5TTm4/2642/?
comment on: http://stackoverflow.com/q/28301027
score: 0
type: QuestionComment

http://stackoverflow.com/q/28409523
has title: TSP calculation using PHP or Javascript
upvote count: 1
type: Question
linked to: http://stackoverflow.com/q/19007033
tagged with: algorithm
has comment: http://stackoverflow.com/comment/45162407
tagged with: javascript
has comment: http://stackoverflow.com/comment/45153373
has body: I have the following problem. I have a set of cities and their corresponding geographical coordinates. What I want to do is to be able to calculate the shortest possible path between them in a round-trip (i.e. no particular start/end point). I have done some research and came across a few solutions, but none of them are applicable. I found that this thing is called a TSP. There is a Google API for optimizing a route between points, but the problem is that I dont want to find a route, this for example doesnt work if you have points one in US and one in Europe, as it just tells you "no route found". I dont want a route I want just a straight line between them to make it the shortest. I also found some HTML5 solutions using genetic algorithms for finding the shortest path between points, but there is a catch. The problem is that such algorithms take into account a set of points in a 2D plane, but obviously, if we are talking about geo coordinates, the point right on the "left" of your map is in fact right next to the point on the "right end" of the map, and they can be connected via this short route - in other words we are talking about the globe, not a plane. Is there any way I could do this? As I said, I dont want any fancy things like route directions etc. Just something that would find the optimal/near optimal order and the distance. I would appreciate any help or hints as to where I could find some more info or how to go about doing this, ideally if you knew about some scripts that I could try to modify and implement, either using PHP or Javascript.
downvote count: 0
has comment: http://stackoverflow.com/comment/45160204
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: php
answer count: 0
type: UnansweredQuestion
score: 1

http://stackoverflow.com/q/28286742
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28313799
type: Question
has body: So I'm using the jQuery.flot library and I get this Invalid dimensions for plot, widht = 700, height = 0 error. So I tried setting the height in javascript before doing the plot and I get a new error options is null Anyone knows what could be the source of that? Here's my main.js: tabs.open({ url: "./stats.html", onReady: function(tab) { tab.attach({ contentScriptFile: [ "./jquery-2.1.3.min.js", "./jquery.flot.min.js", "./jquery.flot.pie.min.js", "./scripts.js" ], contentScriptOptions: { 'logs': ss.storage.logs } }) } }) and in my script.js: $('#today_pie').width('100%').height('500px') $.plot('#today_pie', data, { series: { pie: { innerRadius: 0.5, show: true } } });
score: 1
has title: firefox sdk: problems including jquery.flot, error says dimension height null
upvote count: 1
tagged with: flot
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: firefox-addon-sdk
downvote count: 0

http://stackoverflow.com/q/28361512
type: AnsweredQuestion
tagged with: javascript
has answer: http://stackoverflow.com/a/28474618
upvote count: 2
answer count: 1
has title: Why do I get different results using withMutations?
favorite count: 0
score: 2
downvote count: 0
tagged with: immutable.js
has body: Am I misunderstanding its purpose or how it works? var menuItems = Immutable.List.of( { parent_id: 0, id: 1 }, { parent_id: 1, id: 2 }, { parent_id: 1, id: 3 } ); var results1 = menuItems .filter(function(menuItem) { return menuItem.parent_id === 1; }) // Filter out items with parent_id = 1 .sort(function(childA, childB) { return childA.sort_order - childB.sort_order; }); // Sort them by sort_order var results2 = menuItems.withMutations(function(list) { list .filter(function(menuItem) { return menuItem.parent_id === 1; }) // Filter out items with parent_id = 1 .sort(function(childA, childB) { return childA.sort_order - childB.sort_order; }); // Sort them by sort_order }); console.log(results1.size); // 2 console.log(results2.size); // 3 My understanding is that they would yield the same results, but that withMutations would be faster due to the chaining of operations.
accepted answer: http://stackoverflow.com/a/28474618
type: Question

http://stackoverflow.com/q/28386494
score: 2
downvote count: 0
tagged with: properties
tagged with: object
type: AnsweredQuestion
type: Question
upvote count: 2
answer count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28386886
accepted answer: http://stackoverflow.com/a/28386886
has body: In this example, how would I add a default foobar: function() {} property to each object inside of Foo? Foo = { bar1: { foobar: function() {}, width: "10m" }, bar2: { foobar: function() {}, width: "20m" } }
has title: Adding a property to every object property of an object in Javascript

http://stackoverflow.com/q/28404752
favorite count: 0
has title: Jspdf Alignment/ layout not working
has answer: http://stackoverflow.com/a/28469113
tagged with: pdf-generation
type: AnsweredQuestion
score: 2
upvote count: 2
type: Question
accepted answer: http://stackoverflow.com/a/28469113
tagged with: javascript
tagged with: jspdf
answer count: 1
downvote count: 0
has body: I am doing an HTML to pdf conversion with jspdf Here is my running code... http://codepen.io/anon/pen/dPZaYN You can see the output (below) is different from the PDF..There are no borders and alignment. I am not able to achieve simple layout / alignment , padding/float etc.. This is how it should look (you can also see here my Html code) http://screencast.com/t/xE6fbJKrA9m But when i Get the pdf of this from jspdf it looks like this http://screencast.com/t/z8cizeY9 This is my jspdf Code .. var doc = $wnd.jsPDF('p', 'pt', 'a4', true); var source = $('#content').first(); var specialElementHandlers = { '#bypassme': function (element, renderer) { return true; } }; doc.fromHTML( htmltest, { 'elementHandlers': specialElementHandlers }); doc.save('Test.pdf'); This is my head

http://stackoverflow.com/comment/45127375
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28394409
has text: Use some maths to get from `-0.04` to `1`, from `-0.038` to `2`, from `-0.036` to `3` etc. You'll notice the pattern.
type: QuestionComment

http://stackoverflow.com/comment/45148329
has text: thanks for the tip @KevinB will amend
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28371032
type: QuestionComment

http://stackoverflow.com/a/28312452
has comment: http://stackoverflow.com/comment/44975453
has comment: http://stackoverflow.com/comment/55083268
has comment: http://stackoverflow.com/comment/44975428
type: Answer
has comment: http://stackoverflow.com/comment/44975409
has comment: http://stackoverflow.com/comment/44975572
has comment: http://stackoverflow.com/comment/44975582
has comment: http://stackoverflow.com/comment/55089548
has comment: http://stackoverflow.com/comment/44975465
has comment: http://stackoverflow.com/comment/55088214
has comment: http://stackoverflow.com/comment/55088167
has comment: http://stackoverflow.com/comment/44975333
has comment: http://stackoverflow.com/comment/55083356
has comment: http://stackoverflow.com/comment/44975728
answers question: http://stackoverflow.com/q/28312326
has comment: http://stackoverflow.com/comment/44975484
has comment: http://stackoverflow.com/comment/55083204
has comment: http://stackoverflow.com/comment/44975706
score: 0
has comment: http://stackoverflow.com/comment/55091997
has body: change it to: $( ".container" ).prepend( " " + " " + "or Watch our Video " );
has comment: http://stackoverflow.com/comment/44975522

http://stackoverflow.com/a/28326646
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45001687
upvote count: 5
type: Answer
has comment: http://stackoverflow.com/comment/45001665
accepted answer of: http://stackoverflow.com/q/28326555
answers question: http://stackoverflow.com/q/28326555
has comment: http://stackoverflow.com/comment/45001507
downvote count: 0
score: 5
has comment: http://stackoverflow.com/comment/45001413
has body: What you've posted is two And here's the second one: The appearance of the string ends a script block regardless of the JavaScript context it appears in. As to your broader question, yes, you have to sanitize user-supplied text when including it in a JavaScript context. The simplest way to do that is to use a JSON encoder. JSON encoders generally include / in the list of characters that must be quoted with \ inside JavaScript string constants. That feature would have protected you because would be rendered as <\/script>. Any JSON expression is a valid JavaScript object initializer string (or, if a JSON encoder is asked to encode a primitive string, a valid string constant). Finally, always applying HTML encoding is definitely not what you should do if you want your application to work properly. The type of sanitization that must be applied to user-supplied text depends on the syntax of the parser to which it's being fed. You apply different sanitization for SQL, for server-side log files, for HTML, and for JavaScript.

http://stackoverflow.com/comment/45142850
comment on: http://stackoverflow.com/q/28402944
has text: can we see more code? `person-entry` component for example? the definition of `user` model might be helpful as well
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/28332205
upvote count: 1
has comment: http://stackoverflow.com/comment/45042807
has comment: http://stackoverflow.com/comment/45072378
downvote count: 0
answers question: http://stackoverflow.com/q/28285623
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28285623
has comment: http://stackoverflow.com/comment/45051126
has comment: http://stackoverflow.com/comment/45075622
has comment: http://stackoverflow.com/comment/45043494
type: Answer
score: 1
has body: It sounds like you never joined the room. The documentation gives this code right before the code you have in your question: io.on('connection', function(socket) { socket.join('some room'); }); Another this is that code shouldn't return any value (as far as I'm aware of), so with no return value it would return undefined. Edit: to switch, you use this syntax: socket.leave('some room'); socket.join('another room');

http://stackoverflow.com/q/28330837
tagged with: angularjs
has comment: http://stackoverflow.com/comment/62733010
has comment: http://stackoverflow.com/comment/46156838
tagged with: angular-resource
has comment: http://stackoverflow.com/comment/47226827
has body: One of the things about Angular that's both a feature and a point of complexity, is that it's not very opinionated about how to interact with a RESTful API. I know about $resource, Restangular, and various ideas you can find on rolling your own. In a complex application that's got a large number of resources, including various nestings, there's reason to think that Restangular's superior to $resource; for similar reasons, also that Restangular's better than rolling your own. One solution that I haven't seen until recently is JSData and its wrapper for AngularJS (repo). Judging from the number of favorites on Github (~900), it has a decent number of people at least interested in it, if not using it. It's only a fraction of the following that Restangular has on Github (5k+), but still significant. For those who have used both Restangular and JSData, what's your take on how they compare (strengths/weaknesses; differences in purpose, reliability, etc.; things that may not be readily apparent from the docs)? For this question to remain open, please stick to facts rather than opinions. My impressions from what I've read are the following: Restangular (+) Big mindshare (+) Highly customizable (-) Focus seems to be on the actual interaction with the RESTful API only, rather than also being opinionated/acting as a data store once it's returned (please correct me if I'm wrong). Granted, this could be considered a feature, in the same way Angular's lack of opinion is a feature. I'm putting this is as a disadvantage for now, though, because of the additional legwork this means for the developer to come up with their own solution. JSData (+) Works not only with REST, but localStorage, localforage, Firebase, etc, including custom adapters (+) Designed as a cached data store to not have to repeat HTTP calls (to be fair, caching is also an option with Restangular, though perhaps less intertwined/critical to its mission) (-) Not as large a following, although the developer does seem…
tagged with: restangular
has comment: http://stackoverflow.com/comment/45015408
has title: Comparison of Restangular vs. JSData (formerly Angular-data)
score: 30
has comment: http://stackoverflow.com/comment/86092327
has comment: http://stackoverflow.com/comment/45015861
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45015640
has comment: http://stackoverflow.com/comment/47231606
tagged with: angular-data
has comment: http://stackoverflow.com/comment/46157612
has comment: http://stackoverflow.com/comment/45015809
type: Question
has comment: http://stackoverflow.com/comment/45015608
has comment: http://stackoverflow.com/comment/47493578
has comment: http://stackoverflow.com/comment/45015759
linked to: http://stackoverflow.com/q/2190836
downvote count: 1
tagged with: javascript
favorite count: 0
upvote count: 31
has comment: http://stackoverflow.com/comment/45044000

http://stackoverflow.com/a/28407513
has body: var strList = function (callback){ var listItems= ""; $.ajax({ url: 'http://localhost:8088/api/v1/ui/performance/custom_link_groups?', dataType: 'json', async: false, success: function(data){ for (var i = 0; i &lt; data.data.length; i++){ _getJsonObject(data.data[i].$ID,data.data[i].$userId, function(data) { data.data[i].children = data; }); } callback(data); } }); return listItems; }(); function _getJsonObject(id,user, callback){ var rdata = ""; $.ajax({ url: 'http://localhost:8088/api/v1/ui/performance/custom_links?group='+id+'&amp;user='+user, dataType: 'json', async: false, success: function(data){ callback(data.data); } }); return rdata; }
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28406536

http://stackoverflow.com/q/28398274
tagged with: charts
has body: Fiddle Example I'd like to know how to add an arrowhead marker to the symbol marker in bullet chart to make it clear what it means, sort of like this: I've tried adding this block of code to the bullet function,but it is nowhere to be seen: marker.enter().append("line") .attr("class", "marker") .attr("marker-start","url(#avg)") .attr("x1", x0) .attr("x2", x0) .attr("y1", height / 6) .attr("y2", height * 5 / 6) g.append("svg:defs") .append("svg:marker") .attr("id", "avg") .attr("viewBox", "0 5 10 10") .attr("refX", 340) .attr("refY", 1) .attr("markerWidth", 6) .attr("markerHeight", 6) .attr("orient", "auto") .append("svg:path") .attr("d", "M0,-5L10,0L0,5"); Can anyone show me how to add an arrow marker? Here's the code: (function() { // Chart design based on the recommendations of Stephen Few. Implementation // based on the work of Clint Ivy, Jamie Love, and Jason Davies. // http://projects.instantcognition.com/protovis/bulletchart/ d3.bullet = function() { var orient = "left", // TODO top &amp; bottom reverse = false, duration = 0, ranges = bulletRanges, markers = bulletMarkers, measures = bulletMeasures, width = 380, height =100, tickFormat = null; // For each small multiple… function bullet(g) { g.each(function(d, i) { var rangez = ranges.call(this, d, i).slice().sort(d3.descending), markerz = markers.call(this, d, i).slice().sort(d3.descending), measurez = measures.call(this, d, i).slice().sort(d3.descending), g = d3.select(this); // Compute the new x-scale. var x1 = d3.scale.linear() .domain([0, Math.max(rangez[0], markerz[0], measurez[0])]) .range(reverse ? [width, 0] : [0, width]); // Retrieve the old x-scale, if this is an update. var x0 = this.__chart__ || d3.scale.linear() .domain([0, Infinity]) .range(x1.range()); // Stash the new scale. this.__chart__ = x1; // Derive width-scales from the x-scales. var w0 = bulletWidth(x0), w1 = bulletWidth(x1); // Update the range rects. var range = g.selectAll("rect.range") .data(rangez).enter() var range2 = range.appen…
tagged with: javascript
has title: How to add an arrow to the marker in buller chart using d3
score: 0
has comment: http://stackoverflow.com/comment/45144951
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45143518
has comment: http://stackoverflow.com/comment/45146209
answer count: 0
type: Question

http://stackoverflow.com/q/28330476
upvote count: 2
has comment: http://stackoverflow.com/comment/72817805
has answer: http://stackoverflow.com/a/42855401
answer count: 1
downvote count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: video
score: 1
has body: I have a website that has one of those annoying autoplay looping background videos that just play over and over forever instead of using just a picture. I was wondering if it would lighten the resource load on our users machines if I paused the video when they are not looking at my page through the new page visibility API? To all the geniuses on this site, I would love to see an answer that shows how you determined your answer. I am sort of new to the front-end world and I'm not sure how I would figure this question out.
type: Question
tagged with: javascript
has title: Pause HTML5 video to lighten resource load?

http://stackoverflow.com/q/28349546
tagged with: angularjs
has title: AngularJS Directive muddles with CSS class
linked to: http://stackoverflow.com/q/17154299
tagged with: css
answer count: 0
type: UnansweredQuestion
upvote count: 1
type: Question
score: 1
has body: I have an input form that I'm trying to add text tags to it (https://github.com/alexgorbatchev/jquery-textext) are the tags I'm adding. I've added a directive in to add the behavior: angular.module('tags', []) .directive('tags', function(){ return { restrict: 'A', require: 'ngModel', link: function(scope, el, attrs, ngModel){ scope.$watch(attrs.ngModel, function(value){ if (value){ console.log("value changed, new value is: " + value); el.val(value); } }); el.textext({ plugins: 'tags', }); } }; }); However, in the input form itself, Ive tried adding a bootstrap form class to the input &lt;input type="text" class="form-control" tags ng-model="extraTags"&gt; And as soon as I add the class form-control, the input shrinks to size 0 and I can't even see it. I've tested this out with other css added for classes, and it seems that the directive erases everything and makes it a normal input form, or worse, a non-existent, super small input form. I know angular runs through the items on the page and then modifies them, and I'm thinking this happens after the css has been added. This answer doesn't work: Directives messed up styling, AngularJS by adding a replace: true Any ideas? Thanks!
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45042949
favorite count: 0

http://stackoverflow.com/comment/45185931
comment on: http://stackoverflow.com/a/28414814
type: Comment
has text: Thanks all for your answers. Sorry i didn't make myself clear enough, english isn't my first language. Tambo did get what I meant, code is great. However there's something I forgot... An can be sometimes placed before the list, and should not be counted as an element. Any idea how to proceed ?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44937269
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28292024
has text: try this : http://stackoverflow.com/a/11186765/2000051

http://stackoverflow.com/a/28411451
has body: You should pass the identity of a screen element (e.g. #container) to the html2canvas function. For example: $('#goButton').click(function() { html2canvas($('#container'), { onrendered: function(canvas) { myImage = canvas.toDataURL("image/png"); $('#image').append(canvas); } }); }); #container { width: 300px; height: 200px; border: 2px solid #888888; overflow: scroll; padding: 5px; } Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed et ex neque. Vivamus vulputate libero magna, quis porttitor libero faucibus eu. Aenean pharetra eleifend leo nec varius. In facilisis enim quis tellus egestas, ut euismod orci eleifend. Vestibulum eget enim dapibus, sollicitudin ante a, bibendum purus. Fusce nec condimentum sapien. Aliquam lacus mauris, iaculis iaculis elit vel, tincidunt dapibus neque. Snap Just position the element wherever you want it. You should note that html2canvas doesn't actually do a screen shot - it actually renders the element (and all child elements and CSS), so you can't just specify an area of the screen.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28410221

http://stackoverflow.com/comment/45237387
type: AnswerComment
comment on: http://stackoverflow.com/a/28435718
has text: Ok so I will have to use a different icon for each color. Thanks !
type: Comment
score: 0

http://stackoverflow.com/comment/45161733
score: 1
comment on: http://stackoverflow.com/q/28412671
has text: I haven't tested this thoroughly but take a look, at worst you could use it for further questions. http://jsfiddle.net/Xotic750/uysk5jpm/
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28316657
has answer: http://stackoverflow.com/a/42294108
upvote count: 2
has answer: http://stackoverflow.com/a/72984014
type: AnsweredQuestion
score: 2
has title: How to throw error when accessing non existent property of JavaScript object
has answer: http://stackoverflow.com/a/28316721
has body: Is there any way in JavaScript to throw an error when I'm trying to access non existent object property? inst.prop //Error
type: Question
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44982328
answer count: 3
accepted answer: http://stackoverflow.com/a/28316721
linked to: http://stackoverflow.com/q/6511542
possible better answer: http://stackoverflow.com/a/42294108
favorite count: 0

http://stackoverflow.com/q/28421505
favorite count: 0
tagged with: database-schema
has title: Followers - mongodb database design
has answer: http://stackoverflow.com/a/28560611
possible better answer: http://stackoverflow.com/a/28533808
linked to: http://stackoverflow.com/q/3298963
answer count: 4
tagged with: database-performance
has answer: http://stackoverflow.com/a/28557697
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/28406131
has answer: http://stackoverflow.com/a/28585424
type: Question
has comment: http://stackoverflow.com/comment/45252704
score: 12
tagged with: mongodb
has comment: http://stackoverflow.com/comment/45464014
has body: So I'm using mongodb and I'm unsure if I've got the correct / best database collection design for what I'm trying to do. There can be many items, and a user can create new groups with these items in. Any user may follow any group! I have not just added the followers and items into the group collection because there could be 5 items in the group, or there could be 10000 (and the same for followers) and from research I believe that you should not use unbound arrays (where the limit is unknown) due to performance issues when the document has to be moved because of its expanding size. (Is there a recommended maximum for array lengths before hitting performance issues anyway?) I think with the following design a real performance issue could be when I want to get all of the groups that a user is following for a specific item (based off of the user_id and item_id), because then I have to find all of the groups the user is following, and from that find all of the item_groups with the group_id $in and the item id. (but I can't actually see any other way of doing this) Follower .find({ user_id: "54c93d61596b62c316134d2e" }) .exec(function (err, following) { if (err) {throw err;}; var groups = []; for(var i = 0; i&lt;following.length; i++) { groups.push(following[i].group_id) } item_groups.find({ 'group_id': { $in: groups }, 'item_id': '54ca9a2a6508ff7c9ecd7810' }) .exec(function (err, groups) { if (err) {throw err;}; res.json(groups); }); }) Are there any better DB patterns for dealing with this type of setup? UPDATE: Example use case added in comment below. Any help / advice will be really appreciated. Many Thanks, Mac
upvote count: 12
downvote count: 0
has comment: http://stackoverflow.com/comment/45199257
has comment: http://stackoverflow.com/comment/45203293
has answer: http://stackoverflow.com/a/28533808
accepted answer: http://stackoverflow.com/a/28585424
tagged with: javascript
tagged with: database-design

http://stackoverflow.com/a/28424801
has body: I have created a jsbin for your solution http://jsbin.com/coforebezo/1/edit?html,js,output You have to use embed script for your video to hide the social icons. If you want to more customize the video, please refer the documentations http://wistia.com/doc/embed-options#socialbar_plugin
has comment: http://stackoverflow.com/comment/45222999
has comment: http://stackoverflow.com/comment/45182548
has comment: http://stackoverflow.com/comment/45182223
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45223634
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28424531
has comment: http://stackoverflow.com/comment/45182169
accepted answer of: http://stackoverflow.com/q/28424531
has comment: http://stackoverflow.com/comment/45182335

http://stackoverflow.com/a/28391182
downvote count: 0
score: 1
type: Answer
answers question: http://stackoverflow.com/q/28343748
upvote count: 1
has body: I moved the window.print() command on the pop up window it self so it can load the jquery function first before printing. This is the line that I added. mywindow.document.write('

http://stackoverflow.com/comment/45174690
has text: I did what you said but nothing shows up
comment on: http://stackoverflow.com/q/28420080
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45144266
comment on: http://stackoverflow.com/a/28404967
type: AnswerComment
score: 0
type: Comment
has text: im sorry it fix everything i just had wrong alert..when i change `isset` to `!empty` it is fixed it behaves like what i want it to.. @RoryMcCrossan what is the difference between `isset` and `!empty`

http://stackoverflow.com/comment/45202230
type: QuestionComment
comment on: http://stackoverflow.com/q/28435865
has text: An aside: http://www.w3.org/TR/WCAG10-CORE-TECHS/#auto-page-refresh
score: 0
type: Comment

http://stackoverflow.com/comment/45082806
comment on: http://stackoverflow.com/q/28369798
type: QuestionComment
type: Comment
has text: You could also just register an equals function `Template.registerHelper('equals', function(a, b) {return a===b;})`, but I like Peppe L-G's idea of registering underscore better.
score: 0

http://stackoverflow.com/q/28294404
has comment: http://stackoverflow.com/comment/44941792
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
linked to: http://stackoverflow.com/q/19164436
possible better answer: http://stackoverflow.com/a/28294676
has comment: http://stackoverflow.com/comment/44941624
favorite count: 0
has comment: http://stackoverflow.com/comment/44941714
has comment: http://stackoverflow.com/comment/44941575
has answer: http://stackoverflow.com/a/28294929
tagged with: css
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/28294656
type: Question
has title: How to achieve read More functionality with single div only
tagged with: javascript
tagged with: jquery
has body: This is my content containing some general large text to display ... 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 How can I achieve read more functionality of expanding content on clicking (...) without any other nested Divs or Tags "Just Single Div" Thanks in advance
has answer: http://stackoverflow.com/a/28294676
has answer: http://stackoverflow.com/a/28294656
upvote count: 2
has comment: http://stackoverflow.com/comment/44941670
answer count: 3

http://stackoverflow.com/comment/45132180
has text: This function of mine, animates the rectangle to a width of 300. After that, the animation stops. Also the user clicks on the rectangle, it makes it call another function which draws another rectangle. When I recall draw(), the rectangle stays 300 and I want it to reset the width of the rectangle, like the draw() function was called for the first time. How can I solve this?
comment on: http://stackoverflow.com/q/28386502
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28373585
type: AcceptedAnswer
has body: It's not a good idea to use hover click because Facebook has a comment section where the keypress will be recorded while you are typing comments - but if you are using some rare keystrokes it may be fine. Additionally, the like button on Facebook is achieve by the span in the a tag, not the a tag itself, so the code you need is: $(window).keypress(function(e){ if (e.keyCode == 108) { $('._4-u2:hover .UFILikeLink span').click(); } }); Now, if you do need to click the a tag in the future here are the codes you need: First, generate fake browser click: ;(function( $, undefined ) { var rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|contextmenu)|click/; $.fn.simulate = function( type, options ) { return this.each(function() { new $.simulate( this, type, options ); }); }; $.simulate = function( elem, type, options ) { var method = $.camelCase( "simulate-" + type ); this.target = elem; this.options = options; if ( this[ method ] ) { this[ method ](); } else { this.simulateEvent( elem, type, options ); } }; $.extend( $.simulate, { keyCode: { BACKSPACE: 8, COMMA: 188, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, LEFT: 37, NUMPAD_ADD: 107, NUMPAD_DECIMAL: 110, NUMPAD_DIVIDE: 111, NUMPAD_ENTER: 108, NUMPAD_MULTIPLY: 106, NUMPAD_SUBTRACT: 109, PAGE_DOWN: 34, PAGE_UP: 33, PERIOD: 190, RIGHT: 39, SPACE: 32, TAB: 9, UP: 38 }, buttonCode: { LEFT: 0, MIDDLE: 1, RIGHT: 2 } }); $.extend( $.simulate.prototype, { simulateEvent: function( elem, type, options ) { var event = this.createEvent( type, options ); this.dispatchEvent( elem, type, event, options ); }, createEvent: function( type, options ) { if ( rkeyEvent.test( type ) ) { return this.keyEvent( type, options ); } if ( rmouseEvent.test( type ) ) { return this.mouseEvent( type, options ); } }, mouseEvent: function( type, options ) { var event, eventDoc, doc, body; options = $.extend({ bubbles: true, cancelable: (type !== "mousemove"), view: window, detail: 0, screenX: 0, screenY: 0, clientX: 1, clientY: 1, ctrlKey…
accepted answer of: http://stackoverflow.com/q/28372663
type: Answer
answers question: http://stackoverflow.com/q/28372663
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/q/28294933
score: 1
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I have some questions about working with smil SVG animations and changing stuff with javascript/jquery otf. Here is what I already tried: HTML/XML: <g id="story_1"> <animate id="story_1_1_1" attributeName="d" from="M200,100l0,0" to="M200,100l0,380" dur="1s" begin="0s;story_1_1_2.end" end="" /> <animate id="story_1_1_2" attributeName="d" from="M200,100l0,380" to="M200,100l0,0" dur="1s" begin="story_1_1_1.end" end="" /> <animate id="story_1_2_1" attributeName="d" from="M200,500l0,0" to="M200,500l0,-380" dur="1s" begin="story_1_1_1.begin+1s;story_1_2_2.end" end="" /> <animate id="story_1_2_2" attributeName="d" from="M200,500l0,-380" to="M200,500l0,0" dur="1s" begin="story_1_2_1.end" end="" /> <g/> <g id="story_2"> <animate id="story_2_1_1" attributeName="stroke-dashoffset" from="795.8291015625" to="-795.8291015625" dur="2s" begin="" calcMode="spline" keySplines=".28 .25 .265 .25" keyTimes="0;1" end="" /> <animate id="story_2_1_2" attributeName="stroke-dashoffset" from="795.8291015625" to="0" dur="1s" begin="" calcMode="spline" keySplines=".28 .25 .265 .25" keyTimes="0;1" end="" /> <g/> JS/jQuery: on in this case key press event do the following: document.getElementById( 'story_1_1_1' ).attributes[ 5 ].value = ''; document.getElementById( 'story_1_1_1' ).attributes[ 6 ].value ='story_1_1_1.end'; document.getElementById( 'story_1_2_1' ).attributes[ 6 ].value ='story_1_2_1.end'; document.getElementById( 'story_2_1_1' ).attributes[ 5 ].value= 'story_1_1_2.end;story_2_1_1.end'; Admired Result: I'd like to achieve: having an animation loop running constantly animating on event trigger (e.g. click, keypress, ...) end the current running animation at the end of the current iteration on end of first animation start the second one (- repeat for more animations) (- ideally doing the same thing reverse: going from animation 2 to 1) Actual Result: What happens so far: animation 1 loop works fine on key press: case 1 (you pressed while the top line is going down): It works case 2 (y…
tagged with: http://stackoverflow.com/tag/svg
type: UnansweredQuestion
upvote count: 1
tagged with: smil
has answer: http://stackoverflow.com/a/32275508
has title: SVG animation with SMIL

http://stackoverflow.com/a/28309106
has comment: http://stackoverflow.com/comment/118878134
type: AcceptedAnswer
upvote count: 13
type: Answer
has comment: http://stackoverflow.com/comment/64638624
has body: This issue occurs because the #width_tmp is nested under .input-group-btn so it inherits the font-size: 0; property from bootstrap. Therefore, the calculated width of the element is always zero: To fix this, just move the so it's not inside the input group. Pure JS Solution // resize on initial load document.querySelectorAll("select").forEach(resizeSelect) // delegated listener on change document.body.addEventListener("change", (e) => { if (e.target.matches("select")) { resizeSelect(e.target) } }) function resizeSelect(sel) { let tempOption = document.createElement('option'); tempOption.textContent = sel.selectedOptions[0].textContent; let tempSelect = document.createElement('select'); tempSelect.style.visibility = "hidden"; tempSelect.style.position = "fixed" tempSelect.appendChild(tempOption); sel.after(tempSelect); sel.style.width = `${+tempSelect.clientWidth + 4}px`; tempSelect.remove(); } Demo in jsFiddle and Stack Snippets // resize on initial load document.querySelectorAll("select").forEach(resizeSelect) // delegated listener on change document.body.addEventListener("change", (e) => { if (e.target.matches("select")) { resizeSelect(e.target) } }) function resizeSelect(sel) { let tempOption = document.createElement('option'); tempOption.textContent = sel.selectedOptions[0].textContent; let tempSelect = document.createElement('select'); tempSelect.style.visibility = "hidden"; tempSelect.style.position = "fixed" tempSelect.appendChild(tempOption); sel.after(tempSelect); sel.style.width = `${+tempSelect.clientWidth + 4}px`; tempSelect.remove(); } Some longer option Short option An very long option with a lot of text Short option 2 Some longer option 2 An very long option with a lot of text 2 jQuery Plugin Solution Another alternative would be to use a plugin to handle the whole operation start to finish. Here's one I just whipped up. The plugin dynamically creates and destroys the span so it doesn't clutter up your html. This helps separate concerns and lets you d…
has comment: http://stackoverflow.com/comment/117119349
has comment: http://stackoverflow.com/comment/124394551
score: 13
accepted answer of: http://stackoverflow.com/q/28308103
has comment: http://stackoverflow.com/comment/118878128
has comment: http://stackoverflow.com/comment/118851956
has comment: http://stackoverflow.com/comment/118877457
answers question: http://stackoverflow.com/q/28308103
downvote count: 0
has comment: http://stackoverflow.com/comment/67907519

eventtrigger
tags question: http://stackoverflow.com/q/28302638
tag name: eventtrigger
type: Tag
tags question: http://stackoverflow.com/q/28433758

http://stackoverflow.com/q/28311957
type: Question
tagged with: javascript
has body: I have a page written in HTML and PHP that attempts to load a youtube player with a custom id using the Youtube IFrame API. In my code, the div with the id player should hold the youtube player. my HTML: <?php include("server/session.php"); ?> MuSync - Player head The other part of my code resides in getvideo.js, and it is as follows: var vidId; var time; var video; $(function(){ var id = getUrlParameter('id'); var jqxhr = $.ajax("server/getvideo.php?id=" + id) .done(function(response){ var json = jQuery.parseJSON(response); vidId = json['url']; time = json['time']; }) .fail(function(){ alert("Action Failed..."); }); }); function onYouTubeIframeAPIReady(){ video = new YT.Player('player', { height: '390', width: '640', videoId: vidId, playerVars: {'autoplay': 1, 'start': time} }); } When trying to use the seekTo function in my main HTML page, the youtube player simply won't load any video and show me an error message. My final goal is to get every once in a while the current time that the video is playing in, but I can't seem to get the API running... Any help would be very appreciated.
score: 0
has comment: http://stackoverflow.com/comment/44974551
has comment: http://stackoverflow.com/comment/44974647
tagged with: jquery
tagged with: ajax
has title: Youtube API fails to load with AJAX
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/44974533
answer count: 0
has comment: http://stackoverflow.com/comment/44974519
tagged with: youtube-api
has comment: http://stackoverflow.com/comment/44974567

http://stackoverflow.com/comment/45084024
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28371657
has text: yeah, explain how/if the pages are visible at the same time for better answers. Otherwise, refer to PeterKA's comment.
type: Comment

http://stackoverflow.com/q/28395461
has comment: http://stackoverflow.com/comment/45128295
type: Question
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/45127155
score: 0
has comment: http://stackoverflow.com/comment/45128285
accepted answer: http://stackoverflow.com/a/28396128
has comment: http://stackoverflow.com/comment/45128204
has comment: http://stackoverflow.com/comment/45127544
has title: Trying to execute code on device ready
tagged with: cordova
possible better answer: http://stackoverflow.com/a/28729846
has answer: http://stackoverflow.com/a/28729846
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28396128
has body: I am trying to execute some Javascript code on deviceready by using a listener. It doesn't seem to be calling the code - I'm getting nothing in my console, and none of the variables are set. This is the code example I'm using: &lt;script&gt; // Cordova is ready function onDeviceReady() { var db = window.sqlitePlugin.openDatabase({name: "my.db"}); db.transaction(function(tx) { tx.executeSql('DROP TABLE IF EXISTS test_table'); tx.executeSql('CREATE TABLE IF NOT EXISTS test_table (id integer primary key, data text, data_num integer)'); tx.executeSql("INSERT INTO test_table (data, data_num) VALUES (?,?)", ["test", 100], function(tx, res) { console.log("insertId: " + res.insertId + " -- probably 1"); console.log("rowsAffected: " + res.rowsAffected + " -- should be 1"); tx.executeSql("select count(id) as cnt from test_table;", [], function(tx, res) { console.log("res.rows.length: " + res.rows.length + " -- should be 1"); console.log("res.rows.item(0).cnt: " + res.rows.item(0).cnt + " -- should be 1"); }); }, function(e) { console.log("ERROR: " + e.message); }); }); } // Wait for Cordova to load document.addEventListener("deviceready", onDeviceReady, false); &lt;/script&gt; Now, I'm not primarily a Javascript developer (so this question may be simple), but is there some reason why the code is not executing? Do I have to run it in an anonymous function? How do I get the onDeviceReady() function to execute?

http://stackoverflow.com/a/28346630
upvote count: 1
has comment: http://stackoverflow.com/comment/45037575
type: Answer
downvote count: 1
answers question: http://stackoverflow.com/q/28346414
has body: make the image a child element of the a tag, otherwise you cannot hover with css. than set the position from the image as you wish. img{ position: absolute; opacity:0; transition: opacity 0.5s ease-in-out; } a:hover image{ opacity:1; } if it is not possible to make the image a child of the a tag than you have to use jquery. $('a').mouseenter(function(){ $('img').addClass('opacity') }); $('a').mouseleave(function(){ $('img').removeClass('opacity') }); css should stay the same except for a:hover image{ opacity:1; } you make: .opacity{ opacity:1; } greetings timotheus
has comment: http://stackoverflow.com/comment/45080861
has comment: http://stackoverflow.com/comment/45037918
score: 0

http://stackoverflow.com/a/28339390
has comment: http://stackoverflow.com/comment/45026051
has comment: http://stackoverflow.com/comment/45025971
answers question: http://stackoverflow.com/q/28337988
score: 0
has body: Try this, not tested: var model = { person: $("form").serialize(), values: list }; $.ajax({ type: "POST", url: "/umbraco/Surface/HomeSurface/FormData", data: JSON.stringify(model), traditional: true, success: function (data) { //alert("ajax request to server succeed"); } });
type: Answer

http://stackoverflow.com/q/28372814
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I am working on PHP Phalcon. I have a view with a table. The table has a dynamic number of rows. I want to click on a row and get the value in the first column. Here is my html table: <?php $counter = count($prescriptions); $i = 0; if ($counter == 0 ) { echo "You have no earlier prescriptions." ;} else { ?> ID Doctor ID Patient Name Ailment Date <?php While ($i < $counter) { ?> <?php echo $prescriptions[$i]->ID; ?> <?php echo $prescriptions[$i]->Doctor_ID; ?> <?php echo $patient_name; ?> <?php echo $prescriptions[$i]->Ailment; ?> <?php echo $prescriptions[$i]->Date_; ?> <?php $i++; } } ?> Here is the associated Action Method: public function PrescriptionTableAction(){ //Select the earlier prescriptions of the online patient. $current_PID = $this->session->current_patient_ID; $get_prescriptions = "Select Doctor_ID,Patient_ID,Ailment,ID,Date_ from Prescriptions where Patient_ID = '$current_PID'"; $this->view->prescriptions = $this->modelsManager->executeQuery($get_prescriptions); $this->view->patient_name = $this->session->current_patient->Full_Name; } What I want to do: In abstraction, when I click on a row in the table, it opens up a view of the complete prescription with the names of the medicines and the instructions for each medicine, the name of the doctor who wrote the prescription and so on. More specifically, when I click on a row, I want to get the value of the row from the "ID" column. (It corresponds to the primary key in the database of the prescriptions table). I want to pass this value to another action method in the same controller where the details of the prescription can be fetched from the database and then displayed in the corresponding view. I have read similar problems and solutions on this website, but almost all solutions have offered "alerts". I want to pass the value back to the controller, how can I do that?
has comment: http://stackoverflow.com/comment/45086373
type: UnansweredQuestion
has title: Get The First Value In A Row "On Clicking" And Pass To Controller
tagged with: php
has comment: http://stackoverflow.com/comment/45087864
has comment: http://stackoverflow.com/comment/45086461
tagged with: mysql
has comment: http://stackoverflow.com/comment/45088100
type: Question
has answer: http://stackoverflow.com/a/28374522
tagged with: javascript
score: 0
tagged with: phalcon

http://stackoverflow.com/q/28323906
tagged with: ajax
has title: JSON Stringify & AJAX parse errors
tagged with: php
has answer: http://stackoverflow.com/a/28324068
type: AnsweredQuestion
score: 1
has body: I have been at this for hours trying everything I could possibly find suggested on the web, however it continues to fail. When I encode function parameters with JSON.stringify and then pass it to my PHP handler via AJAX, I am getting an Alert pop-up saying parsererror. It is apparently an issue within the Javascript but I cannot determine where at this point. Can anyone perhaps spot what I am doing wrong here? // JSON Encode to pass via AJAX to PHP var params = { "id": player }; var params2 = JSON.stringify(params); // {"id":"939952da-23df-4ff1-b66c-61018b621645"} console.log(params2); cellOptions.innerHTML = " Kick "; AJAX function sendAction(cmd, params) { $.ajax({ type: "POST", url: "handler.php", data: { 'action': cmd, 'params': params }, dataType: 'json', success: function(data) { if (data['status'] == 'failed') { } else if (data['status'] == 'success') { } }, error: function(XMLHttpRequest, textStatus, errorThrown) { alert("Status: " + textStatus); alert("Error: " + errorThrown); alert("Message: " + XMLHttpRequest.responseText); } }); };
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/44995708
upvote count: 1
has comment: http://stackoverflow.com/comment/44995659
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28324014
accepted answer: http://stackoverflow.com/a/28324068
has comment: http://stackoverflow.com/comment/44995717
has answer: http://stackoverflow.com/a/28324014
answer count: 2
has comment: http://stackoverflow.com/comment/44995585
downvote count: 0
has comment: http://stackoverflow.com/comment/44996052
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/45073763
type: QuestionComment
comment on: http://stackoverflow.com/q/28366365
type: Comment
has text: As I can remember, there is an API to set options dynamically after initialization (first open). Try to set this option before opening. See the documentation for details.
score: 0

http://stackoverflow.com/comment/45176578
type: QuestionComment
type: Comment
has text: I believe? This is in the index.html file: ` `
score: 0
comment on: http://stackoverflow.com/q/28421284

http://stackoverflow.com/comment/119173409
comment on: http://stackoverflow.com/a/40159407
type: Comment
has text: There is still the difficulty that responsive images cause layout rendering problems. A solution is discussed [here](https://stackoverflow.com/questions/13458297/reserving-space-in-browser-layout-for-responsive-images-preventing-reflow).
score: 0
type: AnswerComment

http://stackoverflow.com/a/29009375
upvote count: 1
downvote count: 0
has body: You could try using the ! operator start = digits:[0-9]+ ![^0-9] { return {type: 'digits', number: digits.join('')}; } / anything:.* { return { type: 'anything', anything: anything.join('') }; } parser.parse('123456') { "type": "digits", "number": "123456" } parser.parse('123abc456') { "type": "anything", "anything": "123abc456" }
answers question: http://stackoverflow.com/q/28298713
type: Answer
score: 1

http://stackoverflow.com/q/28356299
has body: I have a button that must generate a pdf file of a table already filtered. I handle the click action with JavaScript here's the code. $('#Exportar').on('click', function(){ var oTable = $("#example").dataTable(); var data = oTable._('tr', {"filter":"applied"}); var ajaxurl = 'Exportar.php'; $.ajax({ url: ajaxurl, data: {datosTabla: 'data'}, type: 'post', success: function(output) { // alert(output); } }); }) My PHP file (Exportar.php) looks like this: &lt;?php require('/fpdf/fpdf.php'); if(isset($_POST['datosTabla']) &amp;&amp; !empty($_POST['datosTabla'])) { $action = $_POST['datosTabla']; $pdf = new FPDF(); $pdf -&gt;AddPage(); $pdf -&gt;SetFont('Arial','',10); $pdf -&gt;Image('images/pdf_hover.png', 10, 10, 10, 10, 'png'); $pdf-&gt;Cell(18,10,'',0); $pdf-&gt;Cell(150,10,'PDF exportado',1); $pdf -&gt;SetFont('Arial','',9); $pdf-&gt;Cell(50,10,'Fecha: '.date('dd.-mm-Y'),'',0); $pdf-&gt;Ln(15); $pdf -&gt;SetFont('Arial','B',11); $pdf-&gt;Cell(70, 8,'',0); $pdf-&gt;Cell(100, 8,'Reporte de Carteras',0); $pdf-&gt;Ln(23); $pdf -&gt;SetFont('Arial','B',8); $pdf-&gt;Cell(15, 8,'columna1',0); $pdf-&gt;Cell(15, 8,'columna2',0); $pdf-&gt;Cell(15, 8,'columna3',0); $pdf -&gt;SetFont('Arial','',11); $pdf-&gt;Output(); } ?&gt; I have examine the post with the dev tools from Chrome and the post it's been done correctly. I just do not know why it's not working. I have tested the functionality with a simple alert on the client side and works perfectly fine(comes out from the success handler). My FPDF folder its at the same level as Exportar.php file. Can anyone lend me a hand on this? I have already tried checking other ppl posts and the faq from FPDF but it hasn't been much of a help. On the other hand I have tried the example file that comes with FPDF and when I click the demo link the PDF is not been generated. I don't know why is this. Thanks in advance for your help.
has comment: http://stackoverflow.com/comment/45057192
has comment: http://stackoverflow.com/comment/45057615
type: Question
has comment: http://stackoverflow.com/comment/45056195
tagged with: javascript
has comment: http://stackoverflow.com/comment/45057572
tagged with: fpdf
score: 0
tagged with: http://stackoverflow.com/tag/pdf
has comment: http://stackoverflow.com/comment/45056686
tagged with: jquery
has title: FPDF issue when trying to generate pdf file
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45075670
tagged with: php
has comment: http://stackoverflow.com/comment/45057324
answer count: 0

http://stackoverflow.com/q/28339346
has title: is function an object in JavaScript?
score: 1
has comment: http://stackoverflow.com/comment/45031290
upvote count: 1
linked to: http://stackoverflow.com/q/5958417
has comment: http://stackoverflow.com/comment/45053131
type: Question
has comment: http://stackoverflow.com/comment/45023881
has comment: http://stackoverflow.com/comment/45024843
has body: Is function a 'Function' object in JavaScript? if so, when I create a constructor function like: //this is a constructor function function foo(){ this.name="xx"; } Does foo has a property named proto pointing to the Function's prototype? How can I see this property? ps: If proto is created when an instance is created via the new keyword, why does not function foo have it? According to above, foo is created via new Function.
tagged with: javascript
has comment: http://stackoverflow.com/comment/45064102
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45025238
has comment: http://stackoverflow.com/comment/45028422
has comment: http://stackoverflow.com/comment/45024313
favorite count: 0
has answer: http://stackoverflow.com/a/28339369
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45025702

http://stackoverflow.com/comment/45140082
comment on: http://stackoverflow.com/q/28402370
score: 0
has text: There's no response at all when I tap the button, it doesn't leave the app. I know it's calling the function though, I tested it with an alert.
type: Comment
type: QuestionComment

arrow-functions
tag name: arrow-functions
type: Tag
tags question: http://stackoverflow.com/q/28371982

http://stackoverflow.com/comment/45115250
score: 1
has text: Np, testing something now :)
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28388779

http://stackoverflow.com/q/28382664
has comment: http://stackoverflow.com/comment/45103724
type: AnsweredQuestion
has body: Functions create a closure in JavaScript. There are three ways of defining functions in JavaScript: function statement, function expression (named/unnamed) and using the Function constructor function. Should using the Function constructor form a closure?
accepted answer: http://stackoverflow.com/a/28382688
type: Question
answer count: 1
has comment: http://stackoverflow.com/comment/45103751
tagged with: javascript
has title: Should using the Function constructor form a closure?
score: 0
has comment: http://stackoverflow.com/comment/45103728
has answer: http://stackoverflow.com/a/28382688

http://stackoverflow.com/a/28345764
has body: outside the function you can have a `var counter` and then inside: $.ajax({ type: "GET", url:completeURL, dataType: "xml", success: function(xml){ // We parse the XML here counter++; if(counter==2) bla bla }; }, error: function() { console.log("An error occurred while processing XML file."); counter++; if(counter==2) bla bla } });
type: Answer
upvote count: 2
answers question: http://stackoverflow.com/q/28345693
downvote count: 1
score: 1

http://stackoverflow.com/q/28300892
tagged with: php
has answer: http://stackoverflow.com/a/28301390
type: AnsweredQuestion
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/44953541
has comment: http://stackoverflow.com/comment/44953150
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/44953352
favorite count: 0
downvote count: 3
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28301518
has body: I will like an assistance with the following. I have three input the first one is Identity number , second one is Date of birth and the third one is gender. What I want is when I insert an Identity number on the first field to automatic insert dateofbirth and gender. South African ID numbers contain date of birth and gender. All I want is when I insert ID number, Birthdate and gender to automatic insert Sample of identity number is 140101 5000 089 - The first six number is date of birth start with yymmdd and the second number is if a number start with 0-4 its a female and if its start with 5-9 its a male First name: &lt;input type="number" name="id_number" maxlength="13"&gt;&lt;br&gt; Birthdate: &lt;input type="text" class="datepicker" name="birthdate"&gt;&lt;br&gt; Gender: &lt;input type="text" name="gender"&gt;&lt;br&gt;
linked to: http://stackoverflow.com/q/650022
tagged with: css
has answer: http://stackoverflow.com/a/28301518
has title: Assistance with form and javascript
accepted answer: http://stackoverflow.com/a/28301390
upvote count: 0
linked to: http://stackoverflow.com/q/13344294
score: -3

http://stackoverflow.com/q/28310470
tagged with: javascript
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/44976731
favorite count: 0
has title: Reference a div from d3 inside a iframe
tagged with: d3.js
type: UnansweredQuestion
tagged with: iframe
has answer: http://stackoverflow.com/a/34302795
has body: I'm generating a iframe and filling it with a div and a d3 script to render the svg content inside it. Something like: Inside the D3 script I have the usual select: d3.select("#target").append("svg")... but it doesn't add the svg inside the div. If I run d3.select("#content-frame").append("svg") instead it places the svg correctly inside the iframe though. I've tried d3.select("#content-frame #target").append("svg") and similar selectors without success. Any idea? Thanks!.
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/44985462
type: Question
linked to: http://stackoverflow.com/q/1088544

http://stackoverflow.com/comment/44976925
score: 1
has text: OP is using JSONP (at the moment) which is an entirely new level of pain
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28313424

http://stackoverflow.com/comment/45053820
comment on: http://stackoverflow.com/a/28354368
type: AnswerComment
has text: Ok. I've edited my answer. But in your question you're saying that you're not sure on how to get a mapbox id. You could have been more clear. The question lacks a lot of things for instance: What did you research turn up? What did you try? What went wrong? What errors are you getting? See: http://stackoverflow.com/help/how-to-ask
score: 0
type: Comment

http://stackoverflow.com/q/28296560
favorite count: 0
has answer: http://stackoverflow.com/a/28296663
linked to: http://stackoverflow.com/q/1013385
possible better answer: http://stackoverflow.com/a/43248041
linked to: http://stackoverflow.com/q/336859
has title: Function statement and function expression in javascript
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44945412
score: 1
has answer: http://stackoverflow.com/a/43248041
has comment: http://stackoverflow.com/comment/44945416
has body: While learning javascript I came across function statement and function expression. function fun(){} // function statement var fun = function() {} //function expression Then I came accross this example explained as function expression. (function() { alert("I am a function"); }()); Is this really a function expression? It appears as a function statement to me as function() { alert("I am not a function statement."); };
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44945413
tagged with: javascript
upvote count: 2
answer count: 2
accepted answer: http://stackoverflow.com/a/28296663

http://stackoverflow.com/q/28349285
has comment: http://stackoverflow.com/comment/45042664
has comment: http://stackoverflow.com/comment/45046462
tagged with: console
favorite count: 0
has comment: http://stackoverflow.com/comment/45044496
has comment: http://stackoverflow.com/comment/45044549
has title: Chrome console shows me "Navigated to http://localhost...."
has answer: http://stackoverflow.com/a/69127876
tagged with: console.log
has answer: http://stackoverflow.com/a/28374615
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28374615
possible better answer: http://stackoverflow.com/a/69127876
downvote count: 0
has comment: http://stackoverflow.com/comment/45071195
has comment: http://stackoverflow.com/comment/45071209
has comment: http://stackoverflow.com/comment/45047411
tagged with: google-chrome
type: Question
score: 71
has body: Chrome console shows me "Navigated to http://localhost...." in blue letters Image:
tagged with: google-chrome-devtools
tagged with: javascript
upvote count: 71
answer count: 2

http://stackoverflow.com/comment/45140127
type: QuestionComment
has text: Is there a reason to mix jQuery with javascript?
type: Comment
comment on: http://stackoverflow.com/q/28402392
score: 0

http://stackoverflow.com/q/28309706
has comment: http://stackoverflow.com/comment/44970909
has comment: http://stackoverflow.com/comment/44971172
tagged with: node.js
type: AnsweredQuestion
has body: I am trying my hand at an application on the MEAN stack and have come across an issue with using nodes require function. My current structure is as follows: -- app -- images -- scripts -- app.js // app configuration -- contollers.js -- models.js -- routes.js -- styles // scss partials -- node_modules -- public -- images -- scripts -- app.js // concatenated and uglified js from app/scripts -- styles // concatenated and compressed scss partials -- vendor // third party libraries -- views // html partials bower.json index.html gruntfile.js pacakge.json server.js Note: I know that this is not the best way to structure my app and will be refactoring it so that it uses a more modular system down the track. The issue I am having is when I add var mongoose = require('mongoose'); to the models.js file I get the following error: ReferenceError: require is not defined The puzzling thing is that this line works perfectly in server.js, why does it not work in models.js?
type: Question
has title: MEAN stack node require is not defined
accepted answer: http://stackoverflow.com/a/28421340
has comment: http://stackoverflow.com/comment/44980118
has comment: http://stackoverflow.com/comment/44971131
tagged with: mongoose
tagged with: javascript
has comment: http://stackoverflow.com/comment/45140771
tagged with: express
has answer: http://stackoverflow.com/a/28421340
score: 0
has comment: http://stackoverflow.com/comment/45175598
has comment: http://stackoverflow.com/comment/44970849
answer count: 1
has comment: http://stackoverflow.com/comment/44971298
has comment: http://stackoverflow.com/comment/44970575
tagged with: angularjs

http://stackoverflow.com/comment/45176579
type: Comment
has text: technical note: those aren't `pde` files, they're just javascript that you gave a ".pde" extension: you're using loads of syntax that isn't supported by Processing proper, and will break if you try to run it with the PDE runner. With that said: where's your `void setup() { size(...,...); ... }` and `void draw() { ... }` code?
comment on: http://stackoverflow.com/q/28375690
score: 0
type: QuestionComment

scope
tags question: http://stackoverflow.com/q/28375669
tags question: http://stackoverflow.com/q/28310418
tags question: http://stackoverflow.com/q/28323993
tag name: scope
tags question: http://stackoverflow.com/q/28301959
tags question: http://stackoverflow.com/q/28419920
type: Tag
tags question: http://stackoverflow.com/q/28320801
tags question: http://stackoverflow.com/q/28400802
tags question: http://stackoverflow.com/q/28391233
tags question: http://stackoverflow.com/q/28300796

http://stackoverflow.com/comment/44987468
type: Comment
comment on: http://stackoverflow.com/q/28319377
has text: PhP function `scandir()` seems to feet your need (http://php.net/manual/en/function.scandir.php).
score: 0
type: QuestionComment

http://stackoverflow.com/a/28284627
answers question: http://stackoverflow.com/q/28284548
downvote count: 0
score: 1
has body: You may do like this: var srcElement = document.getElementsByClassName('your_class'); for(var i=0;i&lt;srcElement.length;i++){ srcElement[i].src = "http://different-server.com/" + srcElement[i].src }
has comment: http://stackoverflow.com/comment/44923511
type: Answer
upvote count: 1

http://stackoverflow.com/comment/45024061
has text: possible duplicate of [Execute function if document is taller than viewport](http://stackoverflow.com/questions/14231568/execute-function-if-document-is-taller-than-viewport)
comment on: http://stackoverflow.com/q/28339192
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45153071
type: QuestionComment
score: 1
has text: Sorry if that sounds obvious, but is this action really defined in Account controller?
comment on: http://stackoverflow.com/q/28409784
type: Comment

http://stackoverflow.com/q/28342851
has answer: http://stackoverflow.com/a/28342919
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has title: jQuery client side password verification
tagged with: client-side
favorite count: 0
has body: first of all I'd like to say I realise it's not a secure method. This is only for training purpose. The algorhitm should be: click on a div with id="login-bg" app displays the banner provide the code if the code's ok set cookie and fade out the banner if the code's not ok the div shakes (still remaining on the screen) if you don't want to provide the code press 'cancel' and fade out the banner Set cookie function (it works fine): <?php if(!isset($_COOKIE['is_logged'])) { ?> <?php } ?> And here must be the problem with jQuery: <?php if(!isset($_COOKIE['is_logged'])) { ?> Provide the code! And enjoy free access! Cancel <?php } ?> In my opinion the value '#code' id not passed to jQuery from the form. But I may be wrong. Do you have any ideas. Could you make it work? Thanks for your help.
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45031755
downvote count: 2
has answer: http://stackoverflow.com/a/28343193
tagged with: authentication
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28343797
tagged with: javascript
tagged with: jquery
score: -1

http://stackoverflow.com/comment/45116157
type: QuestionComment
has text: So it sounds like the only solution is to either manually or automatically end up wrapping it in a define call then
comment on: http://stackoverflow.com/q/28389216
score: 0
type: Comment

http://stackoverflow.com/comment/45101953
type: Comment
has text: @evan no, if i use "one", this works 'once' and i need to reload page every time.
score: 0
comment on: http://stackoverflow.com/a/28381583
type: AnswerComment

http://stackoverflow.com/a/28531525
upvote count: 1
downvote count: 1
has body: Usually a halt in execution, intentional or not, can cause android to think the app has crashed. Try wrapping your code in something like setTimeout(function() { your code }, 60000) to delay execution by a minute. Or, try making an ajax request that will time out.
has comment: http://stackoverflow.com/comment/47664602
has comment: http://stackoverflow.com/comment/49069780
answers question: http://stackoverflow.com/q/28340920
type: Answer
score: 0

http://stackoverflow.com/q/28342835
score: 1
tagged with: javascript
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28428067
has body: I am creating JsTree with json Data. the tree is created upto second level but after second the tree is not populated. I want to recursively call the function to add leaf to it until leaf doesnt exit. Below is my Json: [ { "id" : 25, "name" : "Output", "path" : "/", "type" : "folder", }, { "id" : 26, "name" : "Templates", "path" : "/", "type" : "folder", }, { "id" : 27, "name" : "Temp", "path" : "/Output/", "type" : "folder", }, { "id" : 28, "name" : "December", "path" : "/Output/", "type" : "folder", }, { "id" : 29, "name" : "ParameterDOC", "path" : "/Templates/DecemberTemplates/", "type" : "Doc", }, { "id" : 30, "name" : "SimpleDoc", "path" : "/Templates/DecemberTemplates/", "type" : "Doc", }, { "id" : 31, "name" : "DecemberTemplates", "path" : "/Templates/", "type" : "folder", }, { "id" : 32, "name" : "NovemberTemplates", "path" : "/Templates/", "type" : "folder", } ] and code is: function createTreeForDoc(jsonData,path,id){ for(var i=0; i &lt; jsonData.length;i++){ if(jsonData[i].path == path){ $("&lt;li id="+jsonData[i].name+" class=\"lib\" rel="+jsonData[i].path+" data-jstree='{\"icon\":\"images/"+jsonData[i].type+"_small.png\"}' &gt;"+jsonData[i].name+"&lt;/li&gt;").appendTo("#maptree"); createSubTree(jsonData,jsonData[i].path+jsonData[i].name+"/",jsonData[i].name,i); } } $('#rptTree').jstree({ "plugins" : ["types"], "core" : { "check_callback" : false, "themes" : { "dots" : false }, }, }); } function createSubTree(jsonData,path,gid,counter){ $("&lt;ul id=\"test"+counter+"\"&gt;&lt;/ul&gt;").appendTo("#"+gid); for(var i=0; i &lt; jsonData.length;i++){ if(jsonData[i].path == path ){ $("&lt;li id="+jsonData[i].name+" class=\"lib\" rel="+jsonData[i].path+" &gt;"+jsonData[i].name+"&lt;/li&gt;").appendTo("#test"+counter); } } } and right now i am getting out this: so this creates till second level third level is not created how to recursively call a function to create all other level to end.
downvote count: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/28343387
favorite count: 0
has title: How to create jstree based on json Data?
possible better answer: http://stackoverflow.com/a/28343387
accepted answer: http://stackoverflow.com/a/28428067
upvote count: 1
type: AnsweredQuestion

http://stackoverflow.com/a/28359566
answers question: http://stackoverflow.com/q/28358776
score: 0
has body: Module.js is a singleton. But you aren't treating it as such. You need to create your variable inside the module, and then export your method to be used and increment the count and set the definedVariable when used as a closure. // module.js var count = { total : 0 }, definedVariable = declared; module.exports = function(declared){ function increment(){ count.total++; return { defined : definedVariable, count : count.total } } return { increment : increment() } } Now in your server //server.js var mod = require('./module.js'); var mod1 = mod(); var mod2 = mod('defined now');
type: Answer

http://stackoverflow.com/comment/45070173
score: 0
type: Comment
has text: I closed the tr on the line 14!
comment on: http://stackoverflow.com/a/28363020
type: AnswerComment

http://stackoverflow.com/a/28343356
score: 2
downvote count: 0
has body: Use myModal.destroy(); after myModal.close(); and it will work
answers question: http://stackoverflow.com/q/28343146
accepted answer of: http://stackoverflow.com/q/28343146
upvote count: 2
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/a/28812322
type: Answer
answers question: http://stackoverflow.com/q/28389892
score: 0
has body: You are testing for multiple combined classes, so you must separate the classes in hasClass with a space (not the dot): // if the button has both classes if($('button').hasClass('btn btn-default')){ return; } e.g. text example: http://jsfiddle.net/80001ra0/

http://stackoverflow.com/q/28337919
has title: How to delay before window.close() with addEventListener(webkitTransitionEnd)?
has answer: http://stackoverflow.com/a/28338152
favorite count: 0
has body: I am not very well-versed in JS and could not understand how to apply similar answers to my question, so I would appreciate your help and advice. What I'm Making: I am working on a webview pop-up. It has a close button at the bottom that I want to be animated the same as the in-app buttons. How I'm Doing It: I am currently closing it simply with &lt;a href="#" onclick="window.close(); return false;"&gt;&lt;img class="button" src="img.png"&gt;&lt;/a&gt;. I have a webkit animation that changes on img.button:active mode. My Issue: I want the transition to complete before the window closes. I know that I must use addEventListener to check when the transition has ended, but I cannot seem to do this correctly with window.close(). Is there a good way to do this? I have not been able to figure this out by myself reading tons of documentation all day.
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
tagged with: webkit-animation
score: 3
downvote count: 0
has answer: http://stackoverflow.com/a/28338192
type: Question
tagged with: addeventlistener
tagged with: javascript
upvote count: 3
answer count: 2

http://stackoverflow.com/comment/45050203
type: AnswerComment
score: 0
type: Comment
has text: the log shows as "Uncaught ReferenceError: provider is not defined".It also shows the status as 404 not found for the CreateProvider Script
comment on: http://stackoverflow.com/a/28352695

google-chrome-extension
tags question: http://stackoverflow.com/q/28413626
tags question: http://stackoverflow.com/q/28338450
tags question: http://stackoverflow.com/q/28417719
tags question: http://stackoverflow.com/q/28409615
tags question: http://stackoverflow.com/q/28369355
tags question: http://stackoverflow.com/q/28409066
tag name: google-chrome-extension
tags question: http://stackoverflow.com/q/28398550
tags question: http://stackoverflow.com/q/28431505
tags question: http://stackoverflow.com/q/28348008
tags question: http://stackoverflow.com/q/28411604
tags question: http://stackoverflow.com/q/28401138
tags question: http://stackoverflow.com/q/28308763
type: Tag
tags question: http://stackoverflow.com/q/28402959
tags question: http://stackoverflow.com/q/28377607
tags question: http://stackoverflow.com/q/28392285
tags question: http://stackoverflow.com/q/28421015
tags question: http://stackoverflow.com/q/28409881
tags question: http://stackoverflow.com/q/28369423
tags question: http://stackoverflow.com/q/28434311
tags question: http://stackoverflow.com/q/28329200
tags question: http://stackoverflow.com/q/28353199
tags question: http://stackoverflow.com/q/28316146
tags question: http://stackoverflow.com/q/28302566
tags question: http://stackoverflow.com/q/28355787
tags question: http://stackoverflow.com/q/28337409
tags question: http://stackoverflow.com/q/28283397
tags question: http://stackoverflow.com/q/28383739
tags question: http://stackoverflow.com/q/28378708

http://stackoverflow.com/q/28305271
tagged with: javascript
tagged with: jquery
tagged with: ajax
answer count: 1
downvote count: 0
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28305902
has body: I'm trying to build an aggregation dynamically based on a group of fields queried using the mapping. Here's the code. $(document).ready(function(){ var query = { aggs:{ sum_of_too_many_tries:{ sum:{ field:"reason.too_many_tries" } } } }; $.ajax({ url: "http://10.138.16.125:9200/log/blocks/_mapping", type: "get", async: false, crossDomain: true, success: function(data) { var fields = Object.keys(data.log.mappings.blocks.properties.reasons.properties); $.ajax({ url: "http://10.138.16.125:9200/log/blocks/_search", crossDomain: true, async: false, type: "get", dataType: "json", data: JSON.stringify(query), success: function(response) { $("#dump").append(var_dump(response)); } }); } }); }); When I do the query, it returns the hits normally, without the aggregations. What am I doing wrong? If you need more code, just ask.
tagged with: elasticsearch
has title: Querying dynamic aggregation in elasticsearch with AJAX
type: AnsweredQuestion
upvote count: 1
accepted answer: http://stackoverflow.com/a/28305902
type: Question

http://stackoverflow.com/comment/45169183
score: 0
has text: Could you mention where you found it? The condition checks that the link contains the text `"http"` in it's `href` attribute. Also if there are any errors please show us.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28417944

http://stackoverflow.com/comment/45222597
score: 0
type: Comment
has text: Also, so you know in the code you provided...you open a footer with but then you close it with . Keep an eye on your syntax @theinlwin
comment on: http://stackoverflow.com/a/28446766
type: AnswerComment

http://stackoverflow.com/comment/45085645
score: 0
type: AnswerComment
has text: Yes, but i am **appending** which means can not use $('input#chekcbox') and i need to use $(this)
type: Comment
comment on: http://stackoverflow.com/a/28372619

http://stackoverflow.com/comment/45153283
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28408926
has text: You can try to add a `.fail()` to your `$.get()` to see if your AJAX request is actually working :)
score: 0

http://stackoverflow.com/comment/44942893
comment on: http://stackoverflow.com/a/28280550
score: 0
type: AnswerComment
has text: Why do need the old value? You only need the new values but you need to use primary key as base for updating it in database. If you need the primary key too, then store the primary key in form as and do the same process like suggested in answer
type: Comment

http://stackoverflow.com/a/28281099
type: Answer
accepted answer of: http://stackoverflow.com/q/28280846
has comment: http://stackoverflow.com/comment/44918831
answers question: http://stackoverflow.com/q/28280846
has comment: http://stackoverflow.com/comment/44918698
upvote count: 1
has comment: http://stackoverflow.com/comment/44918327
score: 1
has comment: http://stackoverflow.com/comment/44918509
has comment: http://stackoverflow.com/comment/44919129
has comment: http://stackoverflow.com/comment/44918594
type: AcceptedAnswer
downvote count: 0
has body: It isn't really an animation, since you are drawing an image of the clock. What paper.text is doing is drawing a new text every second on the canvas over the text that is already there. using display.attr('text', dig); instead of you can edit the existing text. This is the corrected code: window .onload= function (){ var paper = new Raphael( 0,0, 400, 400); var backGround = paper.rect(0,0,400,400); var display = paper.text(200, 200, "00:00:00").attr({text:"00:00:00"}); backGround.attr({ fill: "none"}); function startTime() { var today=new Date(); var h=today.getHours(); var m=today.getMinutes(); var s=today.getSeconds(); m = checkTime(m); s = checkTime(s); var dig = h+":"+m+":"+s; display.attr('text', dig); } function checkTime(i) { if (i&lt;10) {i = "0" + i}; // add zero in front of numbers &lt; 10 return i; } setInterval(function(){ startTime(); },1000); };

http://stackoverflow.com/q/28384119
upvote count: 2
has answer: http://stackoverflow.com/a/28384353
accepted answer: http://stackoverflow.com/a/28384353
type: AnsweredQuestion
type: Question
has body: Hello abc Delete Here you can test my code: http://goo.gl/XNQb5j The "Delete" button should remove the row from the table. It's working when I don't include jQuery UI (but then, of course, animation is not working). What am I doing wrong? Sorry for my English errors.
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Function that removes a row from the table is not working after adding jQuery UI
has comment: http://stackoverflow.com/comment/45106345
favorite count: 0
score: 2

http://stackoverflow.com/comment/44944604
type: QuestionComment
has text: Then try using the `body-parser` middleware instead of `multer`
comment on: http://stackoverflow.com/q/28294779
score: 0
type: Comment

http://stackoverflow.com/comment/45459239
has text: Thank you very much. The problem is solved.
type: QuestionComment
comment on: http://stackoverflow.com/q/28357842
type: Comment
score: 0

http://stackoverflow.com/q/28386729
tagged with: passwords
type: AnsweredQuestion
has title: How to tell is a password is equal to another password?
tagged with: forms
answer count: 2
downvote count: 4
upvote count: 0
has comment: http://stackoverflow.com/comment/45111174
accepted answer: http://stackoverflow.com/a/28387215
tagged with: javascript
favorite count: 0
has body: I'm programming a register form, but I want my visiters to enter their password twice. If they are the same, it's ok but if they aren't they get a pop-up or so. The form is in HTML and JavaScript. Heres my basic form (doesn't actually work, but it's basic.) Register Username:* </ label> Email:* Password:* Reenter your password:* Thanks for your answer! -MoosMas
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28392715
score: -4
possible better answer: http://stackoverflow.com/a/28392715
has answer: http://stackoverflow.com/a/28387215
type: Question

http://stackoverflow.com/q/28295346
has body: I am using Angular dragdrop in my app. I need to change the color of the borders of the drop area when drag an item hover them. There is a css class i can use for this purpose? If not, how can i do that? Thank you very much
tagged with: angularjs
tagged with: drag-and-drop
linked to: http://stackoverflow.com/q/27799766
type: AnsweredQuestion
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/28297814
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28297814
answer count: 1
downvote count: 0
has title: Angular dragdrop css class on drag
tagged with: angular-ui
favorite count: 0

http://stackoverflow.com/comment/45201025
type: Comment
has text: @amon `setToNoneIfFalsey()`? :)
comment on: http://stackoverflow.com/a/28434859
score: 0
type: AnswerComment

http://stackoverflow.com/comment/60305892
type: Comment
score: 3
type: AnswerComment
comment on: http://stackoverflow.com/a/28302171
has text: They might affect different things, but they definitely can conflict with each other. An app I'm building loads a table full of data. Once the data is loaded, it will not change, so I can one-time bind everything when the data loads. However, I have a refresh button, when pushed, goes and refetches the data. Any changes I want to display, but this is also a list of 300-400 items, so using `track by` speeds it up a lot. However, using both causes any changes to not get updated. How can I use both of these and still show any updates on reload?

http://stackoverflow.com/a/28342743
answers question: http://stackoverflow.com/q/28309833
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
accepted answer of: http://stackoverflow.com/q/28309833
score: 2
has body: I was able to solve my problem by using the .on function of jquery. var infoWindowContentExampleStack = [ " Im a text inside the infoWindow " ] var infoWindowExampleStack = new google.maps.InfoWindow({ content: infoWindowContentExampleStack }); $(document).on('mousenter', 'div.contentInsideMap', function() { // do something }); $(document).on('mouseleave', 'div.contentInsideMap', function() { // do something }); I wasn't able to test the whole Infowindow but the div I've added in the infowindow is enough trigger.

http://stackoverflow.com/comment/45030654
has text: Do you mean you want the `offset` to be variable when you instantiate the `smoothScroll` or you want `offset` to change after instantiating `smootScroll`?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28342974

http://stackoverflow.com/q/28434988
has title: Openlayers IE security issue
type: UnansweredQuestion
tagged with: internet-explorer
type: Question
score: 0
answer count: 1
tagged with: javascript
has body: I'm working on a project that is using the OpenLayers ordinance survey for mapping and have been running into a very awkward issue. The issue only seems to live in Internet Explorer. The problem is as follows; When loading the map, OpenLayers creates a dynamic .js file and inside this file there is a line of code that does the following : setImgSrc:function(a){var b=this.imgDiv;b.style.visibility="hidden";b.style.opacity=0;a&amp;&amp;(this.crossOriginKeyword&amp;&amp;("data:"!==a.substr(0,5)?b.setAttribute("crossorigin", this.crossOriginKeyword):b.removeAttribute("crossorigin")),b.src=a)} The problem resides on the b.src=a line, everytime I run in IE ONLY I get a0x800c000e - JavaScript runtime error: A security problem occurred. I've done research so far and having been turning up many leads, most of what I see is hosting images on your own server, but the resources are not available to accomplish this. If anyone can shed any kind of light on this issue it will be greatly appreciated. Using Openlayers Version 2.12
tagged with: openlayers
has answer: http://stackoverflow.com/a/28446239

conflict
tag name: conflict
type: Tag
tags question: http://stackoverflow.com/q/28395165

http://stackoverflow.com/q/28284316
has comment: http://stackoverflow.com/comment/44959150
tagged with: css
has comment: http://stackoverflow.com/comment/44929168
tagged with: responsive-design
score: 0
has body: I'm building a responsive navigation menu for a client. Most of it works except for a problem I'm encountering on mobile devices where the menu list is cut off from the page. The idea is that the links belong to an inline list, and as the viewport becomes smaller, they are hidden and a menu button is displayed. Tapping the menu button will display a regular (vertical) list beneath it by adding the class "open". Here is some code: /* Incomplete code, but basically fixes the header to the top of the page */ if(window.orientation === '0') { if(!header.hasClass('scrolling')) { header.addClass('scrolling scroll-fixed'); } } else if(window.orientation === '90' || window.orientation === '-90') { if($(window).scrollTop() &gt; 0) { header.removeClass('scroll-fixed'); } else { header.removeClass('scrolling scroll-fixed'); } } /* This is how it will display when toggled */ ul#navigation-links.open { display: block; padding: 0 1em; background-color: $white; box-shadow: 1px 1px 4px #919191; list-style-type: none; text-transform: uppercase; font-size: 10pt; border: 1px solid #e5e5e5; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; li { @include headline-stack; margin: 0; display: block; width: 100%; a, a:visited { margin: 0; padding: 0; color: $cobalt; text-shadow: 2px 1px 3px #f1f1f1; } a:hover { text-decoration: none; color: $cobalt; text-shadow: 2px 2px 4px #f1f1f1; } } } &lt;nav&gt; &lt;a role="button" class="toggle-navigation-links"&gt; &lt;span&gt; Menu &amp;nbsp; &lt;i class="fa fa-bars fa-inverse"&gt;&lt;/i&gt; &lt;/span&gt; &lt;/a&gt; &lt;ul id="navigation-links"&gt; &lt;li&gt;&lt;a href="/progress/index"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="/progress/about-us"&gt;About Us&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="/progress/team"&gt;Our Team&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="/progress/services"&gt;Services&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="/progress/listings"&gt;Listings&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="/progres…
has comment: http://stackoverflow.com/comment/44934558
tagged with: javascript
type: UnansweredQuestion
has title: Dropdown menu is cut off at certain resolutions
answer count: 0
has comment: http://stackoverflow.com/comment/44923278
type: Question

http://stackoverflow.com/q/28300744
has answer: http://stackoverflow.com/a/28301028
has comment: http://stackoverflow.com/comment/44952925
tagged with: timer
has body: Doing a kind of quizz, I would like to set a limited time to answer questions. So the user just need to put his answer in the form, and validate. Validate will redirect to the page process.php, which will check everything. If the user doesn't answer in time, it will sumbit the empty form. (because false answer and empty answer got same repercussions) I know there are some way, with meta tag (html), or header (php), but this isn't really what I'm looking for, cause of code customisation, or security reasons. Actually, I got this code. You will be redirected in 10 second(s). But this isn't what I'm looking for, cause the user can easily change the timer, to set a bigger value. I have also looked at PHP function microtime(), to put it in session, and check in my process.php if the timer isn't changed. But I failed. Is there an easy way to solve this problem ? How to really secure answer time, and prevent timer change ?
possible better answer: http://stackoverflow.com/a/28301028
score: 0
tagged with: http-redirect
has comment: http://stackoverflow.com/comment/44982811
tagged with: php
has comment: http://stackoverflow.com/comment/44952950
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44953033
has answer: http://stackoverflow.com/a/28301043
has comment: http://stackoverflow.com/comment/44953040
has title: How to redirect a user with a timer
accepted answer: http://stackoverflow.com/a/28301043
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/44952955
has comment: http://stackoverflow.com/comment/44952890
has comment: http://stackoverflow.com/comment/44952907

http://stackoverflow.com/comment/45041648
type: QuestionComment
has text: I already tried the approach described, and it's not working for me. window.onerror within the hosting webpage does indeed trap the error thrown from the extension content script. But the errorEvent supplied doesn't have any useful info either. I see: ` { "message": "Script error.", "filename": "", "lineno": 0, "colno": 0, "error": null } `
score: 0
comment on: http://stackoverflow.com/q/28348008
type: Comment

http://stackoverflow.com/comment/45031298
has text: Your HTML fie has html5 video content in it, which is not properly supported by webView. See [here](https://github.com/cprcrack/VideoEnabledWebView) for a video library for webview, and [here](http://stackoverflow.com/questions/3815090/webview-and-html5-video) for a related SO question.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28341923

http://stackoverflow.com/comment/45042420
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28349155
has text: checkout this post as well and remember `Google is your best friend` use it sometime http://stackoverflow.com/questions/2234542/how-to-intercept-any-postback-in-a-page-asp-net
score: 0

http://stackoverflow.com/comment/45015926
type: AnswerComment
has text: Thanks! The nextImage() input is working, but no luck for prevImage().
type: Comment
comment on: http://stackoverflow.com/a/28334676
score: 0

http://stackoverflow.com/a/28418313
downvote count: 0
type: AcceptedAnswer
upvote count: 6
has body: It's the nature of Ajax calls. When you make asynchronous calls, they are considered "done" once the call is initialized, not when the call finishes. Therefore it'll keep moving along without waiting. If you want to make the calls in this order, you can do a couple of things: Make b() and c() callbacks in your call to a() - This means you wait until a() is finished and in the .done() part of your call, you can call the other functions If you're using jQuery, you can specify that you want the call to not be asynchronous (async: false) - See here for more info: http://api.jquery.com/jquery.ajax/
type: Answer
answers question: http://stackoverflow.com/q/28418265
accepted answer of: http://stackoverflow.com/q/28418265
score: 6

http://stackoverflow.com/q/28366062
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28389452
score: 2
tagged with: push-notification
downvote count: 0
answer count: 1
favorite count: 0
has body: I am following the howto in this blog post: http://www.pubnub.com/blog/sending-android-push-notifications-via-gcm-javascript-using-phonegap/ Up til now I have done the following: Created a new project in Google Dev Console Turned on Google Cloud Messaging for Android Got the sender ID (project number) and a server key Then added push plugin to existing project: $ cordova plugin add https://github.com/phonegap-build/PushPlugin.git Then copied PushNotification.js from the plugin to my js lib folder. I am loading both this js file and the pubnub cdn with requirejs, which seems to work fine. I created a module with the scripts from 2.2 in the howto. define(['env-config','datastore/localstore','jquery','push','pubnub'],function (EnvConfig,Store) { var pushNotification = window.plugins.pushNotification; function register() { pushNotification.register( successHandler, errorHandler, { 'senderID':EnvConfig.push.senderid, 'ecb':'onNotificationGCM'} ); } function successHandler(result) { console.log('Success: '+ result); } function errorHandler(error) { //** The following line throws: //** java.lang.Long cannot be cast to java.lang.String console.log('Error:' + error); } function onNotificationGCM(e) { switch(e.event){ case 'registered': console.log("Device registered with id "+e.regid); Store.set("pushid"+e.regid); /*if (e.regid.length &gt; 0) { deviceRegistered(e.regid); } */ break; case 'message': if (e.foreground){ //What needs to be done when app is in the foreground //while receiving a notification console.log('A notification has been received'); } break; case 'error': console.log('Error: ' + e.msg); break; default: console.log('An unknown event was received'); break; } } var module = { init: function() { register(); } }; return module; }); When device is ready, I call the init function of this module. At the moment register() fails and executes the errorHandler callback. But console.log fails with: java.lang.Long cannot be cast to java.lang.String. Therefore I have no i…
type: AnsweredQuestion
tagged with: cordova
upvote count: 2
tagged with: pubnub
has answer: http://stackoverflow.com/a/28389452
type: Question
has title: Not able to get error in pubnub javascript callback

http://stackoverflow.com/q/28325469
has comment: http://stackoverflow.com/comment/45024848
has title: JavaScript key/value pair unexpected behavior
type: Question
has comment: http://stackoverflow.com/comment/45025145
has comment: http://stackoverflow.com/comment/44998695
has comment: http://stackoverflow.com/comment/45000227
has comment: http://stackoverflow.com/comment/44998591
score: 0
has comment: http://stackoverflow.com/comment/44998938
has body: I am creating an array of key/value pairs inside of a function. This function will then later be called. Code in the function: function getChosenList() { var selectedList = document.getElementById("selList"); var selectedListLength = selectedList.options.length; var list=[]; if(selectedListLength&gt;0) { for(var i=0;i&lt;selectedListLength;i++) { var key = selectedList.options[i].value; var value = selectedList.options[i].text; list.push({key:key,value:value}); } console.log(list); } return list; } The output to the console looks like this: [&gt;object &gt;object &gt;object] When the objects are expanded, it looks like this: [v object v object v object] key: "1" key: "2" key: "3" value: "val_1" value: "val_2" value: "val_3" Then I call this function from another script in the same file: var listOfChosenItems = getChosenList(); console.log(listOfChosenItems); This gives an output to the log that looks like this: [&gt;object &gt;object &gt;object] When the objects are expanded, it looks like this: [v object v object v object] key: "1" key: "2" key: "3" value: "[object]" value: "[object]" value: "[object]" Does anyone have a clue why it's doing this? And of course a solution?
answer count: 0
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/comment/45043258
has text: http://codepen.io/anon/pen/XJzmeE If you click on Tuesday 13. element another list unfolds. Im just taking my first Html css steps so be gentle on me ;D i know the code is pretty messy
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28348893

http://stackoverflow.com/a/28396535
score: 1
accepted answer of: http://stackoverflow.com/q/28393684
has comment: http://stackoverflow.com/comment/45129724
upvote count: 1
type: AcceptedAnswer
has body: How do Chrome event pages work? Here's the documentation, but in a nutshell: Your page's top level context executes, registering listeners for events. Chrome builds a list of events that it should wake the page for. Page unloads: note that it completely destroys JS context, including listeners and any objects initialized (e.g. your socket object). Event happens. Chrome looks up if it needs to wake up your page. Suppose it does. The page is loaded again, listeners register again, and then Chrome calls them. To quote the docs: Because the listeners themselves only exist in the context of the event page, you must use addListener each time the event page loads; only doing so at runtime.onInstalled by itself is insufficient. Now let's look at this line: // Called in a callback to chrome.sockets.udp.bind() bind_cb: function(s){ /* ... */ chrome.sockets.udp.onReceive.addListener(socket.recieve_callback) /* ... */ } When the page is loaded again, this does not execute synchronously. Therefore, at step 5, Chrome fails to find an appropriate listener and it's not called. Do note that the event is global, i.e. it's not bound to a socket object (that does not exist after unloading). So you can (and should) safely bind it to one function that analyzes the callback parameters to understand which socket it operates on. So, to make your code work, addListener must be called synchronously when the event page loads.
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/28393684

http://stackoverflow.com/q/28293516
type: Question
tagged with: http://stackoverflow.com/tag/json
accepted answer: http://stackoverflow.com/a/28293593
answer count: 1
tagged with: javascript
has title: Autocomplete search bar using json ajax javascript jquery and java (no PHP)
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/28293593
type: AnsweredQuestion
score: 0
has body: I am trying to implement the autocomplete search bar similar to facebook (like the drop down results when clicked on a particular result, it should direct to the respective link). I have got the autocomplete thing working (search results displaying only text) but I am not sure how to link the respective links/urls to the results. Any help is much appreciated. Thank you. Below is my searchjson method for java which I have linked to routes as 'GET' method. public static Result searchJSON(String query) { List&lt;Account&gt; userAccs = searchAccounts(query); ObjectNode json = Json.newObject(); ArrayNode jsonArray = json.putArray(""); ObjectNode node = null; for(Account acc : userAccs) { node = jsonArray.addObject(); node.put("label", acc.getDisplayName()); node.put("id", acc.getId()); } return ok(jsonArray); Below is my javascript for autocomplete var SearchBar = (function($) { var search_data = function( request, response ) { $.ajax({ url: "/search.json", dataType: "json", type: "GET", data: {q: request.term }, success: function( data ) { response( $.map( data, function( item ) { return { label: item.label, id: item.id }; })); } }); }; $("#searchfield").autocomplete({ source: search_data, minLength: 1 }); return { attach: attach_to_bar }; }) (jQuery);

http://stackoverflow.com/comment/44960810
type: Comment
comment on: http://stackoverflow.com/a/28304820
has text: Set display:inline-block and delete the width in the menu
type: AnswerComment
score: 0

http://stackoverflow.com/comment/44937963
type: Comment
comment on: http://stackoverflow.com/q/28292486
score: 0
has text: Change `type="submit"` to `type="button"`
type: QuestionComment

http://stackoverflow.com/a/28380028
has comment: http://stackoverflow.com/comment/45099302
type: Answer
has comment: http://stackoverflow.com/comment/45099554
score: 0
has comment: http://stackoverflow.com/comment/45099348
answers question: http://stackoverflow.com/q/28380009
has body: Try replacing the variable name var $var1 = 'BollywoodNEntertainment'; $('#grid').facebook_wall({ id: $var1 , access_token: '193673707489176|55a9bc60f1b35074263ea95e45218fc3', limit: 1 }); Bind the click event in $(document).ready(), please see the following... $(document).ready(function() { $("#test").on('click', function(){ $('#div1').remove(); $('#div2').remove(); $('#div3').remove(); test(); }); });
has comment: http://stackoverflow.com/comment/45099308

jquery-waypoints
tags question: http://stackoverflow.com/q/28398866
tag name: jquery-waypoints
tags question: http://stackoverflow.com/q/28435243
type: Tag

http://stackoverflow.com/comment/54893462
score: 4
type: Comment
comment on: http://stackoverflow.com/a/30800482
has text: This doesn't actually work since it calculates the size of the slide-box, (which is the longest slide) and not the slide itself.
type: AnswerComment

http://stackoverflow.com/comment/45154541
score: 0
type: AnswerComment
type: Comment
has text: Nick you are spot on with the first piece of code you have sent across, so thanks a lot for that. Unfortunately the second piece of code has not worked, I'm trying to work out why. The price just comes up as £0.
comment on: http://stackoverflow.com/a/28410143

http://stackoverflow.com/q/28345693
has body: I am looking for the best standard javascript way of monitoring when a method is completed. I have a method used for ajax calls like this: function rdRelatedJobs(param1,param2,param3) { var completeURL = param1 + param2 + param3; $.ajax({ type: "GET", url:completeURL, dataType: "xml", success: function(xml){ // We parse the XML here }; }, error: function() { console.log("An error occurred while processing XML file."); } }); } // end function rdRelatedJobs This function is called twice, queued immediately after each other. What I need to know is how to call another method once the second call to this method is complete. Note it does not matter if the ajax request is success or failure in this case. I just need to know how to call the method once the method above is run twice.
accepted answer: http://stackoverflow.com/a/28345772
score: 0
answer count: 4
tagged with: javascript
has answer: http://stackoverflow.com/a/28345772
has answer: http://stackoverflow.com/a/28345861
tagged with: ajax
has title: Calling a method after two other methods have been completed
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28345764
has answer: http://stackoverflow.com/a/28345874
has answer: http://stackoverflow.com/a/28345764
type: Question

http://stackoverflow.com/a/28340904
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45049130
type: Answer
has body: Like given below code you can use it. It works in all browser HTML: Name JQuery: var clearIcon ='X'; $(' '+clearIcon).appendTo('.surround') .keyup( function(e){ var $dad = $($(this).parent()); $(this).val().length>0? $('#icon_clear').fadeIn(300).click(function() { $('.textbox').val('');}): $('#icon_clear').fadeOut(300); if (e.keyCode in {13:"enter",32:"space"}){ var text = $(this).val(); $('#icon_clear').remove(); $dad.append($(' '+text+'')); $dad.append($(this).val("").hide().show("slow").focus()); $dad.append(clearIcon); } ;}); CSS: .textbox{ width:70px; border:1px dotted #ccc; margin: 0 5px; padding-right:18px; } span#icon_clear{ display:none; cursor:pointer; color:#38468F; position:relative; right:21px; } span#icon_clear:hover{ color:#ccc; } Here JSFiddle link: http://jsfiddle.net/ketan156/7PnKS/98/
downvote count: 0
answers question: http://stackoverflow.com/q/28340633

http://stackoverflow.com/q/28400375
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28400505
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28400505
has answer: http://stackoverflow.com/a/28400567
answer count: 3
downvote count: 0
favorite count: 0
has title: how to display spaces and paragraph in the description
has body: Description in the database is like this : - Compared with the billions of other stars in the universe, the sun is unremarkable. But for Earth and the other planets that revolve around it, the sun is a powerful center of attention. It holds the solar system together; pours life-giving light, heat, and energy on Earth; and generates space weather. but while displaying in the report it comes like this : - Compared with the billions of other stars in the universe, the sun is unremarkable.But for Earth and the other planets that revolve around it, the sun is a powerful center of attention.It holds the solar system together; pours life-giving light, heat, and energy on Earth; and generates space weather. thanks in advance
possible better answer: http://stackoverflow.com/a/28400559
has answer: http://stackoverflow.com/a/28400559
score: 1
upvote count: 1
tagged with: ruby-on-rails

http://stackoverflow.com/comment/45070006
score: 0
type: Comment
type: QuestionComment
has text: @quentin: Is this actually a duplicate? See: http://meta.stackexchange.com/questions/207207/different-questions-for-same-problem-in-different-language-duplicate-or-not
comment on: http://stackoverflow.com/q/28363525

http://stackoverflow.com/a/28435484
type: Answer
has comment: http://stackoverflow.com/comment/45313689
has body: For SPAN: $(function() { var text = $("span").text(); var replaced = text.replace(/\{(.*)\}/, function( $0, $1 ) { return "{".concat($1, "}"); }); $("span").html(replaced); }); Text: {something}
has comment: http://stackoverflow.com/comment/45314448
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28435338
accepted answer of: http://stackoverflow.com/q/28435338

http://stackoverflow.com/q/28413791
type: AnsweredQuestion
upvote count: 0
has title: Removing markers from google maps xml
type: Question
has body: I am trying to display markers on Google Maps which refresh periodically. I found this piece of code which will add them to the map but I need to know how to delete them every refresh so that it stops displaying on the map when they are no longer in the xml file. < script > var map = null; function initialize() { var mapOptions = { zoom: 12, center: new google.maps.LatLng(53.3478, -6.2597) //center over dublin }; map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); loadXMLFile(); } function loadXMLFile() { var filename = 'data.xml'; $.ajax({ type: "GET", url: filename, dataType: "xml", success: parseXML, error: onXMLLoadFailed }); function onXMLLoadFailed() { alert("An Error has occurred."); } function parseXML(xml) { var bounds = new google.maps.LatLngBounds(); $(xml).find("marker").each(function() { //Read the name, address, latitude and longitude for each Marker var nme = $(this).find('name').text(); var address = $(this).find('address').text(); var lat = $(this).find('lat').text(); var lng = $(this).find('lng').text(); var markerCoords = new google.maps.LatLng(parseFloat(lat), parseFloat(lng)); bounds.extend(markerCoords); var marker = new google.maps.Marker({ position: markerCoords, map: map }); }); map.fitBounds(bounds); } } google.maps.event.addDomListener(window, 'load', initialize); < /script> This works great when new markers are added by calling the function loadXMLFile() but if they are removed then they stay on the map. I think I need to remove them https://developers.google.com/maps/documentation/javascript/examples/marker-remove but I don't know how to apply this. This has been driving me nuts for days. Can anyone help me out? EDIT: My full code is not rendering the map: Simple Map Add markers Remove markers
score: -1
tagged with: google-maps-api-3
tagged with: xml-parsing
tagged with: google-maps
answer count: 1
downvote count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28413996
accepted answer: http://stackoverflow.com/a/28413996

http://stackoverflow.com/q/28293084
linked to: http://stackoverflow.com/q/1344500
type: UnansweredQuestion
tagged with: insertion-sort
type: Question
has comment: http://stackoverflow.com/comment/44939093
has answer: http://stackoverflow.com/a/28293536
tagged with: arrays
has body: The requirement is to start with an empty array, and insert elements into it, one at a time, but keep the array sorted in ascending order. A use of this would be to find the running median of a set of periodic inputs. I have tried simply pushing an element and then invoking the built-in sort method, but appears (by some benchmarks others have done on jsPerf) to slow down with large number of elements. Duplicates are to be allowed (although a simple trick will let me disallow them as well). function binaryInsert(x, array) { var l = 0, r = array.length - 1, m; while (l &lt;= r) { m = (l + r) / 2 | 0; if (array[m] &gt; x) { r = m - 1; continue; } l = m + 1; if (array[m] === x) { break; // change to return to avoid duplicates } } array.splice(l, 0, x); } I did look at this, but that seems to be doing a recursive search, which does not appear to be optimal without tail call optimization. Also, are there any alternatives to the splice at the end?
tagged with: javascript
tagged with: sorting
linked to: http://stackoverflow.com/q/25109518
score: 0
has title: Is there a more efficient way to perform a binary insertion sort in JavaScript?
answer count: 1

http://stackoverflow.com/comment/45086680
type: Comment
has text: @RaTre when script is executing, jQuery is still not loaded. It is one of solutions: http://jsfiddle.net/maxim_mazurok/6ynu4mtc/
comment on: http://stackoverflow.com/a/28372619
score: 0
type: AnswerComment

http://stackoverflow.com/a/28436882
accepted answer of: http://stackoverflow.com/q/28373865
type: AcceptedAnswer
has body: just found the "solution" ( more like a workaround ) the answer is from StackOverflow: Location permission alert on iPhone with PhoneGap You need to do the geolocation after the device is ready. The following Jquery code, for example, will geolocate without that nasty alert: $(function(){ document.addEventListener("deviceready", onDeviceReady, false); }) function onDeviceReady() { navigator.geolocation.getCurrentPosition(onSuccess, onError); } function onSuccess(position) { // your callback here } function onError(error) { // your callback here } In ionic you would put it insdie $ionicPlatform.ready(function() {
type: Answer
has comment: http://stackoverflow.com/comment/48643282
upvote count: 2
has comment: http://stackoverflow.com/comment/70930019
score: 1
downvote count: 1
answers question: http://stackoverflow.com/q/28373865

http://stackoverflow.com/comment/44969606
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28308351
has text: @apaul34208 Sorry, I am totally new here at stackoverflow and in Javascript/jQuery programming.
score: 0

http://stackoverflow.com/comment/45106040
has text: Sorry i wasn't specific enough, I want it to smooth scroll to each div, not just jump, that does however, make it jump to the div, which is better than it not doing anything at all.
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28383958

http://stackoverflow.com/q/28367192
possible better answer: http://stackoverflow.com/a/28367263
tagged with: size
tagged with: css
has title: WEB increasing the space between letters
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45075480
has answer: http://stackoverflow.com/a/28367396
has body: I may be barking up the wrong tree here but im looking for a solution to increase the width in a space for example the space bar on your keyboard or in html terms "&nbsp;". I have tried a few ideas I had like adding 2 "&nbsp;" as well as using js to replace spaces with tags adding css width property's. I have been also scouring the web for any css properties and found nothing. It would be great if anyone could share there knowledge and any ideas on how to solve this problem. Thanks image for reference
has comment: http://stackoverflow.com/comment/45075420
type: Question
accepted answer: http://stackoverflow.com/a/28367396
has comment: http://stackoverflow.com/comment/45075428
has comment: http://stackoverflow.com/comment/45075414
tagged with: javascript
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28367263
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45075363

http://stackoverflow.com/comment/45197045
type: QuestionComment
type: Comment
has text: if i put xml in session, i have to clean up the session after the request processing, as this xml input is needed only for the current request.i am looking for some option to pass the xml in body so the xml lives only for the request
comment on: http://stackoverflow.com/q/28433401
score: 0

http://stackoverflow.com/a/28401353
score: 4
type: AcceptedAnswer
has body: Your code should be var nav = document.getElementById("nav"); You have to pass a string to the routine. Your code would not have resulted in an error because the variable was declared in your function, but it would have had no value.
type: Answer
accepted answer of: http://stackoverflow.com/q/28401339
answers question: http://stackoverflow.com/q/28401339
upvote count: 4
downvote count: 0

http://stackoverflow.com/q/28301077
type: UnansweredQuestion
tagged with: php
has body: Using ajax to load a DataTable as follows: $("#getXXData").dataTable({ "bServerSide": true, "sPaginationType": "bootstrap", "sAjaxSource": dataRequestUrl, "bProcessing": true, "bDestroy":true, "iDisplayLength":100, "aaSorting": 4, "desc" , "aoColumns": [ { "sClass": "text-center","bSortable":false,"sWidth": "5%" }, { "sClass": "text-left","sWidth": "40%" }, { "sClass": "text-left","bSortable":false,"sWidth": "30%" }, { "sClass": "text-left","bSortable":false,"sWidth": "10%" }, { "sClass": "text-right","sWidth": "15%" } ], "fnInitComplete": function(oSettings, json) { $(".tooltip-right").tooltip({placement: "top", trigger: "hover"}); if(json.iTotalRecords == null){ $(".dataTables_paginate").hide(); $("#selectAllXX").attr("checked",false); } }, "fnDrawCallback": function() { $(".tooltip-right").tooltip({placement: "top", trigger: "hover"}); }, "oLanguage": { "sSearch": "&lt;strong&gt;Search: &lt;/strong&gt;", "sZeroRecords": "No XX Found", "sProcessing":"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;i class=\"fa fa-cog fa-spin\"&gt;&lt;/i&gt; Processing..." }, }); When I click any link when it's loading I get an error as follows Any solutions?
has title: While loading DataTable if I click on any link it's show error! Solutions? (PHP/Infobright)
tagged with: datatable
has comment: http://stackoverflow.com/comment/44953794
answer count: 0
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/44968483
tagged with: infobright
tagged with: javascript
downvote count: 0
favorite count: 0

http://stackoverflow.com/q/28415617
answer count: 0
score: 0
type: UnansweredQuestion
has body: I have been looking to optimize my jssor slider for a couples days and I dont seem to be able to make the lazing loading work. Basicaclly, i'm trying to reduce the initial bandwidth require to download my webpage by making the slider download and show the slides as they appear. I tried using the $LazyLoding: 0 option and replaced all "src" attributes of my images to "src2" but the initial bandwidth to download my webpage is not changing. Here my config: { $DragOrientation: 1, //[Optional] Orientation to drag slide, 0 no drag, 1 horizental, 2 vertical, 3 either, default value is 1 (Note that the $DragOrientation should be the same as $PlayOrientation when $DisplayPieces is greater than 1, or parking position is not 0) $SlideDuration: 800, //[Optional] Specifies default duration (swipe) for slide in milliseconds, default value is 500 $HWA: false, $LazyLoading: 0, $ArrowNavigatorOptions: { //[Optional] Options to specify and enable arrow navigator or not $Class: $JssorArrowNavigator$, //[Requried] Class to create arrow navigator instance $ChanceToShow: 1, //[Required] 0 Never, 1 Mouse Over, 2 Always $AutoCenter: 2, //[Optional] Auto center arrows in parent container, 0 No, 1 Horizontal, 2 Vertical, 3 Both, default value is 0 $Steps: 1 //[Optional] Steps to go for each navigation request, default value is 1 }, $BulletNavigatorOptions: { //[Optional] Options to specify and enable navigator or not $Class: $JssorBulletNavigator$, //[Required] Class to create navigator instance $ChanceToShow: 2, //[Required] 0 Never, 1 Mouse Over, 2 Always $AutoCenter: 1, //[Optional] Auto center navigator in parent container, 0 None, 1 Horizontal, 2 Vertical, 3 Both, default value is 0 $Steps: 1, //[Optional] Steps to go for each navigation request, default value is 1 $Lanes: 1, //[Optional] Specify lanes to arrange items, default value is 1 $SpacingX: 10, //[Optional] Horizontal space between each item in pixel, default value is 0 $SpacingY: 10, //[Optional] Vertical space between each it…
has title: Jssor slider lazyloading not working
has comment: http://stackoverflow.com/comment/45180877
tagged with: jssor
type: Question
has comment: http://stackoverflow.com/comment/45204640
has comment: http://stackoverflow.com/comment/45179719
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45185121

angularjs-ng-class
tags question: http://stackoverflow.com/q/28337787
type: Tag
tag name: angularjs-ng-class

http://stackoverflow.com/a/28338516
downvote count: 0
answers question: http://stackoverflow.com/q/28338412
score: 1
type: AcceptedAnswer
has body: You can do that, although it seems a bit odd, normally it's the programmer using the plugin who decides what elements it will act on. You'd do it by using filter: $.fn.showRequiredError = function(){ this.filter(".required").after(' This field is required '); // ^^^^^^^^^^^^^^^^^^^^--- the new bit // See "side note" below return this; }; Now, the first thing the plugin does is filter the contents of the jQuery object it's called on so they only include .required elements. It would have a very very small performance impact, nothing to worry about. Example: $.fn.showRequiredError = function(){ this.filter(".required").after(' This field is required '); // ^^^^^^^^^^^^^^^^^^^^--- the new bit // See "side note" below return this; }; $("div").showRequiredError(); .required { color: blue; } This doesn't have 'required' This does have 'required' So does this But not this Side note 1: Note that in the call to a jQuery plugin, this is a jQuery object, so writing $(this) is redudant (and a tiny bit of extra work at runtime). Side note 2: Unless you have something else you have to return, by convention jQuery plugins should return this, for chaining.
has comment: http://stackoverflow.com/comment/45022583
upvote count: 1
type: Answer
accepted answer of: http://stackoverflow.com/q/28338412

http://stackoverflow.com/q/28336601
downvote count: 0
has body: I have a User mongodb structure like below. { "_id" : ObjectId("54d2f68edbe2337d000e1568"), "username" : "khayusaki@gmail.com", "organization" : [ { "idOrganization" : "54c8b01af927db992d021f58", "usertype" : 1, "displayname" : "K", }, { "idOrganization" : "54c8b01af927db992d021f60", "usertype" : 2, "displayname" : "Khay", } ], "__v" : 0 } It means like a user can have many organizations, and each displayname and usertype depends on it. What I want to do is, I only want to update the displayname of one organization by using JSON from request body. { "Displayname" : "Khay Usaki", "Email" : "khayusaki@gmail.com" } My mongoose query is like below. User.findOne({username: req.body.Email}, {organization: {$elemMatch: {idOrganization: '54c8b01af927db992d021f58'}}}, function(err, user) { if (err) res.send(err); user.organization[0].displayname = req.body.Displayname; user.save(); res.json({'message' : 'User successfully updated'}); } }); If I add console.log(user) before save() function, it gives me what I want to. { _id: 54d2f68edbe2337d000e1568, organization: [ { idOrganization: '54c8b01af927db992d021f58', usertype: 1, displayname: 'Khay Usaki', } ] } But it really doesn't save.I wish there might be someone who could help me find a solution for it. p.s. I tried with $push in User.findOne and it is also not working either. === Solution ===== Thanks @BatScream for the suggestion and it gets working as following. User.findOneAndUpdate({ username: req.body.Email, organization: {$elemMatch: {idOrganization: "54c8b01af927db992d021f58"}} }, {$set: {"organization.$.displayname": req.body.Displayname}}, {}, function(err, response) { // handle own response });
tagged with: mongoose
tagged with: javascript
tagged with: express
favorite count: 0
has comment: http://stackoverflow.com/comment/45058288
has answer: http://stackoverflow.com/a/28337646
has answer: http://stackoverflow.com/a/28338204
upvote count: 1
has title: How to update value inside an array from multiple array in Mongoose?
tagged with: node.js
has comment: http://stackoverflow.com/comment/45042373
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28337646
score: 1
type: Question
tagged with: mongodb
answer count: 2
accepted answer: http://stackoverflow.com/a/28338204

http://stackoverflow.com/comment/45180913
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28423493
type: QuestionComment
has text: @PatrickGunderson Thanks for the tip. I actually did experiment with $q and angular.module('').run() but found it cannot delay the initialization of controllers.

http://stackoverflow.com/comment/45200449
has text: Where's the recursive function you mention you have problems with? What are those problems? Without your code this is nothing more than a spec with some data
comment on: http://stackoverflow.com/q/28435176
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28313066
upvote count: 2
has body: If your query string contains dots or slashes, it should be removed first. str.slice(0,str.indexOf('?')); Otherwise, this one will be good enough. str.slice(str.lastIndexOf('/')+1,str.lastIndexOf('.'));
has comment: http://stackoverflow.com/comment/44976581
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28312468
answers question: http://stackoverflow.com/q/28312468
type: Answer
score: 2

http://stackoverflow.com/comment/44952717
type: Comment
score: 1
type: AnswerComment
has text: The generic function is good, and you can even exclude the `res` and `test` variables. Within the loop, do something like: `if(o==='age' && obj1.age<=obj2.age) return false; else if(obj1.hasOwnProperty(o) && obj1[o]!=obj2[o]) return false;` If the loop finishes without returning, you know the objects match.
comment on: http://stackoverflow.com/a/28297049

cors
type: Tag
tag name: cors
tags question: http://stackoverflow.com/q/28306953
tags question: http://stackoverflow.com/q/28324117
tags question: http://stackoverflow.com/q/28324992
tags question: http://stackoverflow.com/q/28386572

http://stackoverflow.com/comment/45059897
comment on: http://stackoverflow.com/a/28358282
score: 0
type: AnswerComment
has text: But if you're still stuck, you can always do something like this: http://jsfiddle.net/ujh5k8ko/ What that does is get your jsonString, subtring the first and last character (the quote), and then use `JSON.parse( JSON.stringify() )`
type: Comment

http://stackoverflow.com/q/28397183
type: Question
has body: I am occasionally getting this error when trying to remotely upload to imgur: Failed to load resource: the server responded with a status of 403 (Forbidden). But not all the time and that is suspicious. Here is my code: /* Drag and drop */ window.ondragover = function(e) { e.preventDefault(); }; window.ondrop = function(e) { e.preventDefault(); upload(e.dataTransfer.files[0]); }; function upload(file) { document.getElementById("view1").style.display = "none"; document.getElementById("loading").style.display = "inline"; var imageLink = ""; /* Is the file an image? */ if (!file || !file.type.match(/image.*/)) return; document.body.className = "uploading"; var fd = new FormData(); fd.append("image", file); // Append the file fd.append("key", "6528448c258cff474ca9701c5bab6927"); // The key var xhr = new XMLHttpRequest(); xhr.open("POST", "http://api.imgur.com/2/upload.json"); xhr.onload = function() { var link = JSON.parse(xhr.responseText).upload.links.imgur_page; document.getElementById("loading").style.display = "none"; document.querySelector("#link").href = link; document.querySelector("#link").innerHTML = link; var imageLink = ""+document.querySelector("#link").innerHTML.replace("http://imgur.com/", "http://i.imgur.com/")+".jpg"; /* Image Preview */ document.getElementById("result").style.display = "inline"; document.getElementById("link-to-image").style.background = "url(" + imageLink + ") center center no-repeat"; document.body.className = "uploaded"; }; /* Send the formdata */ xhr.send(fd); /* Remove the button */ document.getElementById("button").remove(); };
tagged with: javascript
has comment: http://stackoverflow.com/comment/45131247
has comment: http://stackoverflow.com/comment/45131748
accepted answer: http://stackoverflow.com/a/49156735
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: imgur
type: AnsweredQuestion
has title: Imgur API occasional 403 Forbidden?
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/49156735

http://stackoverflow.com/comment/45123739
type: QuestionComment
has text: Can you post your xml response?
score: 0
comment on: http://stackoverflow.com/q/28393498
type: Comment

http://stackoverflow.com/comment/45165467
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28416073
type: QuestionComment
has text: The issue is that `s` (wherever that is) is not the same in the context that logs `s` and the place where you log out `Object length: 7 models: Array[7] __proto__: n` - somehow it is being overwritten.

http://stackoverflow.com/q/28304345
has comment: http://stackoverflow.com/comment/44960330
type: UnansweredQuestion
has body: I've got an animation with CSS for my time bar with id="progress-bar" and the animation class .anim. The animation is CSS: @-webkit-keyframes myfirst { from { width: 100%; background-color: #86e01e; } to { width: 0%; background-color: #f63a0f; } } .anim { -webkit-animation: myfirst 5s linear; -webkit-animation-fill-mode: forwards; } I'm restarting the animation with the function reset() function reset() { document.getElementById("progress-bar").className = ""; setTimeout(function(){document.getElementById("progress-bar").className = "anim";},1); } Now I want the function lose() to be executed, when the animation ends. I've also tried multiple things with animationend listeners but it doesn't work for me... var x = document.getElementById("progress-bar"); x.addEventListener('webkitAnimationEnd', function() { lose(); //whatever i type here doesn't work }, false); Any ideas?
tagged with: animation
tagged with: css
tagged with: event-listener
type: Question
has title: Animation End Listener doesn't work properly
has answer: http://stackoverflow.com/a/48404409
has comment: http://stackoverflow.com/comment/44959985
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/44960210
answer count: 1

http://stackoverflow.com/comment/48347310
comment on: http://stackoverflow.com/q/28344075
type: Comment
type: QuestionComment
has text: show what code you've got so far
score: 0

http://stackoverflow.com/comment/45148621
type: QuestionComment
comment on: http://stackoverflow.com/q/28369572
has text: @jyrkim I was looking at your jsfiddle with fresh eyes, and it's not quite what I'm looking for. The row with a single column, for instance, the width should be the width of there entire table, or the two columns rows, the cells aren't being split where each cell would have 50% of with of the table. But I'm adapting your idea of doing the calculations inside the width tag, to get the cells to behave like there was a colspan tag. Thanks for the idea. I'm also quite new in this AngularJS framework :)
score: 0
type: Comment

http://stackoverflow.com/comment/44948859
type: QuestionComment
has text: `myLatlng` and `myLatLng` are not the same.
type: Comment
comment on: http://stackoverflow.com/q/28298449
score: 1

http://stackoverflow.com/q/28287466
tagged with: http://stackoverflow.com/tag/csv
tagged with: bigdata
possible better answer: http://stackoverflow.com/a/28287856
upvote count: 1
tagged with: plot
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28287693
score: 1
tagged with: java
has body: guys. I need to develop something to use at work, but I'm with some doubts, so I hope there's someone who can help me :) The situation: I work in the Information Security area of a company. We use the QualysGuard tool to search for vulnerabilities in our customers' servers. One of my functions is managing the Key Performance Indicators (KPI's), to keep track of how many patches we have applied along the weeks. I download the data in CSV format and then I make A LOT of stuff in Excel to organize everything, sorted by Customers names, Operating Systems and Severity of the vulnerabilities. The Problem: There's a HUGE amount of data in the downloaded CSV files (Each file has like 35MB, and 80000+ rows) and I have to do a lot of repetitive work to finally make these files look good fine (create pivot tables, sort by assets, OS and severity, separate groups of different amounts of data (e.g. some customers have 100+ servers, which means there are way more vulnerabilities in their servers than in customers with, let's say, only 2 servers. And I have to do this every week. At the end of the month, I have to list the top-10 most vulnerable servers for each customer and for each OS. And also plot these data in graps. What I need: My boss asked me if I could create a system (preferably web-based) that can read these CSV files and display their data, and maybe plot some graphs with them. The question: What's the best way to do that? I thought of using PHP, I've got some experience with parsing CSV files data and working with them, but, since PHP is a server-side language, I think I won't be able to display the data dynamically. So I'd like to know what programming language would be the best one in this case? Would Javascript handle it? Or something with python or ruby? Or maybe some web-application with Java? Or even PHP, if combined with MySQL queries? (I'm not sure if I'll be able to use the company's databases for it, so, MySQL solutions aren't my first choices XD ) Has anyb…
has title: Ways to display large amount of data from CSV files in HTML pages?
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/44929084
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28287693
has answer: http://stackoverflow.com/a/28287856
favorite count: 0

http://stackoverflow.com/comment/45085187
type: Comment
comment on: http://stackoverflow.com/q/28371449
type: QuestionComment
has text: @Xotic750: ya, I think the issue is that the JS language overloads the term "length" to mean either "element count" (in most cases) or "capacity" (in the context of this question). For example, [Java `ArrayLists`](http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html#ArrayList(int)) can be initialized with a positive *capacity* but that has no effect on *length* (size in java). Apparently JS doesn't make such a careful distinction.
score: 0

http://stackoverflow.com/comment/45194622
type: Comment
type: QuestionComment
score: 0
has text: @haxtbh updated question with details
comment on: http://stackoverflow.com/q/28432029

http://stackoverflow.com/comment/45159731
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28412111
has text: Thank you, LcSalazar, your explanation and code tidy up has sorted the matter out nicely for me. Much appreciated. Thank you to everyone else who answered - there were no wrong answers but sadly I can only mark one as the accepted answer. I marked the one that best fit what I was doing and helped in tidying up the code that was doing it. However there is another question now, but I'll ask that in another post!
score: 0

http://stackoverflow.com/comment/45063144
comment on: http://stackoverflow.com/q/28356361
type: Comment
has text: That is basically what I was asking - how to get a string and change it. s
score: 0
type: QuestionComment

http://stackoverflow.com/a/50382598
answers question: http://stackoverflow.com/q/28365737
type: Answer
upvote count: 24
has body: for(var i=1; i<=4; i++){ console.log("* ".repeat(i)); } /* Output is: "*" "* *" "* * *" "* * * *" */
score: 24
downvote count: 0

http://stackoverflow.com/comment/45121912
type: QuestionComment
has text: Yes I tried. How can I verify my results ? I can see first will execute and finish first (or is it ???? ) Is it the case for all scenarios ?
score: 0
comment on: http://stackoverflow.com/q/28392546
type: Comment

http://stackoverflow.com/a/28281315
has comment: http://stackoverflow.com/comment/44997475
has comment: http://stackoverflow.com/comment/44952938
has comment: http://stackoverflow.com/comment/45064523
has comment: http://stackoverflow.com/comment/45064381
answers question: http://stackoverflow.com/q/28280092
has comment: http://stackoverflow.com/comment/44989527
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/44940475
has body: You need to make sure you call your functions with valid parameters. Your rules were loaded without a problem, but you have an error in your code. You have this code: $(document).ready(function(){ $('#contentMenu').show('slide', {direction: 'up'}, 1000); showContent(); }); However, there is no such call possibility for .show(), read more here. After reading the other parts of your code, I suppose you wanted this: $(document).ready(function(){ $('#contentMenu').delay(1000).show('slide', {direction: 'up'}); showContent(); }); See fiddle. Whenever you encounter a problem, do not miss the possibility to check your console and debug.

http://stackoverflow.com/comment/45030224
has text: I added another suggestion based on what you may be after.
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28342536

http://stackoverflow.com/a/28379641
has comment: http://stackoverflow.com/comment/45098783
has comment: http://stackoverflow.com/comment/45098671
answers question: http://stackoverflow.com/q/28379589
has body: So If i did not get you wrong, I would use bootstrap's dropdown menu system before Javascript. Take a look at this http://getbootstrap.com/components/#navbar Otherwise if you really want to use JS. First change that link to be a button .ts-dropdown{ display: none; } Jquery: $(".nav-menu button").click(function(){ $(this).find(".ts-dropdown").css("display", "inline"); } would partially solve your problem. If you want to add a little animation that is something else
has comment: http://stackoverflow.com/comment/45098720
score: 0
type: Answer

http://stackoverflow.com/comment/44976748
score: 0
type: AnswerComment
has text: @delutu69 I added another example which may give you the clues you need to solve your problem. It doesn't use audio but should be similar... Can you figure out how to adapt this to your project?
type: Comment
comment on: http://stackoverflow.com/a/28312945

http://stackoverflow.com/a/28281379
upvote count: 1
score: 1
has body: setTimeout(function() { // your code },30000)
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28281341
answers question: http://stackoverflow.com/q/28281341

http://stackoverflow.com/a/28380131
has body: try this. html: &lt;input type="button" id="edit"&gt;&lt;br/&gt; jquery: $(document).ready(function(){ var get = 3; $("#edit").on('click',function(){ alert("Value is: " + get); //parameter value }); });
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28379939

http://stackoverflow.com/comment/44931278
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28288695
has text: aaaaaaand I figured it out. I just needed to change return.php to read `$c = $_POST['c'];` instead of `$c = $_GET['c'];`

http://stackoverflow.com/comment/44938882
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28292746
type: AnswerComment
has text: Can you use `getElementById()` function ? and if you could here is the js version http://jsfiddle.net/San_Krish/zv37ejuw/

http://stackoverflow.com/a/28399683
has body: Function.prototype.bind() also does partial application of any additional arguments, so you should be able to do this instead: onClick={this.handleUnlink.bind(this, p.id)} Bonus: The this argument to bind() is redundant if you're using React.createClass() to create your component, as it auto-binds methods for you, so I usually end up writing a partial helper: 'use strict'; var slice = Array.prototype.slice function partial(fn) { var partialArgs = slice.call(arguments, 1) return function() { return fn.apply(this, partialArgs.concat(slice.call(arguments))) } } module.exports = partial ... var partial = require('./utils/partial') // ... onClick={partial(this.handleUnlink, p.id)}
downvote count: 0
score: 3
upvote count: 3
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28399159
has comment: http://stackoverflow.com/comment/45143914
answers question: http://stackoverflow.com/q/28399159
type: Answer

http://stackoverflow.com/comment/45136803
score: 0
type: AnswerComment
has text: Thank you. Although I had to specify a timeout of at least a few milliseconds as 0 seems to execute within the same digest.
type: Comment
comment on: http://stackoverflow.com/a/28400335

http://stackoverflow.com/q/28426989
has title: How to eliminate Image overlapping in canvas(kineticjs)
downvote count: 1
type: Question
tagged with: canvas
tagged with: javascript
tagged with: jquery
tagged with: html5-canvas
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45203331
has comment: http://stackoverflow.com/comment/45185674
score: 2
has body: I am developing view of hotel floor using canvas with the help of kinetic js. But in that i am getting images overlapping each other in the canvas. help me out to eliminate that overlapping of images in the canvas. this is my code: // get a reference to the house icon in the toolbar // hide the icon until its image has loaded var $house=$("#house"); $house.hide(); // get the offset position of the kinetic container var $stageContainer=$("#container"); var stageOffset=$stageContainer.offset(); var offsetX=stageOffset.left; var offsetY=stageOffset.top; // create the Kinetic.Stage and layer var stage = new Kinetic.Stage({ container: 'container', width: 350, height: 350 }); var layer = new Kinetic.Layer(); stage.add(layer); // start loading the image used in the draggable toolbar element // this image will be used in a new Kinetic.Image var image1=new Image(); image1.onload=function(){ $house.show(); } image1.src="https://dl.dropboxusercontent.com/u/139992952/multple/4top.png"; // make the toolbar image draggable $house.draggable({ helper:'clone', }); // set the data payload $house.data("url","house.png"); // key-value pair $house.data("width","32"); // key-value pair $house.data("height","33"); // key-value pair $house.data("image",image1); // key-value pair // make the Kinetic Container a dropzone $stageContainer.droppable({ drop:dragDrop, }); // handle a drop into the Kinetic container function dragDrop(e,ui){ // get the drop point var x=parseInt(ui.offset.left-offsetX); var y=parseInt(ui.offset.top-offsetY); // get the drop payload (here the payload is the image) var element=ui.draggable; var data=element.data("url"); var theImage=element.data("image"); // create a new Kinetic.Image at the drop point // be sure to adjust for any border width (here border==1) var image = new Kinetic.Image({ name:data, x:x, y:y, image:theImage, draggable: true }); layer.add(image); layer.draw(); } body{padding:20px;} #container{ border:solid 1px #ccc; margin-top: 10px; width:350px; he…
answer count: 0
upvote count: 3

http://stackoverflow.com/a/28351593
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28351515
has body: try with keyup event &lt;input type="text" id="box_1"/&gt; &lt;input type="text" id="box_2"/&gt; $('#box_1').keyup(function(){ $('#box_2').val($(this).val()); })

http://stackoverflow.com/q/28350473
has body: I have this problem that in order to change the page contents I have to receive user input. I want to do this via popup form. After clicking the button "submit" on the popup I want to send the form input to a php file where I connect to the database and send the retrieved information via JSON to the js file where I use a $.post() method to achieve all this. The problem is that insted of the page contents being changed without reload I get redirected to a page http://localhost/statistics.php?major=KN&year=2011 but I want to stay on the page http://localhost/statistics.php. That is why I am using AJAX in the first place. major=KN & year=2011 are my POST parameters. Is it possible to change the contents of a page after submitting a popup form? Any help would be greatly appreciated. Here is the code that I think could be relevant to solving the issue: Fill the form Submit Compare groups The js/statistics_js.js file: function error(){ alert('Error!'); } $(document).ready(function(){ $('#group').on('click', function(e) { e.preventDefault(); document.getElementById('abc').style.display = "block"; }); }); $(document).ready(function(){ $("#submit1").click( function() { $.post( "http://localhost/group_sort.php", $("#form1").serialize(), "JSON").done(function(data) { //This should use the Chart.js library to draw a chart on the canvas with the data retrieved from the server. var barChartData = { labels : data.groups, datasets : [ { 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 : data.groups_total_points } ] } var ctx = document.getElementById("myChart").getContext("2d"); window.myBar = new Chart(ctx).Bar(barChartData, { responsive : true }); }).error(error); }); }); function div_hide_group_popup(){ document.getElementById('abc').style.display = "none"; } My group_sort.php: <?php require "config.php"; try { $conn = new PDO("mysql:host=" . DB_SERVER . ";dbname=" …
type: Question
has answer: http://stackoverflow.com/a/28351565
tagged with: javascript
tagged with: jquery
answer count: 2
possible better answer: http://stackoverflow.com/a/28351565
accepted answer: http://stackoverflow.com/a/28350707
tagged with: ajax
has title: Change page contents with AJAX after submiting a popup form
tagged with: php
type: AnsweredQuestion
tagged with: popup
score: 0
has answer: http://stackoverflow.com/a/28350707

modal-dialog
tag name: modal-dialog
tags question: http://stackoverflow.com/q/28370503
tags question: http://stackoverflow.com/q/28327674
type: Tag
tags question: http://stackoverflow.com/q/28389380
tags question: http://stackoverflow.com/q/28422035
tags question: http://stackoverflow.com/q/28383542
tags question: http://stackoverflow.com/q/28296680

http://stackoverflow.com/comment/45028436
score: 0
comment on: http://stackoverflow.com/q/28341802
has text: If it were files, I'd suggest a streamable JSON implementation, but since you're saving into a DB, you need the whole string in memory anyways
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/44940523
score: 1
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28293926
has text: *"doesn't seem to work for me."* Could you please describe the problem in more detail? Also include the relevant code directly in your question.

http://stackoverflow.com/q/28357634
tagged with: javascript
tagged with: express
has title: Can't set headers after they are sent node js
score: 0
accepted answer: http://stackoverflow.com/a/28357750
answer count: 1
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28357750
type: Question
tagged with: multer
has body: I'm trying to send some form data, but I get this error using express.js: Can't set headers after they are sent. This is my code so far: app.post('/api/users/profile/:username', isAuthenticated, userUploads, function(req, res, next) { if (req.params.username) { User.findOne({ username: req.params.username }, function(err, user) { if (err) return next(err); user.profile.name = req.body.name; user.profile.gender = req.body.gender; var files = req.files.file; if (files){ if (files.length &gt; 0){ for (f in files){ user.profile.pictures.push(files[f]) } }else{ user.profile.pictures.push(files) } } user.save(function(err) { if (err) return next(err); res.send(200); }); console.log(res.send(user)) //HERE IS WHERE I GET THE ERROR }); }else{ return res.send(400, { message: 'User does not exist!!' }); } });

http://stackoverflow.com/a/28333834
has body: Let's alter the content dinamically - I will make the clicking on lala available: one lala Script: var htmlText = $('#gig').text(); //the big divs text var children = $('#gig').children(); //get dom elements so they can be ignored later $.each(children, function (index, child) { var txt = $(child).text().trim(); if (txt != '') { //if a child has text in him htmlText = htmlText.replace(txt, 'xxx'); //replace it in the big text with xxx } }); htmlText = htmlText.split("xxx"); //split for xxx make it arrat var counter = 0; //the part when the text is added $.each(htmlText, function (i, el) { htmlText[i] = el.trim(); if (htmlText[i] != "") { //if there is something here than it's my text htmlText[i] = '' + htmlText[i] + ''; //replace it with a HTML element personalized counter++; //mark that you have replaced the text } else { // if there is nothing at this point it means that I have a DOM element here htmlText[i] = $(children[i - counter])[0].outerHTML; //add the DOM element } }); if (children.length >= htmlText.length) { //you might have the case when not all the HTML children were added back for (var i = htmlText.length - 1; i < children.length; i++) { htmlText[i + 1] = $(children[i])[0].outerHTML; //add them } } htmlText = htmlText.join(""); //form a HTML markup from the altered stuff $('#gig').html(htmlText); // replace the content of the big div $('#text').on('click', function (data) { //add click support alert('ok'); }); See a working example here: http://jsfiddle.net/atrifan/5qc27f9c/ P.S: sorry for the namings and stuff I am a little bit tired. Are you able to do this, is this what you are looking for? What the code does: It's making only the text inside the div although the div could have other divs as well, makes only the text that has no HTML container like a div a span a p an a or something like that and alters it adding it in a span and making it available for clicking.
downvote count: 0
has comment: http://stackoverflow.com/comment/45014821
type: Answer
answers question: http://stackoverflow.com/q/28333327
has comment: http://stackoverflow.com/comment/45014503
has comment: http://stackoverflow.com/comment/45014651
upvote count: 1
score: 1

http://stackoverflow.com/comment/44951746
has text: This seems good, but I think there is a reson why someone put you -1, but I will give a try
type: AnswerComment
score: 1
type: Comment
comment on: http://stackoverflow.com/a/28299920

http://stackoverflow.com/comment/45146889
comment on: http://stackoverflow.com/q/28383579
has text: Are you using `prependId="false" on the form? If not then your selectors are not going to find anything.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/28434231
upvote count: 1
type: Answer
has body: Simply put: because an operator works on operands, and functions are, in JS at least, first class objects (meaning they can be passed around, and returned, and operated on). To do so, you'll of course need to use operators. A simple, not too far fetched example: function foo() { return foo.bar;//. is an operator } console.log(foo());//logs undefined foo.bar = '123';//again, the . operator console.log(foo());//logs 123 What happens in your case, however, is JS will evaluate both operands (the expressions on either side of the operator): console.log (LOperand) | (operator) ('hello world') (ROperand, to be evaluated further still because of the grouping operator ()) And attempt to evaluate them to compatible types for the operator to do its work. console.log is an object, a function instance in fact. hello world is a string constant inside a the grouping operator. How these types will be coerced and evaluated is specified in the ECMAScript standard (google it), but bottom line, the function (console.log) could well be coerced to a string (as if you'd call console.log.toString(), which gives "function log() { [native code] }" on chromium). The upshot is that the code behaves the same as: "function log() { [native code] }"|"Hello world" which yields 0
downvote count: 0
answers question: http://stackoverflow.com/q/28433989
score: 1

http://stackoverflow.com/q/28394796
type: UnansweredQuestion
has title: Validate entire form except fields under a specific div with Semantic Validator
type: Question
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/28395184
tagged with: validation
answer count: 1
has body: I'm using Semantic form validation in a project, but I got an issue. There is a big form with four dynamic fields with lots of rules that is cloned from a hidden template div. Example: name: More Now when click in More, a new field "Name" appears. My problem is when I try to validate those fields, the validator see the template fields as empty (beacuse it's really empty) and don't procceed with the post. There is a way to bypass the div "template" and validate only those divs below? The validator code is like that: $('.big_form') .form({ name: { identifier: 'name', rules: [ { type: 'length[14]', prompt: 'Please fill something' } ] }, etc. Thank you very much. Regards, Al
tagged with: semantic-ui

http://stackoverflow.com/a/28370057
type: Answer
upvote count: 19
has body: It can be done. First remove the data-target="#collapseExample" from the elements you want to collapse. Then add an extra class to your toggle button, I've added 'collapser'. That's not really needed, but it's nice to identify the toggle button. Then add some jQuery to do the toggling, in this case I am using next() to get the subsequent element to the toggle button which is your element you wish to collapse. $('.collapser').click(function() { $(this).next().collapse('toggle'); }); Example jsFiddle
score: 19
answers question: http://stackoverflow.com/q/28369836
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28369836
downvote count: 0

http://stackoverflow.com/a/28302171
type: Answer
has comment: http://stackoverflow.com/comment/61362473
answers question: http://stackoverflow.com/q/28301958
upvote count: 7
has comment: http://stackoverflow.com/comment/60305892
has body: These are not mutually exclusive constructs and both have different uses. Using track by simply allows Angular to better manage the DOM when items are added or removed. By default, it uses a hash of the entire object, which can be slow and inefficient compared to a simple atomic value. Using one time binding syntax however simply reduces the number of total watches in the application. This makes the app more responsive when performing updates because it has less things to watch.
score: 7
has comment: http://stackoverflow.com/comment/44959377
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28301958
has comment: http://stackoverflow.com/comment/44956839

http://stackoverflow.com/q/28330574
score: 1
upvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28330715
downvote count: 0
answer count: 1
favorite count: 0
has body: I have a node.js server that connects to an IRC channel. I can successfully output all messages from the channel to the console, but I'd like the messages to be displayed in real time on a webpage. I am looking into socket.io but can't come up with anything, is this the best way? All I need to know is how to update text on the webpage in realtime, I can see the messages if I refresh the page, but it is 1 message at a time. I believe I need a client script for this, but I am unsure where to start. Thanks! // Get the lib var irc = require("irc"); // Create the bot name bot.addListener("message#", function(nick, to, text, message) { console.log(nick, " :=&gt; ", text); }); var http = require('http'); http.createServer(function (req, res) { var bot = new irc.Client(config.server, config.nick, config); bot.addListener("message#", function(nick, to, text, message) { console.log(nick, " :=&gt; ", text); res.writeHead(200, {'Content-Type': 'text/plain'}); res.write(text); res.end(text); }); }).listen(1337, '127.0.0.1'); console.log('Server running at http://127.0.0.1:1337/');
type: UnansweredQuestion
tagged with: irc
tagged with: node.js
has title: Real time text using node.js

http://stackoverflow.com/q/28369121
downvote count: 0
score: 1
type: Question
tagged with: firefox
tagged with: javascript
has answer: http://stackoverflow.com/a/28369233
has comment: http://stackoverflow.com/comment/45079144
tagged with: post
answer count: 2
upvote count: 1
possible better answer: http://stackoverflow.com/a/28369233
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28369281
favorite count: 0
has body: I have the following js function that sends a post request back to the main index page. This script is working in Chrome but is not sending any parameters in firefox while still posting back to the page. I am verifying this via the network tab after inspecting the page in firefox. function addDrive(ans){ $.post("index.php", {add_drive: ans }); location.reload(); } This function is called via a onClick on a button I have placed on my page: Add Drive I have used similar functions in the past that have worked for both firefox and chrome and I just cant figure out why this does not work in firefox.
has answer: http://stackoverflow.com/a/28369281
has title: Javascript not sending post parameters in Firefox
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45079054

http://stackoverflow.com/q/28408926
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has body: I did a little web page. This page has Dropdow linked to the database of dependencies that normally run on localhost. But when I try to access through the domain name with the IIS server stops working. Are always in "Load" mode. Can someone tell me why this happens? It will be me who can help please? Thank you all. Any questions I try to explain better. sincere Greetings Code of Html dependent Dropdown Local: <?php while($row = mysql_fetch_array($query_parent4)): ?> <option value="<?php echo $row['idBuilding']; ?>"><?php echo $row['idBuilding']; ?> <?php endwhile; ?> Code of javascript dependent Dropdown Localhost IIS The strange thing is that works 100% through localhost and doesn't work through IIS. I had a jQuery Datepicker and works fine...
has comment: http://stackoverflow.com/comment/45156198
type: UnansweredQuestion
tagged with: iis
has comment: http://stackoverflow.com/comment/45152395
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45151720
score: 1
has comment: http://stackoverflow.com/comment/45151588
has answer: http://stackoverflow.com/a/28413582
answer count: 1
downvote count: 0
tagged with: javascript
has title: javascript function work on localhost but doesn't work on iis
has comment: http://stackoverflow.com/comment/45152224
favorite count: 0
has comment: http://stackoverflow.com/comment/45153283
has comment: http://stackoverflow.com/comment/45151665

http://stackoverflow.com/a/28394311
has comment: http://stackoverflow.com/comment/45125280
type: Answer
answers question: http://stackoverflow.com/q/28394087
downvote count: 1
upvote count: 0
score: -1
has body: Replace if(window.location.href.indexOf("/create" != -1) || window.location.href.indexOf("/edit" != -1)) { setTimeout('sessionRefresh()',1000); } with if(window.location.href.indexOf("/create") != -1 || window.location.href.indexOf("/edit") != -1) { setTimeout('sessionRefresh()',1000); }

http://stackoverflow.com/comment/45179126
type: QuestionComment
type: Comment
score: 0
has text: could you explain the difference between the two? Did you want to allow or not allow?
comment on: http://stackoverflow.com/q/28423056

http://stackoverflow.com/comment/45152224
has text: @KIKOSoftware, yes, jquery is present...
comment on: http://stackoverflow.com/q/28408926
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28391692
has body: This should work on all Browsers: function withoutPropVal(ary, propVal){ var a = []; for(var i=0,l=ary.length; i&lt;l; i++){ var o = ary[i], g = 1; for(var n in o){ if(o[n] === propVal)g = 0; } if(g)a.push(o); } return a; } var newArray = withoutPropVal(yourArray, 'Object Property Value to Leave those Objects Out Here');
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28391564

http://stackoverflow.com/q/28386386
tagged with: chart.js
upvote count: 5
tagged with: javascript
type: Question
answer count: 2
score: 5
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/28431142
has answer: http://stackoverflow.com/a/60856735
has comment: http://stackoverflow.com/comment/76096297
has title: chart.js set one bar as different colour?
has answer: http://stackoverflow.com/a/28431142
has body: So I have this code which is happily displaying a graph in the format I require: I would like to have one of the bars within that graph shows as a different colour from those that are set in the code above.
linked to: http://stackoverflow.com/q/25594478
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/60856735

http://stackoverflow.com/q/28402509
type: AnsweredQuestion
tagged with: reduce
tagged with: underscore.js
tagged with: contain
accepted answer: http://stackoverflow.com/a/28402775
type: Question
tagged with: javascript
has title: Underscore.js--- the relationship between _.contains and _.reduce
has answer: http://stackoverflow.com/a/28402775
score: 0
has body: Can anyone explain how the _.reduce function works within _.contain function? Why is it "false" for the third parameter of the reduce function? _.contains = function(collection, target) { return _.reduce(collection, function(wasFound, item) { if (wasFound) { return true; } return item === target; }, false); };
answer count: 1

http://stackoverflow.com/a/28406306
has comment: http://stackoverflow.com/comment/45147067
has comment: http://stackoverflow.com/comment/45147181
type: Answer
has comment: http://stackoverflow.com/comment/45147244
score: 1
upvote count: 3
downvote count: 2
has comment: http://stackoverflow.com/comment/45147223
has body: You should add return false; in your if code block if you dont want the redirect. Its the browser's default to refresh the page when the form is submitted. To prevent this refresh, add return false;. Learn more: return | MDN
answers question: http://stackoverflow.com/q/28406271
has comment: http://stackoverflow.com/comment/45147081
has comment: http://stackoverflow.com/comment/45147135

http://stackoverflow.com/q/28341580
downvote count: 0
has answer: http://stackoverflow.com/a/28351516
type: UnansweredQuestion
type: Question
score: 3
tagged with: performance
tagged with: javascript
has title: RUM (Real User Monitoring) User-perceived load times and location
upvote count: 3
answer count: 3
has answer: http://stackoverflow.com/a/32825780
has answer: http://stackoverflow.com/a/28347859
favorite count: 0
tagged with: graphite
tagged with: statsd
tagged with: page-load-time
has body: I wish to monitor user-perceived page load times on my website based on the users approximate geographical location as well as other info such as browser versions etc. This can all be gathered via JavaScript on the pages. My issue however is what is the best option for sending, storing and then presenting the data that I am monitoring? I have looked at graphite and statsd but I am unsure if these would work as I need to show correlations between user location and load times for various pages e.g. Login, Create new order, etc

http://stackoverflow.com/comment/44968566
comment on: http://stackoverflow.com/a/28308185
score: 0
type: AnswerComment
type: Comment
has text: Where those rows come from? A database? Are they just random? If they're random, how do you know what to show in the "viewmore" page? You should an unique `id` for each row, so you know what you should display in the "viewmore" page.

http://stackoverflow.com/a/28324663
has body: SEO implementation on SPAs is not trivial and not all search engine support it currently i think google, and maybe bing are able to crawl SPA's but some work needs to be done for that. there are several methods you can do this: 1 use !# for your angular routes instead of just # 2 use html5 routes instead of # routes 3 detect crawlers on your server and serve the metadata 4 create snapshots of your site and serve them basically those are most of your options you can find more details in these articles http://www.yearofmoo.com/2012/11/angularjs-and-seo.html https://developers.google.com/webmasters/ajax-crawling/
type: Answer
has comment: http://stackoverflow.com/comment/45060595
answers question: http://stackoverflow.com/q/28301663
has comment: http://stackoverflow.com/comment/45385394
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45059398
downvote count: 0

http://stackoverflow.com/q/28377882
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/45102843
possible better answer: http://stackoverflow.com/a/28384890
type: Question
upvote count: 4
accepted answer: http://stackoverflow.com/a/28386230
has answer: http://stackoverflow.com/a/28384890
answer count: 2
has comment: http://stackoverflow.com/comment/45097534
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/45102452
tagged with: css
has comment: http://stackoverflow.com/comment/45102740
has title: Tumblr style UserHoverCard
has answer: http://stackoverflow.com/a/28386230
has body: Hi everyone i have one problem with ajax hover. I am trying to make a userHoverCard like tumblr. But the hover animation not working when i use it with ajax. This is working DEMO without ajax only css. In this demo you can see when you hover image then .p-tooltip will open with animation effect. But if you click this DEMO from my test page then you can see when you hover an image then .p-tooltip will not open with animation effect. HTML This is my ajax code: $(document).ready(function() { function showProfileTooltip(e, id){ e.append($('.p-tooltip').css({ 'top':'20', 'left':'80' }).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().fadeIn('fast'); } $('.summary a').hover(function(e){ var id = $(this).attr('data-id'); showProfileTooltip($(this), id); }, function(){ setTimeout(function(){ hideProfileTooltip(); },2000); }); }); And here is CSS code: .summary { margin: 50px auto 0; width: 50px; height: 50px; position: relative; } .profile-ava { width: 50px; height: 50px; background-image: url(http://gravatar.com/avatar/3913c4e14034c0a7f28db2c632290c21?s=80); border-radius: 3px; background-size: 50px 50px; display: block; } .summary a:hover:before { content: ''; position: absolute; display: block; bottom: -10px; left: 0; height: 10px; width: 100%; z-index: 2; } .p-tooltip { position: absolute; margin-top: 10px; top: 100%; left: 50%; margin-left: -140px; width: 280px; max-height: 120px; border-radius: 5px; overflow: hidden; background-color: #F0F0F0; visibility: hidden; opacity: 0; transition: all 0.5s ease; } .profile-header { height: 120px; background-image: url(https://pbs.twimg.com/profile_banners/571038694/1395748220/1500x500); background-size: auto 120px; background-position: 50%; } .profile-navigation { position: absolute; top: 0; left: 0; padding: 10p…
has comment: http://stackoverflow.com/comment/45102803
downvote count: 1

tabs
type: Tag
tags question: http://stackoverflow.com/q/28404179
tags question: http://stackoverflow.com/q/28383466
tags question: http://stackoverflow.com/q/28357815
tag name: tabs

http://stackoverflow.com/q/28367078
has title: What the different between "this." and "prototype." on build js Class.
score: 2
type: Question
downvote count: 0
tagged with: javascript
favorite count: 0
linked to: http://stackoverflow.com/q/310870
duplicate of: http://stackoverflow.com/q/310870
has body: function Test() { this.log = function(val) { console.log('test'); }; } var test = new Test; test.log(); and function Test() {} Test.prototype.log = function() { console.log('test') }; var test = new Test; test.log(); i.e. a method in a class is declared in the prototype or in this. The result appears as one: method, the newly created object so that it works
answer count: 0
upvote count: 2
type: UnansweredQuestion

http://stackoverflow.com/a/28335158
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45016716
answers question: http://stackoverflow.com/q/28335143
has comment: http://stackoverflow.com/comment/45016848
type: Answer
has comment: http://stackoverflow.com/comment/45016836
has body: You can listen to either of the show.bs.modal/shown.bs.modal events. Within the function, the event has a relatedTarget property attached to it. You can use this to determine which button triggered the modal to open. Bootstrap 3 - Modal events: This event fires immediately when the show instance method is called. If caused by a click, the clicked element is available as the relatedTarget property of the event. $('.modal').on('show.bs.modal', function (e) { var $trigger = $(e.relatedTarget); }); Example Here .. and if you want to access the data-button attribute, use: $(e.relatedTarget).data('button'); Conversely, if you want to determine which button caused the modal to close, see this answer.
has comment: http://stackoverflow.com/comment/87348278
score: 24
upvote count: 24
accepted answer of: http://stackoverflow.com/q/28335143

http://stackoverflow.com/comment/45143859
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28404078
score: 0
has text: The point is this question is not that bad so as to receive a downvote.

http://stackoverflow.com/q/28409845
tagged with: javascript
has title: Rendering in Aptana Different than in a Static Browser
type: AnsweredQuestion
tagged with: jquery
type: Question
has answer: http://stackoverflow.com/a/29431947
score: 0
has comment: http://stackoverflow.com/comment/45154990
has body: I am experimenting with developing a primitive web interface using Aptana Studio 3, and when I run the site from Aptana as an internal server in either IE or Firefox, the page renders as I expect. In contrast, when I open the same HTML page in a browser (i.e. not running it through Aptana), it displays incorrectly (e.g. modal dialog appears at the bottom of the page rather than as modal when I click a button). I tried different "meta" compatibility commands at the top of the HTML code to see if I could duplicate how Aptana opens the site. I am not sure if JS and JQuery need to be run as a server or if this is an indication of a bug in my code. If it is a requirement to run JS, JQuery, and bootstrap in a server as Aptana does, any guidance on how to duplicate what Aptana is doing in a standalone offline fashion would be sincerely appreciated. Note: This is a for a class assignment. The assignment is unrelated to JQuery and Javascript; rather it is on UI design patterns and software engineering. The reason I am using JS and JQuery is I thought this assignment would be a good opportunity to become more familiar with those tools.
answer count: 1
tagged with: aptana3
accepted answer: http://stackoverflow.com/a/29431947

http://stackoverflow.com/a/28414400
answers question: http://stackoverflow.com/q/28414166
type: Answer
has body: You are not initializing your Action objects, in your campaign view model you need to new-up your action view models and push them into the observable array: function Campaign(data) { var self = this; self.Name = ko.observable(data.Name); self.Deadline = ko.observable(data.Deadline); self.ActionList = ko.observableArray([]); if(data.ActionList){ for(var i = 0; i &lt; data.ActionList.length; i++){ self.ActionList.push(new Action(data.ActionList[i])); } } } You will need to do the same thing for your Service view model as well. e.g.: function Service(data) { var self = this; self.Cost = ko.observable(data.Cost); } function Action(data) { var self = this; self.Name = ko.observable(data.Name); self.Dates = ko.observableArray(data.Dates); self.Services = ko.observableArray([]); if(data.Services){ for(var i = 0; i &lt; data.Services.length; i++){ self.Services.push(new Service(data.Services[i])); } } self.OverallCost = ko.computed(function() { calculated = 0; ko.utils.arrayForEach(self.Services(), function(item) { calculated += parseFloat(ko.utils.unwrapObservable(item.Cost)); }); return calculated; }); }
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28414166
score: 0

http://stackoverflow.com/q/28420760
has title: Access data with JavaScript
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45192042
has comment: http://stackoverflow.com/comment/45174712
tagged with: http://stackoverflow.com/tag/html
tagged with: plaintext
accepted answer: http://stackoverflow.com/a/28430900
upvote count: 2
possible better answer: http://stackoverflow.com/a/28420861
tagged with: object
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28430900
has body: I have an &lt;object&gt; tag like this: &lt;object id="text" data="file.txt"&gt;&lt;/object&gt; And I can get the element like this: var text = document.getElementById("text"); Now, how do I get the content of the text file? The purpose of this is to: avoid having to make an XMLHttpRequest; avoid having text data in the form of a constant in code; keep a simple plaintext file in it's original form, without JSON or special formatting, to be accessed by code and become a string variable. In the same fashion you can have an &lt;img&gt; or &lt;audio&gt; tag in the document and then access the image / sound, just for text files. PS: I'm almost positive the &lt;object&gt; tag is not the ideal tag for this. This is just as far as I came trying to accomplish what I need.
has comment: http://stackoverflow.com/comment/45191298
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45178134
has answer: http://stackoverflow.com/a/28420861

http://stackoverflow.com/a/28384128
type: AcceptedAnswer
has body: The reason this happens is that reader.readAsDataURL() is asynchronous. You have to pass a callback to readBlob which is called when it is finished: function readBlob(opt_startByte, opt_stopByte, done) { ... reader.onload = function(evt) { window.bits.push(CryptoJS.AES.encrypt(evt.target.result, window.password)); done(); }; ... } function encrypt() { ... var startByte = 0; var endByte = 0; var callback = function(){ alert('Here I want the total array length:' + window.bits.length); }; while(startByte &lt;= document.querySelector('input[type=file]').files[0].size - 1) { endByte = startByte + 1024; (function(startByte, endByte, newCallback){ callback = function(){ readBlob(startByte, endByte, newCallback); }; })(startByte, endByte, callback); startByte = endByte; } callback(); // run the chain } There is simply no other sensible way, because JavaScript doesn't have a sleep function.
type: Answer
answers question: http://stackoverflow.com/q/28383485
has comment: http://stackoverflow.com/comment/45107148
accepted answer of: http://stackoverflow.com/q/28383485
has comment: http://stackoverflow.com/comment/45106761
has comment: http://stackoverflow.com/comment/45107317
has comment: http://stackoverflow.com/comment/45106356
has comment: http://stackoverflow.com/comment/45108955
has comment: http://stackoverflow.com/comment/45108254
score: 0

http://stackoverflow.com/comment/44926562
type: QuestionComment
has text: Could you add an example and the regex you are using?
comment on: http://stackoverflow.com/q/28285565
score: 0
type: Comment

http://stackoverflow.com/q/28395469
tagged with: image
has body: Hi I am working on integrating JSSOR slider with my database images. I added code in my index.html. &lt;div id="slider1_container" style="position: relative; top: 0px; left: 0px; width: 600px; height: 327px; background: #fff; overflow: hidden; "&gt; &lt;!-- Slides Container --&gt; &lt;div u="slides" style="cursor: move; position: absolute; left:50px; right:20px; top: 50px; width: 475px; height: 300px; overflow: hidden;"&gt; &lt;div&gt; &lt;img src="test/01.jpg" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; then in my js file /*Gallery Item Start*/ $('#galleryItem').on('pageshow', function () { var verticaltext = ""; var allItems = Tables.images.all(); var rating = []; allItems.list(null, function (results) { results.forEach(function (r) { // alert(JSON.stringify(r)); rating.push([r.capturedDate, r.name, r.ratingTreatment, r.ratingSkinCleansing, r.ratingPlucking, r.ratingView, r.ratingLastVal, r.capturedDate]); }); $.each(rating, function (key, value) { console.log("record is " + value[1]); verticaltext = verticaltext + "&lt;div&gt;&lt;img src=" + value[1] +"&gt;&lt;/div&gt;" }); // verticaltext = verticaltext + "&lt;/div&gt;"; console.log("FULL HTML IS " +verticaltext); sliderDataReady(verticaltext); }); }); /*created a function which should be called with the ready html to bind to JSSOR SLider*/ function sliderDataReady(slideData) { console.log("slider1_container HTML : " +$('#slider1_container').html()); console.log(" slides HTML : " +$('#slides').html()); $('#slides').append(slideData); console.log(" slides HTML : " +$('slides').html()); /* Gallery items carousel slider - start */ var options = { $StartIndex: 0, //[Optional] Index of slide to display when initialize, default value is 0 $LazyLoading: 3, $AutoPlay: false, //[Optional] Whether to auto play, to enable slideshow, this option must be set to true, default value is false $AutoPlaySteps: 1, //[Optional] Steps to go for each navigation request (this options applys only when slideshow disabled), the default …
score: 0
tagged with: slider
answer count: 1
accepted answer: http://stackoverflow.com/a/28406428
tagged with: jssor
tagged with: loading
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28406428
has title: images from database not getting loaded in Jssor Slider
type: Question
tagged with: javascript

http://stackoverflow.com/a/28369777
score: 0
has comment: http://stackoverflow.com/comment/45082308
has comment: http://stackoverflow.com/comment/45082451
has comment: http://stackoverflow.com/comment/45082359
answers question: http://stackoverflow.com/q/28368596
has body: What you are trying to do with var vm = this is a local variable to directive 1's JS scope (not angular's $scope object). Directive2 will never have access to it. To provide access you will have to attache vm to directive one's scope. Then it will be accessible to the nested directive two's $scope. Like this in directive one $scope.vm = this; // This will work $scope.vm.test = 'test from directive1 scope'; Like this in directive two controller: function ($scope) { console.log($scope.vm.test) // this will work for you Here is a working jsFiddle example. working jsFiddle example
has comment: http://stackoverflow.com/comment/45080662
type: Answer

http://stackoverflow.com/comment/45177114
comment on: http://stackoverflow.com/a/28421483
type: AnswerComment
type: Comment
has text: You are absolutely right, Joe! Thanks a ton! You have almost reproduced my implementation :) How would I not notice it's just a matter of setting the `activeLink` again in `addLink`?
score: 0

http://stackoverflow.com/comment/44973794
score: 0
type: Comment
type: QuestionComment
has text: I'm thinking the only way to do this is to strip ignored characters from evaluated string and then re-insert them in the appropriate places after the .replace().
comment on: http://stackoverflow.com/q/28311457

http://stackoverflow.com/comment/45065897
type: Comment
type: QuestionComment
has text: It's `getElementsByClassName` not `getElementByClassName`! missing **s**!
score: 2
comment on: http://stackoverflow.com/q/28361824

http://stackoverflow.com/comment/44980870
type: Comment
has text: thanks but I'm using javascript only to prevent conflict with other javascript library
comment on: http://stackoverflow.com/a/28315731
score: 0
type: AnswerComment

http://stackoverflow.com/comment/44928739
type: QuestionComment
comment on: http://stackoverflow.com/q/28286864
has text: and the code DOES work, it just doesnt update live. i have to refresh the page to get an accurate count number.
score: 0
type: Comment

http://stackoverflow.com/comment/45310191
type: Comment
comment on: http://stackoverflow.com/a/28472017
score: 0
type: AnswerComment
has text: What do you mean by accessing it using the filesystem versus having the full path? I use ``cdvfile://`` for the persistent images but I actually tried images inside the APK itself and it didn't make a difference on the loading screen. How would I "get a full path"? Do you mean this? http://stackoverflow.com/questions/15261532/get-absolute-path-to-assets-folder-in-phonegap

http://stackoverflow.com/a/28368635
score: 1
has comment: http://stackoverflow.com/comment/45079153
has comment: http://stackoverflow.com/comment/45294992
has comment: http://stackoverflow.com/comment/45082809
answers question: http://stackoverflow.com/q/28363513
accepted answer of: http://stackoverflow.com/q/28363513
upvote count: 1
type: AcceptedAnswer
has body: First - the code that you're using is outdated and there are syntax errors. Here is a shorter version of syntactically correct HTML % Deferred delivery of goods % Deposit is taken % Subscriptions % Total And the JavaScript, which I commented what it's doing on every line so you can learn from it: // IIFE - create local "document" (function (document) { // Store all of the "input" elements in the variable "elems" var elems = document.getElementsByTagName("input"); // Store an array of id's of the items to sum in the variable "idsToSum" var idsToSum = ["strPercDeferredGoods", "strPercDeposits", "strPercSubscriptions"] // Loop through the "input" elements for (var i = 0; i < elems.length; i++) { // For each "input" element, add a "change" event listener // When the event happens, run the function elems[i].addEventListener("change", function () { // Define a variable "sum" and assign a value of 0 to it var sum = 0; // Loop through all of the "idsToSum" for (var a = 0; a < idsToSum.length; a++) { // If the value of the current input is a number (removing the % sign if applicable), then add the value to the "sum" variable. Otherwise, add 0 sum += isNaN(parseFloat(document.getElementById(idsToSum[a]).value.replace("%", ""))) ? 0 : parseFloat(document.getElementById(idsToSum[a]).value.replace("%", "")); } // If the value of "sum" is greater than 100 if (sum > 100) { // Clear the "CardTotal" value document.getElementById("CardTotal").value = ""; // Alert an error alert("Total is not equal to 100%"); } // Otherwise else { // Assign the value of "CardTotal" to the value of "sum" and add a % sign document.getElementById("CardTotal").value = sum + "%"; } }); } // IIFE - pass in global "document" })(document); Note: Your JavaScript should be placed just before the HTML end body Here is a working example: (function (document) { var elems = document.getElementsByTagName("input"); var idsToSum = ["strPercDeferredGoods", "strPercDeposits", "strPercSubscriptions"] for (var i = 0; i < …
has comment: http://stackoverflow.com/comment/45327555
type: Answer
downvote count: 0

http://stackoverflow.com/a/28352762
has comment: http://stackoverflow.com/comment/45049507
has comment: http://stackoverflow.com/comment/45049814
has comment: http://stackoverflow.com/comment/45049610
upvote count: 5
has body: The reason is because of the combination of your directive priority with terminal option. It means that ngModel directive will not render at all. Since your directive priority (1000) is greater than ng-model's(0) and presence of terminal option will not render any other directive with lower priority (than 1000). So some possible options are : remove the terminal option from your directive or reduce the priority of your directive to 0 or -1 (to be less than or equal to ngModel) or remove ng-model requirement from the directive and possibly use a 2-way binding say ngModel:"=" (based on what suits your requirement). Instead of adding tooltip attribute and recompiling the element, you could use transclusion in your directive and have a directive template. terminal - If set to true then the current priority will be the last set of directives which will execute (any directives at the current priority will still execute as the order of execution on same priority is undefined). Note that expressions and other directives used in the directive's template will also be excluded from execution. demo angular.module('app', []).directive('validator', function($compile) { return { restrict: 'A', require: 'ngModel', replace: false, terminal: true, scope: { model: '=ngModel', initialValidity: '=initialValidity', validCallback: '&', invalidCallback: '&' }, compile: function compile(element, attrs) { element.attr('tooltip', '{{validationMessage}'); element.removeAttr("validator"); return { post: function postLink(scope, element) { $compile(element)(scope); } }; }, } }) As explained in my comments you do not need to recompile the element and all these stuffs, just set up an element and append it after the target element (in your specific case, the input). Here is a modified version of validation directive (i have not implemented any validation specifics which i believe you should be able to wire up easily). So what you need is to set up custom trigger for tooltip which you can do by usin…
has comment: http://stackoverflow.com/comment/45050032
has comment: http://stackoverflow.com/comment/45049588
type: Answer
has comment: http://stackoverflow.com/comment/45049357
has comment: http://stackoverflow.com/comment/45050559
has comment: http://stackoverflow.com/comment/45050351
has comment: http://stackoverflow.com/comment/45087128
downvote count: 0
has comment: http://stackoverflow.com/comment/45049493
accepted answer of: http://stackoverflow.com/q/28352641
has comment: http://stackoverflow.com/comment/45049525
has comment: http://stackoverflow.com/comment/45050467
answers question: http://stackoverflow.com/q/28352641
has comment: http://stackoverflow.com/comment/45050120
has comment: http://stackoverflow.com/comment/45049497
score: 5
type: AcceptedAnswer

http://stackoverflow.com/comment/45009040
comment on: http://stackoverflow.com/a/28330341
score: 0
type: Comment
has text: I'm having a hard time with this - can you take a look at my original question and see where I've gone wrong?
type: AnswerComment

http://stackoverflow.com/comment/44954027
score: 0
has text: @wyatt can you try to run it with firefox or some other browser?
type: QuestionComment
comment on: http://stackoverflow.com/q/28301063
type: Comment

http://stackoverflow.com/q/28347331
has title: javascript redirection only on second try
has body: I wrote a little "webpage" to start streams on my xbmc with jsonrpc. Now the problem I am facing is that i always have to send the form request twice to make it work. could it be that I am using the window.open function wrong? or am I missing something?
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45038864
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28347539
answer count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/45039959
has answer: http://stackoverflow.com/a/28347464
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/q/28377495
type: Question
has answer: http://stackoverflow.com/a/28377564
has answer: http://stackoverflow.com/a/76739485
has comment: http://stackoverflow.com/comment/45095198
downvote count: 0
has answer: http://stackoverflow.com/a/47305545
tagged with: javascript
tagged with: sorting
favorite count: 0
has title: Sort an array in the same order of another array
linked to: http://stackoverflow.com/q/28395477
answer count: 5
tagged with: compare
accepted answer: http://stackoverflow.com/a/28377564
score: 17
has body: I have a few arrays of 50+ names like this. ["dan", "ryan", "bob", "steven", "corbin"] ["bob", "dan", "steven", "corbin"] I have another array that has the correct order. Note that the second array above does not include all of the names, but I still want it to follow the order of the following: ["ryan", "corbin", "dan", "steven", "bob"] There is no logical order to it, they are just in this order. What makes sense to me is to compare each array against the correctly ordered one. I think I saw some people doing this with PHP, but I was not able to find a JavaScript solution. Does anyone have any idea how to do this? I've been trying for a few hours and I'm stumped.
has answer: http://stackoverflow.com/a/41289873
possible better answer: http://stackoverflow.com/a/28377653
upvote count: 17
has answer: http://stackoverflow.com/a/28377653
type: AnsweredQuestion

http://stackoverflow.com/comment/45115348
comment on: http://stackoverflow.com/a/28388526
type: AnswerComment
has text: @Marty Demichele you definitely don't need to play with your db at this point in time :).
score: 0
type: Comment

http://stackoverflow.com/comment/45117379
has text: I guess my question is what is the purpose of `transporter.sendMail` from option then?
comment on: http://stackoverflow.com/q/28389953
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45111024
score: 0
type: Comment
type: AnswerComment
has text: Yes, the link in my edit relates to detecting the end of a css animation in javascript. There are a few other sources on Google. I'd try them out and if you get stuck on a specific point raise a question on it. You're unlikely to get someone to post the full source for a solution here.
comment on: http://stackoverflow.com/a/28386439

http://stackoverflow.com/q/28338913
score: 2
type: AnsweredQuestion
downvote count: 0
possible better answer: http://stackoverflow.com/a/28339482
type: Question
upvote count: 2
tagged with: reactjs
tagged with: javascript
has body: In a reactjs component, I will compute a value based on the passed-in parameter, which will never changed again. Say: React.createClass({ componentWillMount: function() { this.computedValue = complexComputing(this.props.feed); }, render: function() { return &lt;div&gt;{this.computedValue}&lt;/div&gt; } }); You can see I've put the computedValue into this directly, but I'm not sure if it's the best place.
answer count: 2
has answer: http://stackoverflow.com/a/28339482
has title: Where is the best place to put a value which is computed once by the initial passed-in parameter and never changed again, in ReactJS?
favorite count: 0
has answer: http://stackoverflow.com/a/28346344
accepted answer: http://stackoverflow.com/a/28346344

http://stackoverflow.com/q/28291437
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44936263
tagged with: css
has answer: http://stackoverflow.com/a/28304812
has answer: http://stackoverflow.com/a/28291642
has body: I have an image and a div i would like to align them both vertically on the browser like in the image attached. with both in the middle of the browser and the div in the middle of the image whats the best was to do this with css or javascript
type: Question
has title: Css vertically align to browsers height
has comment: http://stackoverflow.com/comment/44936285
tagged with: javascript
score: 0
answer count: 2

http://stackoverflow.com/q/28331987
upvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: datepicker
has body: I am working on a booking system for a hotel. I want the booking system to be like the one on acehotel.com. Mine works, but when I click on "Uitcheck dag" (day of checking out) it does not show the day of checking in. Here is a link to my page: http://webdesign.kam-online.net/DatePicker/ $(document).ready(function() { var dates = []; var dateArray = []; currentDate = new Date(); var tips = ['some description','some other description']; $("#aantallen").hide(); $("#datepicker").hide(); $("#datepicker2").hide(); $("#AantalMensen").click(function(){ $("#datepicker2").hide(); $("#datepicker").hide(); $("#aantallen").show(); }); $("#IncheckDag").click(function(){ $("#datepicker2").hide(); $("#aantallen").hide(); $("#datepicker").show(); }); $("#UitcheckDag").click(function(){ $("#datepicker").hide(); $("#aantallen").hide(); $("#datepicker2").show(); }); Date.prototype.addDays = function(days) { var dat = new Date(this.valueOf()) dat.setDate(dat.getDate() + days); return dat; } function getDates(startDate, stopDate) { var currentDate = startDate; while (currentDate &lt;= stopDate) { dateArray.push( new Date (currentDate) ); currentDate = currentDate.addDays(1); } return dateArray; } $('#datepicker').datepicker({ dateFormat: 'mm/dd/yy', beforeShowDay: highlightDays, showOtherMonths: true, onSelect: function () { var pickedDate = $("#datepicker").datepicker("getDate"); if (pickedDate &gt; currentDate) { dates.push(pickedDate); dateArray.push(pickedDate); alert(dates[0]); } else { alert("Error"); } } }); $("#datepicker2").datepicker({ dateFormat: 'mm/dd/yy', beforeShowDay: highlightDays, showOtherMonths: true, onSelect: function () { var pickedSecondDate = $("#datepicker2").datepicker("getDate"); if (pickedSecondDate &gt; dates[0]) { dates.push(pickedSecondDate); alert(dates[1]); var start = dates[0]; var end = dates[1]; getDates(start, end); } else { alert("Error"); } } }); function highlightDays(date) { for (var i = 0; i &lt; dateArray.length; i++) { if (new Date(dateArray[…
has answer: http://stackoverflow.com/a/28332593
has title: jQuery DatePicker does not render beforeShowDay after initialization
type: UnansweredQuestion
downvote count: 1
type: Question
tagged with: javascript
score: -1

http://stackoverflow.com/comment/137444333
type: Comment
comment on: http://stackoverflow.com/a/28292448
score: 0
type: AnswerComment
has text: Question. If I overrite my console.<log level> in this way, would I be able to capture also node modules, libraries logs? Sometime errors happens on the side of the library. It would be important to store them as well

http://stackoverflow.com/comment/46392297
score: 0
type: Comment
type: QuestionComment
has text: do you mean? you want to open external website content but still want to keep your layout intact while viewing that page?
comment on: http://stackoverflow.com/q/28433766

checkbox
tag name: checkbox
tags question: http://stackoverflow.com/q/28340833
tags question: http://stackoverflow.com/q/28288183
tags question: http://stackoverflow.com/q/28305285
tags question: http://stackoverflow.com/q/28349163
tags question: http://stackoverflow.com/q/28402931
tags question: http://stackoverflow.com/q/28294226
tags question: http://stackoverflow.com/q/28415465
tags question: http://stackoverflow.com/q/28405006
tags question: http://stackoverflow.com/q/28373338
tags question: http://stackoverflow.com/q/28334664
tags question: http://stackoverflow.com/q/28317951
tags question: http://stackoverflow.com/q/28335649
tags question: http://stackoverflow.com/q/28394934
tags question: http://stackoverflow.com/q/28385014
tags question: http://stackoverflow.com/q/28400685
tags question: http://stackoverflow.com/q/28375815
tags question: http://stackoverflow.com/q/28301337
tags question: http://stackoverflow.com/q/28334825
type: Tag
tags question: http://stackoverflow.com/q/28397168
tags question: http://stackoverflow.com/q/28424390
tags question: http://stackoverflow.com/q/28372466
tags question: http://stackoverflow.com/q/28285776
tags question: http://stackoverflow.com/q/28414109
tags question: http://stackoverflow.com/q/28301848

http://stackoverflow.com/comment/44949727
type: QuestionComment
has text: what code have you tried so far, and does saving to MySQL with a javascript command work ???
type: Comment
comment on: http://stackoverflow.com/q/28298963
score: 0

http://stackoverflow.com/a/28303958
upvote count: 2
answers question: http://stackoverflow.com/q/28303882
has comment: http://stackoverflow.com/comment/44992011
accepted answer of: http://stackoverflow.com/q/28303882
type: AcceptedAnswer
downvote count: 0
has body: ngModel has to be a property expression (following the fules of $parse). Try using a proxy then watch that variable to then assign to A or B: &lt;input type="text" ng-model="variableC"&gt; In your controller: $scope.$watch('variableC', function(value) { if(someCondition) { $scope.variableA = value; } else { $scope.variableB = value; } });
type: Answer
score: 2

http://stackoverflow.com/comment/45081660
type: QuestionComment
comment on: http://stackoverflow.com/q/28370313
type: Comment
has text: There seem to be components missing from your explanation... things you have in your code. Such as a controller in angular and the button to see how it's assigned to run the function.
score: 0

http://stackoverflow.com/comment/45123719
comment on: http://stackoverflow.com/a/28392628
has text: Should give it a try. However, if the title is true, it shows: "Your points is 0".
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/28429460
has comment: http://stackoverflow.com/comment/45190137
accepted answer of: http://stackoverflow.com/q/28429412
has body: To do this you need to set the trigger property to focus: $(status).popover({ trigger: 'focus', placement: 'top', html: true, title: " Details: ", content: $(statuses).html() }); This means that the popover is only active while the status element has focus in the browser, clicking anywhere else within the window will dismiss the popover.
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28429412
score: 1
type: Answer
has comment: http://stackoverflow.com/comment/45190083
upvote count: 1

http://stackoverflow.com/comment/45096032
score: 0
type: AnswerComment
has text: If you're just using arrow keys to navigate through slides on a page, you only need a "keyup" listener. Keep track of the slide x and y position by updating it on keyup events, and use those values to determine which anchor to go to when your keyup handler function is called.
type: Comment
comment on: http://stackoverflow.com/a/28378011

http://stackoverflow.com/comment/45175048
has text: Marcelo, I added your code and it works! I ran a few tests and it really seems impossible now to send a message containing <a href=. So thank you very much.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28416333

http://stackoverflow.com/q/28285573
has body: I am trying to replicate this effect: http://www.hys-inc.jp/ The only difference is that I want the particles to be positioned in such a way, that they resemble the Earth - a 'textured face' if you will. Browsing through their code, this is what they use to set up the particles group: var map = THREE.ImageUtils.loadTexture('/admin/wp-content/themes/hys/assets/img/particle.png'); var m = new THREE.ParticleSystemMaterial({ color: 0x000000, size: 1.5, map: map, //blending: THREE.AdditiveBlending, depthTest: false, transparent: true }); var p = new THREE.ParticleSystem(g, m); scene.add(p); This is all great, but how do I position them along a sphere to resemble the planet? I know how to do it in 2d rendering context, using a picture and pixels scanning to get the right coordinates for the particles' position, but I am clueless how to do it in 3d... Any help is more then welcome
tagged with: three.js
has title: Making a 3d Earth, made up of particles with Three.js
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/12732590
type: Question
has comment: http://stackoverflow.com/comment/44925619
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28288198
answer count: 1

http://stackoverflow.com/a/28374505
type: Answer
has comment: http://stackoverflow.com/comment/45090929
answers question: http://stackoverflow.com/q/28374365
has comment: http://stackoverflow.com/comment/45090550
upvote count: 2
has comment: http://stackoverflow.com/comment/45089450
accepted answer of: http://stackoverflow.com/q/28374365
has comment: http://stackoverflow.com/comment/45089694
has comment: http://stackoverflow.com/comment/45091507
has comment: http://stackoverflow.com/comment/45090030
score: 2
type: AcceptedAnswer
downvote count: 0
has body: Apply is only used twice, Math.Min.apply Math.Max.apply If apply is a 'property of undefined', it means Math.Min and/or Math.Max is undefined. It looks like you just have a capitalization problem, try Math.min and Math.max (of course there may be other problems as well, but that should be the source of the TypeError).
has comment: http://stackoverflow.com/comment/45091274

http://stackoverflow.com/a/28392352
has body: You could write this line using if else like this : if(idx != undefined) {this.current = idx } else if (this.options.start &gt;= 0 &amp;&amp; this.options.start &lt; this.items.length) {this.current = this.options.start } else {this.current = 0}
downvote count: 0
answers question: http://stackoverflow.com/q/28392282
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/comment/44989186
score: 0
has text: i didn't get your problem ?Secondly you haven't included jquery library in your fiddle
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28320029

http://stackoverflow.com/comment/112263126
score: 0
type: Comment
has text: Thank you so much for that anwser @FlusterDesign! None of the ``z`` or ``zoom`` params seem to work but the ``4f13.1`` thingy does the job.
comment on: http://stackoverflow.com/a/45267239
type: AnswerComment

http://stackoverflow.com/q/28427228
tagged with: filter
upvote count: 1
answer count: 1
favorite count: 0
tagged with: angularjs
tagged with: binding
has body: I'm new to Angular so this might be real easy. I have a JSON array of some offers. Each offer has a price among other things. I want to be able to add a filter so that the user can specify their min/max spent and only sees offers that fall into these brackets. In the list controller I have // MinMax filter: $scope.minMax = function(prop, mn, mx){ return function(item){ if ( (Number(item[prop]) &gt;= mn) &amp;&amp; (Number(item[prop])&lt;= mx) ) return true; } } In the View HTML I have two simple text input fields: &lt;input id='cheapest' name="cheapest" type='text' value='10' /&gt; &lt;input id='dearest' name="dearest" type='text' value='5000' /&gt; and the repeater &lt;div ng-repeat="offer in offers | filter: minMax('Price' , [?cheapest?], [?dearest?]) "&gt; The filter works when I hardcode values in, but how do I bind them to the input field? Thanks
type: AnsweredQuestion
has title: Is it possible to pass HTML input field variables to a custom Angularjs filter?
downvote count: 0
score: 1
type: Question
has answer: http://stackoverflow.com/a/28427380
accepted answer: http://stackoverflow.com/a/28427380
tagged with: javascript

http://stackoverflow.com/comment/45038140
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28342650
has text: Ok when I use the each event handler to initialize the magnific popup first it says "Content Not found" for the first click, and it opens the correct popup at the second click. This is how I've did this: http://pastebin.com/kVUk1md7 . What I've tried before this comment was this: http://pastebin.com/RHpy8dHa

http://stackoverflow.com/comment/45008955
comment on: http://stackoverflow.com/q/28328563
score: 0
has text: I think your best shot will be to place a simple "Hello world!" static html page and see if you can get it displayed in your IFRAME and move onward from there. You'll need some experience in web technologies to troubleshoot this like inspecting requests and responses being sent and received.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28283304
has body: I am trying to add around 5000 elements to a JavaScript array. But seems the browsers are not happy with this. In chrome, I get this error message in Firefox's console: SyntaxError: missing ] after element list And this seems to indicate that ] is required after the 1000th element in the array... Sample codes: var uid=["a1","a2","a3"..."a5000"]; any idea how to get around this?
type: Question
has comment: http://stackoverflow.com/comment/44920801
score: -2
tagged with: max
tagged with: arrays
has title: javascript maximum number of elements in an array....browser not allowing more than 1000 elements
tagged with: javascript
downvote count: 2
has comment: http://stackoverflow.com/comment/44920841
answer count: 1
has comment: http://stackoverflow.com/comment/44920795
favorite count: 0
has answer: http://stackoverflow.com/a/28283849
accepted answer: http://stackoverflow.com/a/28283849
has comment: http://stackoverflow.com/comment/44920777
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/44920772
has comment: http://stackoverflow.com/comment/44922364

http://stackoverflow.com/comment/44926046
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28285862
score: 0
has text: @elmage you already have the ` ` element, the only thing you need to do is to change `div` to ` ` as i commented above.

http://stackoverflow.com/comment/45182487
has text: Ok, thanks. I put them inside the body but the problem did not solved yet.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28424891

http://stackoverflow.com/q/28402329
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28402372
score: 0
answer count: 1
tagged with: angularjs
has title: Angularjs Service Promice Error
accepted answer: http://stackoverflow.com/a/28402372
type: AnsweredQuestion
has body: I am trying to build simple service in angularjs. The response of service is getting undefined in controller. Below is my code: Service: yourMarketApp.factory('User',function($http){ return { getUserCount: function(){ var count; $http.get('/Ecomm-Java-Backend/test').success(function(result) { console.log("Count is "+result); console.log(result); count =result; return count; }) } } }); Controller: yourMarketApp.controller('homeCtrl',function($scope,User){ $scope.count =0; var temp =User.getUserCount(); User.getUserCount().then(function(data){ $scope.count=data; console.log("Count is From ctrl "+$scope.count); }); }); Here console.log in service is giving desired result. But,in controller the error reads: "TypeError: Cannot read property 'then' of undefined". One observation is code is not breaking at var temp line, so service is injected nicely.

http://stackoverflow.com/comment/45097189
type: Comment
has text: Well, as long as your Rails controller responds to both html and json, your Angular app needs to tell Rails that it wants `json`. You could modify `Accept` header with `$httpProvider` or tell Rails to always serve json for requests with `X-Requested-With: XMLHttpRequest`, but I believe it is simple and best to just put `.json`.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28378546

http://stackoverflow.com/q/28304014
tagged with: bounds
tagged with: google-maps
has body: I would like to limit the search results for my google map to within a specific latLngBounds range. places search api - lists this this addListener function to change the bounds: google.maps.event.addListener(map, 'bounds_changed', function() { var bounds = map.getBounds(); searchBox.setBounds(bounds); }); I replaced this with: var defaultBounds = new google.maps.LatLngBounds( new google.maps.LatLng(-33.8902, 151.1759), new google.maps.LatLng(-33.8474, 151.2631)); searchBox.setBounds(defaultBounds); However it doesn't seem to work. Can anyone point me in the right direction to limit the search results to the default bounds regardless of current map viewpoint? Here is the current code I have based on the API: function initialize() { var markers = []; var map = new google.maps.Map(document.getElementById('map-canvas'), { mapTypeId: google.maps.MapTypeId.ROADMAP }); var defaultBounds = new google.maps.LatLngBounds( new google.maps.LatLng(30.9128292, -98.8563538), new google.maps.LatLng(30.0964251, -97.9431152)); map.fitBounds(defaultBounds); // Create the search box and link it to the UI element. var input = /** @type {HTMLInputElement} */( document.getElementById('pac-input')); map.controls[google.maps.ControlPosition.TOP_LEFT].push(input); var searchBox = new google.maps.places.SearchBox( /** @type {HTMLInputElement} */(input)); // [START region_getplaces] // Listen for the event fired when the user selects an item from the // pick list. Retrieve the matching places for that item. google.maps.event.addListener(searchBox, 'places_changed', function() { var places = searchBox.getPlaces(); if (places.length == 0) { return; } for (var i = 0, marker; marker = markers[i]; i++) { marker.setMap(null); } // For each place, get the icon, place name, and location. markers = []; var bounds = new google.maps.LatLngBounds(); for (var i = 0, place; place = places[i]; i++) { var image = { url: place.icon, size: new google.maps.Size(71, 71), origin: new google.maps.Point(0, 0), ancho…
answer count: 1
downvote count: 0
favorite count: 0
has title: limit the bounds for google maps api search to only one area
has answer: http://stackoverflow.com/a/28304208
type: AnsweredQuestion
upvote count: 3
type: Question
score: 3
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28304208

http://stackoverflow.com/comment/45018150
comment on: http://stackoverflow.com/q/28335856
score: 0
type: Comment
type: QuestionComment
has text: The `.focus()` sets the blinking caret inside the contenteditable cell. Without it you need to actually click three times to get the focus.

http://stackoverflow.com/q/28363220
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45068229
has comment: http://stackoverflow.com/comment/45068234
score: 0
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/28363343
has title: Get element class from another html file
has body: Is there a way to get a class name of element from another html file? Or can you do it like this? $(page.html).ready(function(){} The script is rendered in another page.
has comment: http://stackoverflow.com/comment/45068207
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28363343
linked to: http://stackoverflow.com/q/3396542

http://stackoverflow.com/comment/44966686
type: QuestionComment
comment on: http://stackoverflow.com/q/28297702
score: 0
has text: Try checking the value of `{content: content, test: test}.to_json` before sending to node app.
type: Comment

http://stackoverflow.com/comment/45014102
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28333491
has text: Why dont you change the iframe source style ?

http://stackoverflow.com/a/28306675
has body: I find a way to achieve what I want using resize parameter and reseting width after every resize event: $(".resize").resizable({ handles: 's', resize: function() { $(this).css('width', ''); } }); See http://jsfiddle.net/6p20qjmr/4/
has comment: http://stackoverflow.com/comment/88749555
accepted answer of: http://stackoverflow.com/q/28305869
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
answers question: http://stackoverflow.com/q/28305869
upvote count: 2

http://stackoverflow.com/a/28353808
type: Answer
has body: Thanks Guys appreciate it. I have added a cookie like below and works perfectly when close this message button is clicked. but its still shows when the esc key or the x button at the top is clicked. How to reference these two also &lt;script type="text/javascript"&gt; jQuery(document).ready(function(){ if( document.cookie.indexOf( "showOnce" ) &lt; 0 ) { jQuery('#dialog').dialog({ modal: true, width: 740, resizable: true, buttons: { "Close This Message": function() { jQuery( this ).dialog( "close" ); document.cookie = "showOnce=true;"; } } }); } });
score: 0
answers question: http://stackoverflow.com/q/28351934

http://stackoverflow.com/q/28425253
has body: I want to make the div container can automatically resize its div-size (height) along side with the content, instead of going out of the area when the text is more than container area. Can anyone help me out to fix this instead of editing up the css for div-container? When I tried to change the div-size even it fits up the content, but while it is more than the div-area, I have to edit it manually again through CSS code. Is it possibly to make it automatically? or maybe using JavaScript function?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28425361
has answer: http://stackoverflow.com/a/28425294
tagged with: http://stackoverflow.com/tag/html
tagged with: css
downvote count: 2
has comment: http://stackoverflow.com/comment/45182816
has title: How to automatically set the div container adaptively towards the content length?
type: Question
score: -2
tagged with: javascript
answer count: 2
has comment: http://stackoverflow.com/comment/45182806
upvote count: 0
tagged with: jquery
favorite count: 0

http://stackoverflow.com/a/28281261
accepted answer of: http://stackoverflow.com/q/28280779
has comment: http://stackoverflow.com/comment/44916740
answers question: http://stackoverflow.com/q/28280779
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/44920834
type: Answer
downvote count: 0
score: 1
has body: What you're looking for is setProps. This passes updated data to a component and triggers a re-render. Try: $('input').on 'keyup', -&gt; setNote() rootComponent.setProps(data) React must not by passing data by reference, meaning when your data variable is updated the component keeps the original implementation passed to it. Edit: To answer the question of what would you use forceUpdate for, consider the following altered example: data = note: "" setNote = -&gt; data.note = $('input').val() display = React.createFactory React.createClass render: -&gt; React.DOM.div null, "The note is:", data.note setNote() rootComponent = React.render (display()), document.querySelector('main') $('input').on 'keyup', -&gt; setNote() rootComponent.forceUpdate() Notice now that the data is not passed to the component, but rather referenced globally. forceUpdate should be used when your render method includes data from outside the scope of react, and the decision for when the component needs to be re-rendered is deferred to an outside source.

http://stackoverflow.com/comment/45043576
comment on: http://stackoverflow.com/q/28349522
score: 1
has text: why dont you just create a and set url in through jquery check http://jsfiddle.net/singhakash07/7pm2ruvq/
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44932405
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28289310
has text: Why down vote without leaving a comment. This answer looks good to me. It is great practice to assign this to a variable. Helps with scoping. Please if you vote down a great answer like this, leave a comment. That way everyone can learn.
score: 1

http://stackoverflow.com/q/28388650
has answer: http://stackoverflow.com/a/28388812
has comment: http://stackoverflow.com/comment/45114879
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: variables
has comment: http://stackoverflow.com/comment/45114847
favorite count: 0
has title: Javascript Newbie...How do you store an object property as a variable and its value as another?
has comment: http://stackoverflow.com/comment/45114926
has comment: http://stackoverflow.com/comment/45115030
type: UnansweredQuestion
tagged with: properties
downvote count: 1
has body: I have the later mentioned object array and I would love to store the actual property "string" as a variable and the value in a seperate variable using javascript. Is that possible and if so how? states = { "Alaska": 663267, "Texas": 268581, "California": 163696, "Montana": 147042, "New Mexico": 121589, "Arizona": 113998, "Nevada": 110561 };
tagged with: object
has comment: http://stackoverflow.com/comment/45114942
score: -1
has comment: http://stackoverflow.com/comment/45114932
type: Question

http://stackoverflow.com/a/28319449
answers question: http://stackoverflow.com/q/28317620
has comment: http://stackoverflow.com/comment/44989414
has comment: http://stackoverflow.com/comment/44987635
score: 0
has comment: http://stackoverflow.com/comment/44994565
type: Answer
has body: I assume that you are loading data into Kendo grid using Ajax. Error event handling needs to be defined in the grid. @DontVoteMeDown's answer works well with JavaScript. It's probably right answer to your question. Razor implementation is more straight-forward and can be implemented as seen below. @(Html.Kendo().Grid&lt;KendoGridAjaxEditing.Models.ProductViewModel&gt;() .Name("grid") .Columns(columns =&gt; { columns.Bound(product =&gt; product.ProductID).Width(100); columns.Bound(product =&gt; product.ProductName); columns.Bound(product =&gt; product.UnitsInStock).Width(250); columns.Command(commands =&gt; { commands.Edit(); commands.Destroy(); }).Title("Commands").Width(200); }) .ToolBar(toolbar =&gt; toolbar.Create()) .Editable(editable =&gt; editable.Mode(GridEditMode.InLine)) .DataSource(dataSource =&gt; dataSource.Ajax() .Events(events =&gt; events.Error("grid_error")) // Handle the "error" event .Model(model =&gt; { model.Id(product =&gt; product.ProductID); model.Field(product =&gt; product.ProductID).Editable(false); }) .Create(create =&gt; create.Action("Products_Create", "Home")) .Read(read =&gt; read.Action("Products_Read", "Home")) .Update(update =&gt; update.Action("Products_Update", "Home")) .Destroy(destroy =&gt; destroy.Action("Products_Destroy", "Home")) ) .Pageable() ) &lt;script&gt; function grid_error(e) { if (e.errors) { var message = "There are some errors:\n"; // Create a message containing all errors. $.each(e.errors, function (key, value) { if ('errors' in value) { $.each(value.errors, function () { message += this + "\n"; }); } }); // Display the message alert(message); // Cancel the changes var grid = $("#grid").data("kendoGrid"); grid.cancelChanges(); } } &lt;/script&gt; http://docs.telerik.com/kendo-ui/aspnet-mvc/helpers/grid/ajax-editing

http://stackoverflow.com/comment/45046596
type: Comment
type: QuestionComment
has text: Just put in some code. Sorry, new to stackoverflow. :P
comment on: http://stackoverflow.com/q/28350913
score: 0

http://stackoverflow.com/q/28358290
has answer: http://stackoverflow.com/a/28358408
score: 1
downvote count: 2
has answer: http://stackoverflow.com/a/28358397
type: Question
has answer: http://stackoverflow.com/a/28358356
tagged with: javascript
has comment: http://stackoverflow.com/comment/45059854
has comment: http://stackoverflow.com/comment/45060103
has comment: http://stackoverflow.com/comment/45060139
has title: javascript variable scope for uninitialized local variables
upvote count: 3
has body: I am having a problem with understanding the difference between for (i = 0; i &lt; 4; i++) { var g; if (g === undefined) { g = 0; } else { g = g + i; alert(g); } } and this for (i = 0; i &lt; 4; i++) { var g=0; if (g === undefined) { g = 0; } else { g = g + i; alert(g); } } for the first loop output is 0 ,1 ,3 ,6 which indicates that value of g is not reset throughout the iteration , however if g is initialized with zero output becomes 0, 1, 2, 3 .That tells me that each time var g=0 is hit g is set to zero. Does that mean that if local variables are not initialized they behave like globals?
answer count: 3
favorite count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/17311693
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28296813
has title: Get and alert ID of select record from Kendo Grid
type: UnansweredQuestion
upvote count: 1
score: 1
has body: I have kendo grid running in MVC application and alert function in javaScript. I cannot make alert to work; i.e. ID of selected record. I am not sure what I am doing wrong here in code! JavaScript function DeleteFunctionNavigation(e) { e.preventDefaults(); var entityGrid = $("#AllFunctionsGrid_02").data("kendoGrid"); var selectedItem = entityGrid.dataItem(entityGrid.select()); alert(selectedItem.Function_IDs); } function dataBound() { } Kendo Grid &lt;div class="_grid_block"&gt; @(Html.Kendo().Grid&lt;App.DAL.Model.GetAllFunction_SP_Map&gt;() .Name("AllFunctionsGrid_02") .Columns(column =&gt; { column.Bound(c =&gt; c.Function_IDs); column.Bound(c =&gt; c.FunctionName); column.Bound(c =&gt; c.Hierarchy_Level); column.Bound(c =&gt; c.ControllerName); column.Bound(c =&gt; c.ActionName); column.Command(command =&gt; command.Custom("View").Click("DeleteFunctionNavigation")); }) .HtmlAttributes(new { style = "height: 380px;" }) .Editable(editable =&gt; editable.Mode(GridEditMode.PopUp)) .Scrollable() .Filterable() .Groupable() .Sortable() .Selectable(selectable =&gt; selectable .Mode(GridSelectionMode.Single)) .Pageable(pageable =&gt; pageable .Refresh(true) .PageSizes(true) .ButtonCount(5)) .DataSource(dataSource =&gt; dataSource .Ajax() .Read(read =&gt; read.Action("GetAllFunctions", "SystemCore")) .Model(model =&gt; model.Id(c =&gt; c.Function_IDs)) ) .Events(events =&gt; events.DataBound("dataBound")) ) &lt;/div&gt; &lt;!--end _grid_block--&gt;
type: Question
tagged with: kendo-grid
tagged with: asp.net-mvc
downvote count: 0
tagged with: javascript
tagged with: kendo-ui
has answer: http://stackoverflow.com/a/28297350
answer count: 1
favorite count: 0

http://stackoverflow.com/comment/45086565
score: 0
type: QuestionComment
type: Comment
has text: What about `var fd = new FormData(); fd.append("largeImage", jQuery('#largeImage')[0].files[0]);` ?
comment on: http://stackoverflow.com/q/28371835

http://stackoverflow.com/comment/45103293
comment on: http://stackoverflow.com/q/28369572
has text: @bluestrattos Yep, you are right, ng-style could be used here as well, and I think it would be a more appropriate solution, because it makes the code clearer as it point outs when a controller's $scope value is used in the view. I'm quite new with AngularJS so I'm learning too :-)
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28333450
type: Answer
answers question: http://stackoverflow.com/q/28332661
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/75152990
downvote count: 0
has body: If there are multiple things to download, browsers will normally download several of them in parallel. The exact number of parallel downloads can vary by browser. Note: The CSS should be before the JS to get maximum benefit from parallel downloads.

jquery-events
tag name: jquery-events
tags question: http://stackoverflow.com/q/28402475
tags question: http://stackoverflow.com/q/28343140
tags question: http://stackoverflow.com/q/28393356
tags question: http://stackoverflow.com/q/28334025
tags question: http://stackoverflow.com/q/28430768
tags question: http://stackoverflow.com/q/28386384
tags question: http://stackoverflow.com/q/28400872
tags question: http://stackoverflow.com/q/28394441
tags question: http://stackoverflow.com/q/28331102
tags question: http://stackoverflow.com/q/28303647
tags question: http://stackoverflow.com/q/28320693
tags question: http://stackoverflow.com/q/28423324
tags question: http://stackoverflow.com/q/28364043
type: Tag
tags question: http://stackoverflow.com/q/28367172

templates
tags question: http://stackoverflow.com/q/28300809
tags question: http://stackoverflow.com/q/28336153
tags question: http://stackoverflow.com/q/28368032
tag name: templates
type: Tag
tags question: http://stackoverflow.com/q/28429292
tags question: http://stackoverflow.com/q/28394226
tags question: http://stackoverflow.com/q/28369798
tags question: http://stackoverflow.com/q/28436275

http://stackoverflow.com/a/71697274
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/28324303
has comment: http://stackoverflow.com/comment/131477649
upvote count: 2
has body: To elaborate on this answer, here's a runnable example of using mouseConstraint.body in your event handler to determine which body is being clicked: const engine = Matter.Engine.create(); const runner = Matter.Runner.create(); const render = Matter.Render.create({ element: document.body, engine: engine, }); const bodies = [ Matter.Bodies.rectangle( 400, 310, 810, 60, {isStatic: true, angle: 0.0} ), ...[...Array(100)].map(() =&gt; Matter.Bodies.rectangle( Math.random() * 400, // x Math.random() * 100, // y Math.random() * 50 + 10, // w Math.random() * 50 + 10, // h {angle: Math.random() * (Math.PI * 2)}, ) ), ]; const mouseConstraint = Matter.MouseConstraint.create( engine, {element: document.body} ); Matter.Events.on(runner, "tick", event =&gt; { if (mouseConstraint.body) { Matter.Composite.remove(engine.world, mouseConstraint.body); } }); // also possible, testing the condition on mousedown only: //Matter.Events.on(mouseConstraint, "mousedown", () =&gt; { // if (mouseConstraint.body) { // Matter.Composite.remove(engine.world, mouseConstraint.body); // } //}); Matter.Composite.add(engine.world, [...bodies, mouseConstraint]); Matter.Runner.run(runner, engine); Matter.Render.run(render); &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/matter-js/0.20.0/matter.js"&gt;&lt;/script&gt; You can also use Matter.Query.point and pass in the mouse X and Y position on click to obtain an array of bodies at that point.
type: Answer

http://stackoverflow.com/comment/44933536
has text: That doesn't quite work. I am compiling an html snippet in the unit test as follows: `var element = angular.element(' '); element = compile(element)(scope); scope.$digest();` In this context, I don't think that document includes the compiled html. I tried logging the document and didn't see the html rendered by the directive.
comment on: http://stackoverflow.com/a/28288398
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28359243
type: Question
tagged with: mongodb
downvote count: 0
tagged with: mongoose
tagged with: javascript
score: 1
has comment: http://stackoverflow.com/comment/45061707
has body: When I execute a findOne query to a collection that is different than that of the surrounding stream, it doesn't really execute the callback (does 1 or 2). Here is my code: schema.js: 'use strict'; var mongoose = require('mongoose'), Schema = mongoose.Schema; var AutocompleteSchema = new Schema({ nGram: String, locations: [{ type: Schema.Types.ObjectId, ref: 'Location' }] }); module.exports = mongoose.model('Autocomplete', AutocompleteSchema); ingest.js: var Autocomplete = require('./schema'); var nGramAPI = require('ngram'); var cache = []; function storeNGram(input, location) { if(cache.indexOf(input) === -1) { cache.push(input); Autocomplete .findOne({ nGram: input }) .populate('locations') .exec(function (err, nGram) { console.log(nGram); if(!nGram) { var newAutocomplete = { nGram: input, locations: [location._id] }; Autocomplete.create(newAutocomplete, function(err, created) { cache.splice(cache.indexOf(input), 1); }); } else { nGram.locations.push(location._id); sortLocations(nGram); location.save(function(err, saved){ cache.splice(cache.indexOf(input), 1); }); } }); } else { setTimeout(function() { storeNGram(input, location); }, 100); } } exports.ingest = function() { console.log("Building nGrams"); var stream = Location.find().stream(); stream.on('data', function (location) { var length = location.dispName.length &gt; 20 ? 20 : location.dispName.length; for(var i = 1; i &lt;= length; i++) { _.each(nGramAPI(i)(location.dispName), function(nGram) { storeNGram(nGram, location); }); } }); } When I execute the Autocomplete.findOne on its own outside of the stream it queries properly, but when inside it fails. Any suggestions?
tagged with: node.js
favorite count: 0
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45078735
upvote count: 1
has title: Mongoose findOne in stream callback not executed
has comment: http://stackoverflow.com/comment/45092799
has comment: http://stackoverflow.com/comment/45061643

http://stackoverflow.com/a/28342128
answers question: http://stackoverflow.com/q/28341743
type: Answer
has body: Not sure if I understood your question but if you want to output something like that, and you have the ids of the json file if you want you could simply do something like this const props = ['blockID3', 'blockID4'], json = {"blockID1":{"name":"name here","locale":"en_GB"},"blockID2":{"name":"name here","locale":"en_GB"},"blockID3":{"name":"name here","locale":"en_GB"},"blockID4":{"name":"name here","locale":"en_GB"}}, res = {}; for(const prop of props) { if(json[prop]) { res[prop] = prop; } }); At the end res will have the objects that you wanted, hope this helps :)
score: 0

http://stackoverflow.com/comment/44938270
type: QuestionComment
has text: There were so many good responses it was hard to choose. Thanks to all of you!
comment on: http://stackoverflow.com/q/28291765
score: 0
type: Comment

http://stackoverflow.com/q/28373567
has answer: http://stackoverflow.com/a/28373656
has comment: http://stackoverflow.com/comment/45087677
has comment: http://stackoverflow.com/comment/45087649
has comment: http://stackoverflow.com/comment/45087683
has title: Array position difference beetween two elements
type: Question
accepted answer: http://stackoverflow.com/a/28373656
has body: I've got this array: [1,2,3,4,5] I want to determine the position difference between two elements, but in a "rotation" mode. Example: I have 3 and I want to know how far is 2, I do a 3.position - 2.position, and I've got 1. But, if I have 5, and I want to know the position difference beetween 5.position and 1.position, with the precedent difference, I will have 5-1=4, and because there is array rotation, I want 1. Do you have an idea of how I can do that ? (I work in Javascript) EDIT: Here is a draw that can explain clearer what I want to do EDIT 2: Better draw
type: AnsweredQuestion
tagged with: algorithm
possible better answer: http://stackoverflow.com/a/28376819
has answer: http://stackoverflow.com/a/28376819
answer count: 2
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/45087713
score: 0

http://stackoverflow.com/comment/45120226
comment on: http://stackoverflow.com/q/28391458
score: 0
type: Comment
type: QuestionComment
has text: where is the JavaScript?

http://stackoverflow.com/q/28282817
has comment: http://stackoverflow.com/comment/44920533
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/44920338
answer count: 2
upvote count: 0
has answer: http://stackoverflow.com/a/28297486
tagged with: javascript
tagged with: asp.net
favorite count: 0
has body: I have a Telerik RadGrid that contains information on users. I have an add user button on the command item template. It opens a form and the user fills out the fields accordingly. After the user clicks submit, I use javascript to pass the ID through the query string to another page. The problem is, when I submit the data the page loads faster than the data binds to the database. Is there a way to slow the page load down, in order for the data to bind beforehand.
type: UnansweredQuestion
tagged with: telerik
tagged with: radgrid
has answer: http://stackoverflow.com/a/28284015
downvote count: 3
score: -3
has title: Page loads before data binds to the database

http://stackoverflow.com/comment/45141144
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28402931
score: 2
has text: When sending data to a `$.post` don't use a GET URL and `$_GET`. Also, `document.getElementsByClassName()` doesn't work until IE 9. You could use `document.getElementsByName()`. Of course, if you're using jQuery, why even use raw JavaScript?

http://stackoverflow.com/a/29654692
upvote count: 5
type: Answer
has comment: http://stackoverflow.com/comment/74401763
answers question: http://stackoverflow.com/q/28369409
downvote count: 0
has body: This is a reported bug: https://github.com/smashingboxes/OwlCarousel2/issues/460 Anyway you could try this to destroy the owl carousel: $('#your_carousel').trigger('destroy.owl.carousel').removeClass('owl-carousel owl-loaded'); $('#your_carousel').find('.owl-stage-outer').children().unwrap();
score: 5

http://stackoverflow.com/a/28350747
has comment: http://stackoverflow.com/comment/45045233
has body: I expect you have to wrap the placeholder in double quotes: &lt;input class="search_input" name="q" tabindex="1" type="text" value="{{query}}"&gt; Otherwise the substituted html code would be &lt;input class="search_input" name="q" tabindex="1" type="text" value=text with whitespace&gt; The commonplace html renderer would parse this into an input element with attributes value, with and whitespace, the latter two coming without a value while value's value would be text. Note that most html renderers are tolerant against attributes which are undefined and value-less attributes are covered by the standard (as it is to omit the double quotes).
upvote count: 6
has comment: http://stackoverflow.com/comment/45045332
type: AcceptedAnswer
type: Answer
score: 6
accepted answer of: http://stackoverflow.com/q/28350579
downvote count: 0
answers question: http://stackoverflow.com/q/28350579

http://stackoverflow.com/comment/45136398
type: Comment
has text: How about `http://<your-site-or-localhost>/public/audio/1.mp3`?
type: QuestionComment
comment on: http://stackoverflow.com/q/28394340
score: 0

http://stackoverflow.com/q/28305242
has title: Reverse a javascript algorithm
has comment: http://stackoverflow.com/comment/44961942
has comment: http://stackoverflow.com/comment/44961747
tagged with: javascript
has comment: http://stackoverflow.com/comment/44961720
has comment: http://stackoverflow.com/comment/44962845
downvote count: 4
upvote count: 0
has comment: http://stackoverflow.com/comment/44962033
answer count: 1
favorite count: 0
has body: Well guys, I'm learning javascript and I stumbled upon a kind of challenge code. I've already searched in google and I found some reverse codes but I couldn't understand or didn't work. The question is that I don't have any idea on how to reverse and put in a code, I'd like to see some reasonable snippet of code and understand it. function checkString(strz) { var total = 0; var charlist = "abcdefghijklmnopqrstuvwxyz"; for ( var i = 0; i &lt; strz.length; i++) { var countone = strz.charAt (i); var counttwo = (charlist.indexOf(countone)); counttwo++; total *= 17; total += counttwo; } if ( total == 248410397744610 ) { alert ("You're right!"); } else { alert ("Sorry, but the string was incorrect." ) ; } }
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28305548
has comment: http://stackoverflow.com/comment/44961847
has comment: http://stackoverflow.com/comment/44962541
has comment: http://stackoverflow.com/comment/44962745
has comment: http://stackoverflow.com/comment/44961955
has comment: http://stackoverflow.com/comment/44961668
has comment: http://stackoverflow.com/comment/44961743
score: -4
type: Question

http://stackoverflow.com/a/28298498
has body: Do you mean a CSRF attack (Cross Site Request Forgery)? This is where if your site has a form, say it is example.com: &lt;form method="post" action="/postThread.php"&gt; an attacker could include a similar form on their website: &lt;form method="post" action="https://example.com/postThread.php"&gt; and entice the victim to visit their site whilst they are also logged into example.com. They could include some JavaScript to submit their form (either by submitting the HTML form, possibly loaded in an IFrame or by AJAX). The end result is that the thread would be started on your site by the attacker, under the identity of the victim, as the victim's cookies would be submitted with the POST. A quick way to defend against this is to set and check the X-Requested-With header if all your POSTs are done via AJAX. If not, you may want to look into the OWASP recommended Synchronizer Token Pattern.
answers question: http://stackoverflow.com/q/28282886
score: 0
type: Answer

http://stackoverflow.com/q/28368651
upvote count: 1
tagged with: url-routing
has comment: http://stackoverflow.com/comment/45078144
type: AnsweredQuestion
tagged with: angular-ui-router
score: 1
type: Question
has body: I have something like this working &lt;body ng-app="ELT" ng-class="{'mapBody': $state.includes('map')}" ng-controller="mainCtrl"&gt; So obviously what I am trying to do is add a class "mapBody" when the state is map and my controller a such .controller('mainCtrl', ['$scope','$state',function ($scope,$state) { 'use strict'; $scope.$state = $state; }]) Is there a better way to do this ? Don't like the fact I had to had a new controller just for this one thing, plus it's a lot of logic in the html.
tagged with: angularjs-routing
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/28368893
tagged with: javascript
tagged with: angularjs
has title: Angular adding a body class depending on state
favorite count: 0
accepted answer: http://stackoverflow.com/a/28368893

http://stackoverflow.com/comment/45117027
comment on: http://stackoverflow.com/q/28389783
type: Comment
score: 0
has text: Could you provide an example?
type: QuestionComment

http://stackoverflow.com/q/28283245
has comment: http://stackoverflow.com/comment/44921217
score: 5
tagged with: internet-explorer
has comment: http://stackoverflow.com/comment/44922405
upvote count: 6
has body: I'm pulling my hair out over IE9/8; I'm trying to use mOxie, but it's showing up as undefined, even though it's very clearly defined. when, from another file, I log mOxie to the console, it logs it perfectly fine in Chrome/IE10+, but firing the same script in IE9/8 logs undefined. However, in IE9/8, when I type 'mOxie' in the console directly, it correctly logs the object. http://jsfiddle.net/vxyayxy8/ -- Run in IE10 mode, and you'll see that it loads an object. Run in IE9 mode, and you'll see that it logs undefined Why is it that in IE9/8, when logging from a file (that's included after mOxie), it's undefined, but is defined in IE9/8 when using the console directly? Keep in mind that it's defined in Chrome and IE10+. To test the theory of my answer below, in IE11, but in IE9 document mode, do console.log({}) -- I get undefined, which fits the question and the answer. Can you reproduce this?
tagged with: javascript
has title: mOxie is undefined, yet very clearly defined
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/44921780
favorite count: 0
accepted answer: http://stackoverflow.com/a/28284236
tagged with: console.log
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44922490
has answer: http://stackoverflow.com/a/28284236
type: Question

http://stackoverflow.com/comment/51609040
has text: You can put it right after declaring the Schema, in the same file
type: Comment
comment on: http://stackoverflow.com/a/30164636
score: 2
type: AnswerComment

http://stackoverflow.com/q/28327119
favorite count: 0
tagged with: sockets
tagged with: vb.net
linked to: http://stackoverflow.com/q/12931276
type: AnsweredQuestion
upvote count: 3
has answer: http://stackoverflow.com/a/28327441
type: Question
has comment: http://stackoverflow.com/comment/86102857
score: 3
tagged with: javascript
tagged with: http-headers
has body: Note: The closest question I have found to mine is this one, but the answer is to send data via a proxy function that waits for the readyState to be 1. This is not a duplicate of that question though the titles are very similar; I know my issue lies in my server not passing data back to the client, but I don't know what to pass. Details: I have a TCP Listener defined in my server program as a New TcpListener(ipAd, 8001) and I wrote a client program as a New TcpClient() to connect to the server. These programs work as intended, where as soon as the connection is made, the client is ready to send data to the server. After I completed the client and server, I began working on a web interface to act as the client, so I could send data to the socket from any device. Here is the javascript code for the websocket: console.log("Attempting to connect..."); ws = new WebSocket('ws://192.168.0.10:8001/'); ws.onopen = function(msg) { console.log('Connection successfully opened'); }; ws.onmessage = function(msg) { console.log(msg); }; ws.onclose = function(msg) { console.log("Closed."); } ws.error = function(err){ console.log(err); } When I load the webpage, I see in my server console app that the connection is made. Here is the output: GET / HTTP/1.1 Host: 192.168.0.10:8001 Connection: Upgrade Pragma: no-cache Cache-Control: no- cache Upgrade: websocket Origin: null Sec-WebSocket-Version: 13 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.99 Safari/537.36 Accept-Enc oding: gzip, deflate, sdch Accept-Language: en-US,en;q=0.8 Sec-WebSocket-Key: key_here Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits So clearly the HTTP headers are sent and received; however, my server (currently) does not send anything back to the client, so when I try to issue ws.send("test"); from the websocket, I receive an error in console: Uncaught InvalidStateError: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state…
accepted answer: http://stackoverflow.com/a/28327441
downvote count: 0
has title: JS Websocket stuck in state CONNECTING to TCPListener - VB.net
answer count: 1
tagged with: websocket
linked to: http://stackoverflow.com/q/23051416

http://stackoverflow.com/comment/45111569
score: 0
type: Comment
has text: Is the url correct? Try this, type the url in a browser and click enter. Does this returns anything?
type: QuestionComment
comment on: http://stackoverflow.com/q/28386910

post
tags question: http://stackoverflow.com/q/28369121
tag name: post
tags question: http://stackoverflow.com/q/28386910
tags question: http://stackoverflow.com/q/28344102
tags question: http://stackoverflow.com/q/28418136
type: Tag
tags question: http://stackoverflow.com/q/28396518
tags question: http://stackoverflow.com/q/28294779
tags question: http://stackoverflow.com/q/28360780
tags question: http://stackoverflow.com/q/28286260
tags question: http://stackoverflow.com/q/28299159
tags question: http://stackoverflow.com/q/28288896

http://stackoverflow.com/comment/45163633
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28414737
has text: silly question: does this code works for you? `$('.email-refresh, #loadMoreMessages, ul.main-menu li').click(function() { alert('Clicked'); });`
score: 0

http://stackoverflow.com/comment/45215259
has text: You didn’t post the JS code, which is where the problem is.
comment on: http://stackoverflow.com/q/28434841
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28331906
downvote count: 1
favorite count: 0
tagged with: wsh
type: UnansweredQuestion
has body: I want to begin by apologizing for not including any code. VBScript is completely out of my realm of knowledge and I have been asked to use it for a small program here at work. The goal: I have been asked to search part of the active directory (I am told that it is an OU in our active directory) and compare the user that is attempting to login to the computer with the OU. If that person DOES exist in the specified OU, I need to do something. If the person DOES NOT exist, I need to do something else. The specifics: I work at a hospital. The point of this is to keep nurses from using the laptops designated for the physicians on the floors. When a nurse badges in to said computer, if the person logging in exists in the "Physicians" OU (which is my OU), then continue with the login, else log the person out (which would be to key an F4 in Imprivata). This being said, we use a program called Imprivata that logs the user in when they swipe their badge. Imprivata can also perform keystrokes like keying in the user's password, clicking buttons, etc. The Imprivata program allows for code to be written in the background in VBScript, WSH, and I believe JavaScript and then executed when a condition exists (a person logging on a computer). Unfortunately, I know NOTHING about any of these languages. I have been searching the web and trying different things for a week now with no luck. In fact, I have even got close to anything working so any help would be greatly appreciated and again I apologize for the lack of code.
has title: VBScript Locate user in Directory; Return results (Found or Not Found)
tagged with: vbscript
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28340076
score: 0
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/28340671

http://stackoverflow.com/a/28324403
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28324075
has body: The reason for this is that your encoded ampersand %26 is UrlDecoded serverside back to &amp;. If you want to keep the url encoded version you need to escape the percent sign % too with its encoded equivalent %25: v = v.replace(/&amp;/g, "%2526%");
answers question: http://stackoverflow.com/q/28324075
score: 0

http://stackoverflow.com/q/28348082
tagged with: foreach
has comment: http://stackoverflow.com/comment/45040298
score: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45040280
linked to: http://stackoverflow.com/q/9329446
type: Question
tagged with: for-loop
tagged with: javascript
has comment: http://stackoverflow.com/comment/45040273
has answer: http://stackoverflow.com/a/28348214
has title: Assistance with Javascript for each loop
has answer: http://stackoverflow.com/a/28348258
has comment: http://stackoverflow.com/comment/45040851
has body: I am trying to get my program to generate a 4 number pin to be used for a game. I originally wanted to do this: function paswdGen() { var nums = [0, 0, 0, 0]; for each (var x in nums) { x = Math.floor((Math.random() * 9) + 1); } } document.getElementById("nums").innerHTML = nums; How do I use a "for each" loop in javascript without jQuery?
has comment: http://stackoverflow.com/comment/45040436
favorite count: 0
has answer: http://stackoverflow.com/a/28348327
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28348159
tagged with: each
answer count: 4

http://stackoverflow.com/q/28428417
downvote count: 0
has body: I want to change the value of the download attribute with javascript, I'm trying to use the download atribute of a tag. But I dont know how to include javascript inside download? CLICK ME function getDownloadName(){ return "REALFILENAME_" + new Date().getTime();+ ".txt"; } Thanks!
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28428699
type: AnsweredQuestion
has title: Changing the value of the download attribute of an anchor with javascript
score: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28428711
favorite count: 0
tagged with: download
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/28428711
upvote count: 3
has answer: http://stackoverflow.com/a/28428699
tagged with: rename

http://stackoverflow.com/comment/44936791
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28291589
has text: `body_value.trim().text.split(' ').length` you have an extra call to `text` there. You should'v also gotten an error when you tried that.
type: AnswerComment

http://stackoverflow.com/q/28382408
tagged with: javascript
linked to: http://stackoverflow.com/q/6731894
has comment: http://stackoverflow.com/comment/45103858
has comment: http://stackoverflow.com/comment/45103685
answer count: 1
downvote count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/45103613
has comment: http://stackoverflow.com/comment/45103981
favorite count: 0
tagged with: html-lists
has answer: http://stackoverflow.com/a/28382878
accepted answer: http://stackoverflow.com/a/28382878
has comment: http://stackoverflow.com/comment/45103573
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
tagged with: onclick
score: 1
has comment: http://stackoverflow.com/comment/45103788
has comment: http://stackoverflow.com/comment/45103499
upvote count: 1
has comment: http://stackoverflow.com/comment/45104036
has title: Copying html to another div
type: Question
has body: What I am doing is whenever I click a li.opn I get the respective .pst 's html from #hiddenDiv . If the .pst 's html is empty then do a $.post() to get the html from server. But my problem is if I receive a code from server in outputHTML then the document gets 2 scripts One in displayDiv Another in hiddenDiv This causes various bugs like the script function runs twice. UPDATE Here's my My Problem Solution but i have to use the same html,js codes twice!! Any help ??? HTML Stackoverflow Google JS UPDATE2 If this is the output from server then 'asik was clicked' is showing 2 times Click Me

http://stackoverflow.com/comment/45354451
type: QuestionComment
has text: i get no errors nor nothing, but the code doesn't dowhat i would like to (show some text when the mouse is cliacked)
comment on: http://stackoverflow.com/q/28415344
score: 0
type: Comment

http://stackoverflow.com/q/28430953
has comment: http://stackoverflow.com/comment/45195359
score: 0
has comment: http://stackoverflow.com/comment/45192382
type: UnansweredQuestion
has title: Check image dimension before upload
has comment: http://stackoverflow.com/comment/45207976
has body: I am trying to check an images width and height before i upload it to the server. var file = _("fileupload").files[0]; current_format = file.type; current_file = file; extension = file.name.substring(file.name.indexOf('.'), file.name.length); if (file) { var img; img = new Image(file); img.onload = function() { alert(this.width + " " + this.height); }; img.onerror = function() { alert( "not a valid file: " + file.type); }; } I found the code here: jsfiddle Here it works perfectly, but for some reason when i implement it to my project and debug it, i can see it skips over the onload and onerror functions.
answer count: 0
type: Question
has comment: http://stackoverflow.com/comment/45198341
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/45049978
score: 3
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28353067
has text: apples and oranges... and entirely dependant on how you use each.

http://stackoverflow.com/comment/45182589
score: 0
type: QuestionComment
type: Comment
has text: You can always ajax post the Javascript array and at server-side you can collect. e.g you have an array `myArr = ["Sunday","Monday","Tuesday"]` just use the ajax to send it `$.ajax({url:"/post.php",type:'POST', data:{theArray:myArr }}, success:function(resp){alert(JSON.stringify(resp));}})` On server you'd get it like `$thearray = $_POST['theArray']; ` . Have you tried this? If not AJAX then try to just normal post the form?
comment on: http://stackoverflow.com/q/28424447

http://stackoverflow.com/comment/62364381
has text: as long as you're keeping the old value - you don't really need to compare the lengths of everything. It's enough to check if self.val() != prevValue
type: Comment
comment on: http://stackoverflow.com/a/28301743
score: 1
type: AnswerComment

http://stackoverflow.com/a/28414722
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45163404
type: Answer
accepted answer of: http://stackoverflow.com/q/28414446
has body: In the link you posted, it looks like it is the style selectors for html and body, as it is setting the height to 100%, which is probably messing up your layout. Try removing them from the selector, and give the map the height and width you want and see if it works: &lt;style&gt; #map-canvas { height: 500px; width:400px margin: 0px; padding: 0px } &lt;/style&gt; The reason the map would not work without it was that it had no height, thus it did not appear on the page.
answers question: http://stackoverflow.com/q/28414446
has comment: http://stackoverflow.com/comment/45163324
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45164251
upvote count: 1

http://stackoverflow.com/q/28351458
type: AnsweredQuestion
tagged with: angularjs
has answer: http://stackoverflow.com/a/28351631
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/28351631
has body: I'm reading Pro AngularJS by Adam Freeman, and I have a nitpicky question concerning one of the book's examples: myApp.controller("tomorrowCtrl", function($scope) { var dayNames = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday";] $scope.day = dayNames[(new Date().getDay() + 1) % 7]; }); I understand what this controller's overall purpose is: to show the name of the day of the week on the view via $scope.day. But I'm confused about why the controller is using an ordinary Javascript array - var dayNames - to create the $scope object. The AngularJS controller documentation explains that controllers are used to: set up the initial state of the $scope object [and to] add behavior to the $scope object. And sure enough, dayNames helps set up the initial state of the $scope object. It also contains a bit of the application's business logic, so I guess it sort of checks out. My worry is that I haven't found any other examples of AngularJS controllers that follow this design pattern; I haven't found anything in the Angular controller docs, nor the PhoneCat tutorial. Does it make sense to include ordinary Javascript objects in AngularJS controllers like this? (Is this considered harmless?) If not, why? Are there any good reasons to not include ordinary Javascript objects in controllers? Also, is there a different way that dayNames should fit into the Angular schema, like a directive or a service?
possible better answer: http://stackoverflow.com/a/28351646
score: 0
has answer: http://stackoverflow.com/a/28351646
has comment: http://stackoverflow.com/comment/45046837
tagged with: javascript
has title: Should one avoid including regular Javascript objects in AngularJS controllers?

http://stackoverflow.com/comment/44975075
type: Comment
has text: Doing such kind of code introspection is pointless IMO. You would never perform partial function application this way (that's how this is called). If once whishes to support named parameters then the function should be designed to take a map rather than multiple params e.g. `function doSomething(paramsMap) {}`
score: 0
comment on: http://stackoverflow.com/q/28312348
type: QuestionComment

http://stackoverflow.com/q/28383102
type: Question
has answer: http://stackoverflow.com/a/28384474
tagged with: javascript
has body: I'm working on a bbcode example, but i cannot seem to get it to work. the regex matches all the [img] tags and make it all look wierd. I'm trying to have the option to click on the image and get it full size and when I do, everything becomes a link (when i have more than once img-tag). Here's my text: [img size="small" clickable="no"]img1.jpg[/img] [img size="large" clickable="yes"]img2.jpg[/img] Here's my source code: var bbArray = [/\n/g, /\[img size="(.*?)" clickable="yes"\](.*?)\[\/img\]/g, /\[img size="(.*?)" clickable="no"\](.*?)\[\/img\]/g]; var bbReplace = ['&lt;br&gt;', '&lt;a href="'+path+'img/$2" target="_blank"&gt;&lt;img src="'+path+'img/$1_$2?'+ new Date().getTime() +'" alt="$2"&gt;&lt;/a&gt;', '&lt;img src="'+path+'img/$1_$2?'+ new Date().getTime() +'" alt="$2"&gt;']; The operation: for (var i = 0; i &lt; content_text_bb.length; i++) { content_text_bb = content_text_bb.replace(bbArray[i], bbReplace[i]); } the result: &lt;img src="localhost/img/small" clickable="no" ]img1.jpg[="" img] [img size="large_img2.jpg?1423317485160" alt="img2.jpg"&gt;; I'm not that familiar with regex and I really need someone to look at it, I'm lost.
possible better answer: http://stackoverflow.com/a/28384474
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28384038
has comment: http://stackoverflow.com/comment/45105100
tagged with: bbcode
accepted answer: http://stackoverflow.com/a/28384038
tagged with: regex
type: AnsweredQuestion
has title: Regex, doesnt stop matching

http://stackoverflow.com/q/28406575
score: 0
has title: Vide.js looping through multiple videos
has answer: http://stackoverflow.com/a/28406660
type: Question
has body: I'm using vide to play a video background on my website. I want to play one video then a second video before looping back to the first video again. Can / has this be done using vide. If so has anyone got any code Kind regards Jordan
tagged with: javascript
answer count: 1
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/44998690
has text: Thank you! I can't believe that the answer is so simple :)
type: Comment
comment on: http://stackoverflow.com/a/28325435
score: 0
type: AnswerComment

http://stackoverflow.com/a/28585424
answers question: http://stackoverflow.com/q/28421505
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: I agree with the general notion of other answers that this is a borderline relational problem. The key to MongoDB data models is write-heaviness, but that can be tricky for this use case, mostly because of the bookkeeping that would be required if you wanted to link users to items directly (a change to a group that is followed by lots of users would incur a huge number of writes, and you need some worker to do this). Let's investigate whether the read-heavy model is inapplicable here, or whether we're doing premature optimization. The Read Heavy Approach Your key concern is the following use case: a real performance issue could be when I want to get all of the groups that a user is following for a specific item [...] because then I have to find all of the groups the user is following, and from that find all of the item_groups with the group_id $in and the item id. Let's dissect this: Get all groups that the user is following That's a simple query: db.followers.find({userId : userId}). We're going to need an index on userId which will make the runtime of this operation O(log n), or blazing fast even for large n. from that find all of the item_groups with the group_id $in and the item id Now this the trickier part. Let's assume for a moment that it's unlikely for items to be part of a large number of groups. Then a compound index { itemId, groupId } would work best, because we can reduce the candidate set dramatically through the first criterion - if an item is shared in only 800 groups and the user is following 220 groups, mongodb only needs to find the intersection of these, which is comparatively easy because both sets are small. We'll need to go deeper than this, though: The structure of your data is probably that of a complex network. Complex networks come in many flavors, but it makes sense to assume your follower graph is nearly scale-free, which is also pretty much the worst case. In a scale free network, a very small number of nodes (celebrities, super bowl, …
score: 17
upvote count: 17
accepted answer of: http://stackoverflow.com/q/28421505

http://stackoverflow.com/comment/44975241
type: Comment
comment on: http://stackoverflow.com/q/28311334
score: 0
has text: @Macsupport Isotope v1.5.25
type: QuestionComment

http://stackoverflow.com/comment/44974026
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/28311484
has text: Do you have **dataTables.colReorder.js** script included perhaps? If so, remove `R` letter from `sDom` option.

http://stackoverflow.com/comment/45117567
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28390079
has text: is this for an input, textarea, or contenteditable div?
score: 0

http://stackoverflow.com/comment/45143395
type: QuestionComment
comment on: http://stackoverflow.com/q/28404439
score: 3
has text: What about Windows Key on Mac?
type: Comment

http://stackoverflow.com/comment/45046367
has text: @TSV I didnt downvoted, I dont have the rights to downvote :) I accepted your answer as it solved my problem :)
type: Comment
comment on: http://stackoverflow.com/a/28300078
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45042062
has text: Thanks for your help :) keep me in touch !
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28333636

http://stackoverflow.com/a/28293580
downvote count: 0
type: Answer
upvote count: 3
has comment: http://stackoverflow.com/comment/44943215
score: 3
has body: You can use Array.filter (see MDN) to filter out the desired value: var arr = 'etst,tset,tets,ttest,teest,tesst,testt,4est,test,dest'.split(',') ,val = 'test' document.querySelector('#result') .innerHTML = arr.filter(function (v) {return v != val}); &lt;div id="result"&gt;&lt;/div&gt; A text field example in this jsFiddle
has comment: http://stackoverflow.com/comment/44942223
answers question: http://stackoverflow.com/q/28293520

http://stackoverflow.com/a/28292672
upvote count: 2
has comment: http://stackoverflow.com/comment/44970109
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28292620
type: Answer
answers question: http://stackoverflow.com/q/28292620
score: 2
has comment: http://stackoverflow.com/comment/44939932
downvote count: 0
has comment: http://stackoverflow.com/comment/44938360
has body: EDIT: Oh, I didn't notice it before, but you're using the for..in loop, and then operating on the key instead of the value. Make your loop as so: for (var century in obj) { console.log(century + ": " + average(obj[century])); } Read up on the Array.prototype.reduce function. The reduce function expects as the first argument a callback - a function which operates on, and returns a mutable object (object or array). From the MDN link itself: reduce executes the callback function once for each element present in the array, excluding holes in the array, receiving four arguments: the initial value (or value from the previous callback call), the value of the current element, the current index, and the array over which iteration is occurring.

http://stackoverflow.com/comment/45161088
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28413855
has text: With time and effort - yes.
score: 1

http://stackoverflow.com/comment/97704013
score: 0
type: Comment
comment on: http://stackoverflow.com/a/36710108
type: AnswerComment
has text: this plugin is deprecated and no longer maintained

http://stackoverflow.com/comment/44983596
has text: I think I can something almost working using js: 'post' + window.location.pathname.substr(-2,2) which if the id is two digits long would give me the appropriate id, but I'm still not sure how to have it change on request.
comment on: http://stackoverflow.com/q/28317089
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28341570
type: AcceptedAnswer
downvote count: 0
has body: You can add a variable 'lang' to the rootscope and then set this variable by read your cookie or localstorage or by read the browser setting (whatever way you go). Based on this variable you can add your language class='{{lang}}' to the same element like your ng-app attribute. Then you can change your font based on this class. If you provide to change the language dynamically by a function using $translate.use then change also your varaiable 'lang' on rootscope and write the changes back to your persistence layer like cookie or localstorage. app.controller('Ctrl', ['$translate', '$scope', '$rootScope', function($translate, $scope, $rootScope) { //better set this in your run function based //on your cookie or localstorage $rootScope.lang = "en"; $scope.changeLanguage = function(langKey) { $translate.use(langKey); $rootScope.lang = langKey; //persist to cookie or localstorage here }; } ]); http://plnkr.co/edit/SnDjGceqNosrkwxflvh7?p=preview
answers question: http://stackoverflow.com/q/28339838
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28339838
score: 1

http://stackoverflow.com/q/28416615
has comment: http://stackoverflow.com/comment/45166361
type: AnsweredQuestion
score: 2
upvote count: 2
tagged with: formatting
has answer: http://stackoverflow.com/a/28416898
type: Question
possible better answer: http://stackoverflow.com/a/28416689
has comment: http://stackoverflow.com/comment/45166380
has answer: http://stackoverflow.com/a/28416689
tagged with: javascript
has answer: http://stackoverflow.com/a/28416815
answer count: 3
has body: When creating an if block, I was wondering if there was any reason beyond personal preference to use the standard bracket formatting vs the second one I listed. I've run code in the second format without any obvious issues (no ASI or unexpected errors), just looking for some clarification or insight on if there could be any possible issues in the future if I permanently switch to this style. // Standard formatting if (true) { } else { } // Other formatting if (true) { } else { }
has title: Javascript else on a new line
downvote count: 0
accepted answer: http://stackoverflow.com/a/28416815
favorite count: 0
linked to: http://stackoverflow.com/q/8130134

http://stackoverflow.com/q/28394621
type: AnsweredQuestion
tagged with: mysql
type: Question
has comment: http://stackoverflow.com/comment/45126331
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/45125726
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45125714
has body: I would like to implement a JavaScript code to count down hundred seconds. I have written the code for count down, but I need the value of the remaining time and update it in a database on every second. Below is an example of what I would like to accomplish: On Every second I would like to run: UPDATE 'table' SET 'timeleft=[remaining time]' Is this possible? Below is what I've tried so far: &lt;? $time = "100"; ?&gt; &lt;script&gt; var intCountDown = &lt;?php echo $time; ?&gt;; function countDown() { if(intCountDown &lt; 0) { cntdwn.innerText = 'Done'; return; } cntdwn.innerText = intCountDown--; setTimeout("countDown()",1000); } &lt;/script&gt; Then just: &lt;div id=cntdwn&gt;&lt;/div&gt; Additionally this may help clarify my intention: I want to implement a single-shot timer but prefer the counter to overflow back to where it started after the page refresh.
has title: javascript countdown and updates database php
has answer: http://stackoverflow.com/a/28395001
tagged with: php
accepted answer: http://stackoverflow.com/a/28395001

http://stackoverflow.com/a/28316392
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28316334
has comment: http://stackoverflow.com/comment/44981862
has comment: http://stackoverflow.com/comment/44982631
type: Answer
has comment: http://stackoverflow.com/comment/44982528
has body: Try this :There is problem in your if condition as it is getting always true. You can use .length to check if option exist and select the option else select blank $('#FirstDropdown').change(function() { if ($('#SecondDropdown option:contains('+this.value +')').length&gt;0){ $('#SecondDropdown option:contains('+this.value +')').prop('selected',true); }else{ $("#SecondDropdown option[value='-1']").prop('selected',true); } }); JSFiddle Demo
has comment: http://stackoverflow.com/comment/44982661
answers question: http://stackoverflow.com/q/28316334
score: 0

http://stackoverflow.com/comment/45129390
comment on: http://stackoverflow.com/a/28396469
has text: Right code: function addItem(txt) { var list = document.createElement("li"); var listwithTxt = document.createTextNode(txt) list.appendChild(listwithTxt); var listAtr = list.setAttribute("class", "list-group-item"); var inList = document.createElement("button"); var inListAtr = inList.setAttribute("class", "btn btn-default glyphicon glyphicon-minus"); var listContainer= document.getElementById("myList"); listContainer.appendChild(list).appendChild(inList); }
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/28411442
answers question: http://stackoverflow.com/q/28410843
has body: As I said: Two loops. The first selects all remaining price lists, the second iterates over all item tags. Filling them with the cloned category and subcategory. //DO NOT USE THIS SECTION, THIS IS ONLY TO PARSE THE XML STRING SAMPLE INTO A VALID DOCUMENT var xmlDoc = document.implementation.createDocument("", "", null); xmlDoc.preserveWhiteSpace = false; var parser = new DOMParser(); xmlDoc = parser.parseFromString(document.querySelector("textarea").value.trim(),"text/xml"); //END //first delete the unwanted pricelist var unwanted = xmlDoc.querySelectorAll("pricelist > category[id='89'], pricelist > category[id='90']"); Array.prototype.map.call(unwanted, function(element){ element.parentNode.parentNode.removeChild(element.parentNode); //elements deleted }); //now parse the rest //The first loop will select all pricelists and iterates over them using Array.prototype.map. var priceLists = xmlDoc.querySelectorAll("pricelist"); Array.prototype.map.call(priceLists, function(element){ //select the category and sub var cat = element.getElementsByTagName("category")[0]; var subCat = element.getElementsByTagName("subcategory")[0]; //now select all item tags. Iterate over them with a normal loop for more clarity. var items = element.getElementsByTagName("item"); for (var i = 0; i < items.length; ++i) { var temp = cat.cloneNode(true); //clone the category var temp2 = subCat.cloneNode(true); //clone the subcategory items[i].appendChild(temp); //append them items[i].appendChild(temp2); } }); // display the XML :: NOT PART OF THE SOLUTION CODE document.getElementById("display").value = new XMLSerializer().serializeToString(xmlDoc.documentElement); test 1 test 2 test 3 test 4
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45157019
accepted answer of: http://stackoverflow.com/q/28410843
type: Answer

http://stackoverflow.com/comment/44926665
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28286260
has text: ***From the html page people can click on buttons which do post requests to other pages*** - Post requests will go only to server and not directly goes to other jsp pages
type: Comment

http://stackoverflow.com/q/28405879
has answer: http://stackoverflow.com/a/28406039
type: AnsweredQuestion
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/45146213
has title: load image inside JavaScript function
possible better answer: http://stackoverflow.com/a/28423479
has answer: http://stackoverflow.com/a/28406010
type: Question
has answer: http://stackoverflow.com/a/28423479
tagged with: javascript
tagged with: image
answer count: 3
tagged with: canvas
tagged with: function
tagged with: html5-canvas
downvote count: 0
has body: i have function to get image pixels color function getImage(imgsrc){ var img = $( "&lt;img&gt;", { src: imgsrc }); var imageMap = new Object(); img.load(function() { var canvas = $('&lt;canvas/&gt;')[0].getContext('2d'); canvas.width = this.width; canvas.height = this.height; canvas.drawImage(this, 0, 0, this.width, this.height); for(var i = 0;i &lt; this.width;i++){ imageMap[i] = new Object(); for(var j = 0;j &lt; this.width;j++){ var pixelData = canvas.getImageData(i, j, 1, 1).data; imageMap[i][j] = rgbToHex(pixelData[0],pixelData[1],pixelData[2]); } } console.log(imageMap[40][40]); }); console.log(imageMap[40][40]); return imageMap; } but it return undefined(it print 2nd console.log first) what's wrong? thx.
accepted answer: http://stackoverflow.com/a/28406010
favorite count: 0